From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: phillip.lord@russet.org.uk, npostavs@gmail.com, 25111@debbugs.gnu.org
Subject: bug#25111: (Inaccurate documentation of inhibit-modification-hooks)
Date: Sun, 9 Jun 2019 20:45:25 +0000 [thread overview]
Message-ID: <20190609204525.GB6712@ACM> (raw)
In-Reply-To: <83muirarzj.fsf@gnu.org>
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 <eliz@gnu.org>
> > 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 <eliz@gnu.org>, Phillip Lord <phillip.lord@russet.org.uk>,
> > > 25111@debbugs.gnu.org
> > > From: Alan Mackenzie <acm@muc.de>
> > > > > 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).
next prev parent reply other threads:[~2019-06-09 20:45 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-04 20:53 bug#25111: Phillip Lord
2016-12-05 15:33 ` bug#25111: Eli Zaretskii
[not found] ` <87wpfbpual.fsf@russet.org.uk>
2016-12-07 16:40 ` bug#25111: Phillip Lord
[not found] ` <WM!2f8d5bad87de09a0621b1f025704a97dd719ed1ae7d08e03f6b419e215cd51bc54917b522795d7421de3533c07950608!@mailhub-mx1>
2016-12-08 15:55 ` bug#25111: Eli Zaretskii
2016-12-09 17:17 ` bug#25111: Phillip Lord
2016-12-09 17:26 ` bug#25111: Eli Zaretskii
2016-12-11 22:11 ` bug#25111: Phillip Lord
2016-12-12 16:06 ` bug#25111: Eli Zaretskii
2019-05-19 20:31 ` bug#25111: (Inaccurate documentation of inhibit-modification-hooks) Alan Mackenzie
2019-05-25 12:39 ` Noam Postavsky
2019-05-25 13:44 ` Alan Mackenzie
2019-05-25 14:36 ` Noam Postavsky
2019-05-27 14:31 ` Alan Mackenzie
2019-06-03 19:15 ` Alan Mackenzie
2019-06-03 19:26 ` npostavs
2019-06-04 9:32 ` Alan Mackenzie
2019-06-04 14:36 ` Eli Zaretskii
2019-06-09 12:00 ` Eli Zaretskii
2019-06-09 20:45 ` Alan Mackenzie [this message]
2019-06-24 12:52 ` Alan Mackenzie
2019-06-24 22:48 ` Noam Postavsky
2019-06-25 9:17 ` Alan Mackenzie
2019-05-25 13:49 ` Eli Zaretskii
2016-12-05 17:39 ` bug#25111: How modification-hooks let-bind inhibit-modification-hooks? Noam Postavsky
2016-12-05 18:37 ` Eli Zaretskii
2017-03-09 19:34 ` Noam Postavsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190609204525.GB6712@ACM \
--to=acm@muc.de \
--cc=25111@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=npostavs@gmail.com \
--cc=phillip.lord@russet.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).