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: Tue, 4 Jun 2019 09:32:41 +0000 Message-ID: <20190604093241.GA5790@ACM> 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> 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="162287"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 25111@debbugs.gnu.org, Phillip Lord To: npostavs@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 04 11:33:15 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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hY5og-000g45-Pe for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Jun 2019 11:33:15 +0200 Original-Received: from localhost ([127.0.0.1]:49333 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hY5oe-0007q7-GH for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Jun 2019 05:33:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hY5oV-0007px-2X for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2019 05:33:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hY5oU-0000wT-0e for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2019 05:33:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58579) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hY5oT-0000wN-Tp for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2019 05:33:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hY5oT-00020K-PH for bug-gnu-emacs@gnu.org; Tue, 04 Jun 2019 05:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Jun 2019 09:33:01 +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.15596407687679 (code B ref 25111); Tue, 04 Jun 2019 09:33:01 +0000 Original-Received: (at 25111) by debbugs.gnu.org; 4 Jun 2019 09:32:48 +0000 Original-Received: from localhost ([127.0.0.1]:43890 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hY5oF-0001zm-NC for submit@debbugs.gnu.org; Tue, 04 Jun 2019 05:32:47 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:37649 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1hY5oD-0001zd-B0 for 25111@debbugs.gnu.org; Tue, 04 Jun 2019 05:32:46 -0400 Original-Received: (qmail 33510 invoked by uid 3782); 4 Jun 2019 09:32:43 -0000 Original-Received: from acm.muc.de (p4FE15D2B.dip0.t-ipconnect.de [79.225.93.43]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 04 Jun 2019 11:32:41 +0200 Original-Received: (qmail 6089 invoked by uid 1000); 4 Jun 2019 09:32:41 -0000 Content-Disposition: inline In-Reply-To: <85tvd6bhch.fsf@gmail.com> 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:160099 Archived-At: Hello, Noam. On Mon, Jun 03, 2019 at 15:26:38 -0400, npostavs@gmail.com wrote: > Alan Mackenzie writes: > > Hello, Eli. > > To recap, the problem we were talking about was the modification-hooks > > overlay property, whose value is a function which gets called before and > > after modification of the text under an overlay. > > When such a function gets called, inhibit-modification-hooks is left at > > nil. When the other four similar overlay/text-property "change > > functions" get called, inhibit-modification-hooks gets bound to t. > Minor correction: it's the modification-hooks text property which have > inhibit-modification-hooks left at nil, when the overlay property > modification-hooks get called inhibit-modification-hooks is bound to t, > just like in the after/before-change-functions case. Oh, bother. ;-) > > 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? diff --git a/src/textprop.c b/src/textprop.c index ae42c44185..607bd40676 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -2247,6 +2247,8 @@ verify_interval_modification (struct buffer *buf, if (!inhibit_modification_hooks) { + int count = SPECPDL_INDEX (); + specbind (Qinhibit_modification_hooks, Qt); hooks = Fnreverse (hooks); while (! NILP (hooks)) { @@ -2254,6 +2256,7 @@ verify_interval_modification (struct buffer *buf, make_fixnum (end)); hooks = Fcdr (hooks); } + unbind_to (count, Qnil); } } } -- Alan Mackenzie (Nuremberg, Germany).