[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#25111: How modification-hooks let-bind inhibit-modification-hooks?
From: |
Eli Zaretskii |
Subject: |
bug#25111: How modification-hooks let-bind inhibit-modification-hooks? |
Date: |
Mon, 05 Dec 2016 20:37:09 +0200 |
> From: Noam Postavsky <npostavs@users.sourceforge.net>
> Date: Mon, 5 Dec 2016 12:39:29 -0500
> Cc: Phillip Lord <phillip.lord@russet.org.uk>, 25111@debbugs.gnu.org
>
> >> The documentation for "modification-hooks" on overlays says:
> >>
> >> If these functions modify the buffer, they should bind
> >> ‘inhibit-modification-hooks’ to ‘t’ around doing so, to avoid
> >> confusing the internal mechanism that calls these hooks.
> >>
> >> But as far as I can see, the only place these gets called
> >> "signal_after_change"
> >> and "signal_before_change", inhibit-modification-hooks is already specbound
> >> to t, so this advice is unnecessary.
> >>
> >> Also, the documentation for inhibit-modification-hooks says:
> >>
> >> If you do want modification hooks to be run in a particular
> >> piece of code that is itself run from a modification hook, then
> >> rebind locally ‘inhibit-modification-hooks’ to ‘nil’.
> >>
> >> which suggests that, in fact, it is possible to call the modification
> >> hooks from inside another call to these functions.
> >
> > Given these two excerpts, it seems to me that there's no inaccuracies
> > in the manual, perhaps we just need to tell both stories in the same
> > place or something? Or do you still think there's something incorrect
> > in these two fragments?
>
> Would following the advice in the second fragment confuse the
> "internal mechanism" (as suggested in the first fragment) or not?
Only if the other hooks that modify buffer, and do NOT want hooks to
be run, don't bind inhibit-modification-hooks to t. AFAIU, at least.
- bug#25111:, Phillip Lord, 2016/12/04
- bug#25111:, Eli Zaretskii, 2016/12/05
- Message not available
- Message not available
- bug#25111:, Eli Zaretskii, 2016/12/08
- bug#25111:, Phillip Lord, 2016/12/09
- bug#25111:, Eli Zaretskii, 2016/12/09
- bug#25111:, Phillip Lord, 2016/12/11
- bug#25111:, Eli Zaretskii, 2016/12/12
bug#25111: How modification-hooks let-bind inhibit-modification-hooks?, Noam Postavsky, 2016/12/05
- bug#25111: How modification-hooks let-bind inhibit-modification-hooks?,
Eli Zaretskii <=