From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#25111: (Inaccurate documentation of inhibit-modification-hooks) Date: Sun, 9 Jun 2019 20:45:25 +0000 Message-ID: <20190609204525.GB6712@ACM> References: <20190519203119.GA5309@ACM> <87y32u908k.fsf@gmail.com> <20190525134407.GA10864@ACM> <87sgt28ut4.fsf@gmail.com> <20190527143109.GA5863@ACM> <20190603191549.GA4009@ACM> <85tvd6bhch.fsf@gmail.com> <20190604093241.GA5790@ACM> <838suhto2r.fsf@gnu.org> <83muirarzj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="118815"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: phillip.lord@russet.org.uk, npostavs@gmail.com, 25111@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 09 22:46:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ha4he-000Uki-LE for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Jun 2019 22:46:10 +0200 Original-Received: from localhost ([::1]:38340 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1ha4hd-00055d-Hz for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Jun 2019 16:46:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48413) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1ha4hX-0004vq-Qa for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2019 16:46:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ha4hW-00084P-Mo for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2019 16:46:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41929) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ha4hW-00084H-Iq for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2019 16:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ha4hW-0003GH-Cb for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2019 16:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Jun 2019 20:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25111 X-GNU-PR-Package: emacs Original-Received: via spool by 25111-submit@debbugs.gnu.org id=B25111.156011313712501 (code B ref 25111); Sun, 09 Jun 2019 20:46:02 +0000 Original-Received: (at 25111) by debbugs.gnu.org; 9 Jun 2019 20:45:37 +0000 Original-Received: from localhost ([127.0.0.1]:55473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ha4h6-0003FY-TG for submit@debbugs.gnu.org; Sun, 09 Jun 2019 16:45:37 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:33900 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1ha4h2-0003FN-50 for 25111@debbugs.gnu.org; Sun, 09 Jun 2019 16:45:33 -0400 Original-Received: (qmail 96889 invoked by uid 3782); 9 Jun 2019 20:45:27 -0000 Original-Received: from acm.muc.de (p2E5D56FA.dip0.t-ipconnect.de [46.93.86.250]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 09 Jun 2019 22:45:25 +0200 Original-Received: (qmail 18569 invoked by uid 1000); 9 Jun 2019 20:45:25 -0000 Content-Disposition: inline In-Reply-To: <83muirarzj.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:160296 Archived-At: Hello, Eli. On Sun, Jun 09, 2019 at 15:00:16 +0300, Eli Zaretskii wrote: > > Date: Tue, 04 Jun 2019 17:36:12 +0300 > > From: Eli Zaretskii > > Cc: phillip.lord@russet.org.uk, 25111@debbugs.gnu.org, npostavs@gmail.com > > > Date: Tue, 4 Jun 2019 09:32:41 +0000 > > > Cc: Eli Zaretskii , Phillip Lord , > > > 25111@debbugs.gnu.org > > > From: Alan Mackenzie > > > > > This is difficult to document coherently. > > > > And confusing, as evidenced by the fact that we both got confused about > > > > it in this very thread :) > > > > > My proposal of last week was to fix the code, also to bind > > > > > inhibit-modification-hooks to t for the modification-hooks overlay > > > > > property, even though this would be an incompatibility in Lisp. > > > How about this? > > Please wait with this for a few days. > OK, after re-reading the discussions and the code, I don't think we > should make the incompatible change suggested by Alan. We haven't > bound inhibit-modification-hooks to t in the text-property hooks since > the day the code was written, 24 years ago, so it makes no sense to me > to do that now. Let's document the exception and move on. Thanks for looking at this and taking the decision. > Noam's last patch LGTM, with the single minor gotcha: > > +When Emacs calls these functions, @code{inhibit-modification-hooks} is > > +set to @code{nil}, unlike for change hooks. > This is from the part that changes the "Special Properties" node, and > it's inaccurate: we don't bind inhibit-modification-hooks to nil, we > just leave it at its previous binding. This distinction is important > in recursive calls, when the caller caused inhibit-modification-hooks > to be bound to non-nil. Yes. The "is set" formulation is ambiguous. It could mean "gets set (bound)", which is how you read it; it could also mean "happens to be set to (at the time)", which was how I intended it. Ambiguous writing isn't good, so I suggest: "When Emacs calls this function, @code{inhibit-modification-hooks} is left at its current value; unlike for change hooks, it does not get bound to non-@code{nil}. > Another minor comment, although not to the proposed text, is that the > fact that inhibit-modification-hooks is bound to t when the hook > specified by the overlay properties are called is because those hooks > are called from within signal_before_change and signal_after_change, > which perform these bindings, and the bindings stay in effect both for > before/after-change-functions and for hooks specified by overlay > properties. By contrast, the hooks specified by text properties are > called before that binding becomes in effect (which is why we need a > separate check whether inhibit_modification_hooks are non-nil inside > verify_interval_modification, which calls the text-property hooks). Thanks, that's helpful. > Thanks. -- Alan Mackenzie (Nuremberg, Germany).