Subject: Re: bug#25111: (Inaccurate documentation of inhibit-modification-hooks)

From: Alan Mackenzie <[email-masked]>
Date: Sat, 25 May 2019 13:44:07 +0000

Hello, Noam.

On Sat, May 25, 2019 at 08:39:39 -0400, Noam Postavsky wrote:
> Alan Mackenzie <[email-masked]> 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).