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: Sat, 25 May 2019 13:44:07 +0000 Message-ID: <20190525134407.GA10864@ACM> References: <8360myl7ay.fsf@gnu.org> <87wpfbpual.fsf@russet.org.uk> <83eg1iiffm.fsf@gnu.org> <87pol1kon4.fsf@russet.org.uk> <83bmwlggix.fsf@gnu.org> <878trmxgjh.fsf@russet.org.uk> <83lgvlcet1.fsf@gnu.org> <20190519203119.GA5309@ACM> <87y32u908k.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="15838"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 25111@debbugs.gnu.org, Phillip Lord To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 25 15:45:16 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 1hUWz5-0003uo-Vh for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 May 2019 15:45:16 +0200 Original-Received: from localhost ([127.0.0.1]:42385 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUWz4-0004QO-TM for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 May 2019 09:45:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUWyw-0004Pp-MC for bug-gnu-emacs@gnu.org; Sat, 25 May 2019 09:45:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hUWyv-0008HW-8g for bug-gnu-emacs@gnu.org; Sat, 25 May 2019 09:45:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34907) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hUWyv-0008Go-4F for bug-gnu-emacs@gnu.org; Sat, 25 May 2019 09:45:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hUWyu-0004ld-Ve for bug-gnu-emacs@gnu.org; Sat, 25 May 2019 09:45:05 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 May 2019 13:45:04 +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.155879185718220 (code B ref 25111); Sat, 25 May 2019 13:45:04 +0000 Original-Received: (at 25111) by debbugs.gnu.org; 25 May 2019 13:44:17 +0000 Original-Received: from localhost ([127.0.0.1]:48447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hUWy9-0004jn-G1 for submit@debbugs.gnu.org; Sat, 25 May 2019 09:44:17 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:31556 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1hUWy6-0004jX-Ks for 25111@debbugs.gnu.org; Sat, 25 May 2019 09:44:15 -0400 Original-Received: (qmail 10877 invoked by uid 3782); 25 May 2019 13:44:08 -0000 Original-Received: from acm.muc.de (p4FE15042.dip0.t-ipconnect.de [79.225.80.66]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 25 May 2019 15:44:07 +0200 Original-Received: (qmail 10920 invoked by uid 1000); 25 May 2019 13:44:07 -0000 Content-Disposition: inline In-Reply-To: <87y32u908k.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:159756 Archived-At: Hello, Noam. On Sat, May 25, 2019 at 08:39:39 -0400, Noam Postavsky wrote: > Alan Mackenzie writes: > > @@ -1743,9 +1743,17 @@ Overlay Properties > > However, doing this can sometimes confuse the internal > > +mechanism that calls all these hooks, leading, for example, to calling > > +them recursively, which is usually unwanted. > > @@ -3621,9 +3621,14 @@ Special Properties > > +When Emacs calls these functions, @code{inhibit-modification-hooks} is > > +set to @code{nil}. > As Phillip mentioned in the OP, Emacs in fact binds it to t. Are you sure? We're talking here about the text property (in which I think inhibit-modification-hooks IS at nil) as opposed to the overlay property (where inhibit-modification-hooks is bound to t). I admit just to having examined the source code rather than actually trying it out. But in verify_interval_modification in textprop.c, near the end, we have: if (!inhibit_modification_hooks) { hooks = Fnreverse (hooks); while (! NILP (hooks)) { call_mod_hooks (Fcar (hooks), make_fixnum (start), make_fixnum (end)); hooks = Fcdr (hooks); } } . Here, mod_hooks is a list of modification-hooks combined with positions. call_mod_hooks only gets called when inhibit-modification-hooks is nil. call_mod_hooks just calls the hooks, without binding i-m-h. Are you really sure? I'll answer the rest of your post later, I've got a lot on in Real Life at the moment. [ .... ] -- Alan Mackenzie (Nuremberg, Germany).