From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25111: (Inaccurate documentation of inhibit-modification-hooks) Date: Sun, 09 Jun 2019 15:00:16 +0300 Message-ID: <83muirarzj.fsf@gnu.org> References: <83bmwlggix.fsf@gnu.org> <878trmxgjh.fsf@russet.org.uk> <83lgvlcet1.fsf@gnu.org> <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> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="144397"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 25111@debbugs.gnu.org, npostavs@gmail.com To: acm@muc.de, phillip.lord@russet.org.uk Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 09 14:01:11 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 1hZwVb-000bQ5-16 for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Jun 2019 14:01:11 +0200 Original-Received: from localhost ([::1]:35220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZwVZ-0003GJ-Fa for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Jun 2019 08:01:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35808) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZwVU-0003FV-IU for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2019 08:01:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZwVS-00081w-O1 for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2019 08:01:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40854) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hZwVS-00081r-KK for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2019 08:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hZwVS-00058O-I3 for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2019 08:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Jun 2019 12:01: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.156008165319714 (code B ref 25111); Sun, 09 Jun 2019 12:01:02 +0000 Original-Received: (at 25111) by debbugs.gnu.org; 9 Jun 2019 12:00:53 +0000 Original-Received: from localhost ([127.0.0.1]:54398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hZwVJ-00057t-Ff for submit@debbugs.gnu.org; Sun, 09 Jun 2019 08:00:53 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55192) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hZwVG-00057Z-0h for 25111@debbugs.gnu.org; Sun, 09 Jun 2019 08:00:52 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hZwV5-0007pQ-QT; Sun, 09 Jun 2019 08:00:43 -0400 Original-Received: from [176.228.60.248] (port=1383 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hZwUp-0007y6-GV; Sun, 09 Jun 2019 08:00:33 -0400 In-reply-to: <838suhto2r.fsf@gnu.org> (message from Eli Zaretskii on Tue, 04 Jun 2019 17:36:12 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:160272 Archived-At: > 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. 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. 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.