From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#56682: feature/improved-locked-narrowing 9dee6df39c: Reworked locked narrowing. Date: Fri, 30 Dec 2022 17:25:58 +0000 Message-ID: <6c9d91cffc394613f58a@heytings.org> References: <166939872890.18950.12581667269687468681@vcs2.savannah.gnu.org> <20221125175209.51166C004B6@vcs2.savannah.gnu.org> <6c9d91cffc1bfd801530@heytings.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35740"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 30 18:27:20 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pBJA7-00095h-SV for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 30 Dec 2022 18:27:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pBJ9r-0005CW-9M; Fri, 30 Dec 2022 12:27:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBJ9q-0005CO-AW for bug-gnu-emacs@gnu.org; Fri, 30 Dec 2022 12:27:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pBJ9q-0000Sy-2e for bug-gnu-emacs@gnu.org; Fri, 30 Dec 2022 12:27:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pBJ9p-0005Vm-KN for bug-gnu-emacs@gnu.org; Fri, 30 Dec 2022 12:27:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Dec 2022 17:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56682 X-GNU-PR-Package: emacs Original-Received: via spool by 56682-submit@debbugs.gnu.org id=B56682.167242116221108 (code B ref 56682); Fri, 30 Dec 2022 17:27:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 30 Dec 2022 17:26:02 +0000 Original-Received: from localhost ([127.0.0.1]:36055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBJ8s-0005UM-2y for submit@debbugs.gnu.org; Fri, 30 Dec 2022 12:26:02 -0500 Original-Received: from heytings.org ([95.142.160.155]:52056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBJ8p-0005Tw-Qc for 56682@debbugs.gnu.org; Fri, 30 Dec 2022 12:26:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1672421158; bh=qeYw/5fauEzZR1OdCO1BCtRJgdUtPKcax7puz9krsoA=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=okdWWKDiQxdQ+75s1PXpXNU5Gn62MxktFOdscWR4Y6b2N7PZz4DdHuay37oxmaAPi Rtrgl291+GgwmhiiPnzGpvdMdz6L9iLruvUvtwgQC0yGk7YdTqJfCYvHlObtsE2V/B XD/4tp5jdS04sBcL+wk24NSmftJ8NTv0nnBfNazcWx0+fxoVP/ebprO3LbAFh+XKkK Kz6ciiObDBWolIYWNjng3kEWqLYlKPvJRVG6TV64HRelYr4N15xsqR9uiRiFNny5zN uft1c4XOGtbZN1pP7v2tTtQ62dl/v8xr4eiKU+FxSchbvwlUBc7DwgKz2U62UtICCG AOFrEdJiu+Jew== In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:252145 Archived-At: > > I think it's quite urgent (it's all too easy to forget: better a subpar > entry than no entry at all). > I'll do that very soon. > > Hmm... I understand that part but that doesn't tell me how I (the coder) > or the function can find out which tag to use :-( > You have to know where your function is called and by which caller a lock was placed. Currently there are three such tags (and I don't expect more tags in core): fontification-functions, pre-command-hook and post-command-hook. > > Looking more at the code, I have another question: why is > `narrowing_locks` a global alist indexed by buffers, instead of being a > buffer-local variable? > For efficiency reasons. If it were a buffer-local variable, reset_outermost_narrowings, which is called by redisplay_internal, would have to consider all buffers, which would become unnecessarily slow with many (say 1000) buffers. With a global alist, only the (few) buffers in which narrowing locks are actually in effect are considered.