all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Noam Postavsky <npostavs@gmail.com>
Cc: victorhge@gmail.com, 30823@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#30823: 25.3; modification-hooks of overlays are not run in some cases
Date: Sat, 18 Aug 2018 09:49:08 +0300	[thread overview]
Message-ID: <83o9e0f9uj.fsf@gnu.org> (raw)
In-Reply-To: <87in48ww9l.fsf@gmail.com> (message from Noam Postavsky on Fri, 17 Aug 2018 16:52:54 -0400)

> From: Noam Postavsky <npostavs@gmail.com>
> Cc: Eli Zaretskii <eliz@gnu.org>,  30823@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Fri, 17 Aug 2018 16:52:54 -0400
> 
> Noam Postavsky <npostavs@gmail.com> writes:
> 
> > @@ -10403,6 +10403,13 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte)
> >  	  ptrdiff_t this_bol, this_bol_byte, prev_bol, prev_bol_byte;
> >  	  printmax_t dups;
> >  
> > +          /* Since we call del_range_both passing false for PREPARE,
> > +             we aren't prepared to run modification hooks (we could
> > +             end up calling modification hooks from another buffer and
> > +             only with AFTER=t, Bug#21824).  */
> > +          ptrdiff_t count = SPECPDL_INDEX ();
> > +          specbind (Qinhibit_modification_hooks, Qt);
> > +
> >  	  insert_1_both ("\n", 1, 1, true, false, false);
> >  
> >  	  scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, false);
> 
> Coming back to this, there is also the possibility of passing true for
> PREPARE, though I'm not sure if that would be better or worse.  Any
> comments?

AFAIR, we never want to use PREPARE = true when dealing with the
*Messages* buffer, you can see that elsewhere in message_dolog.  The
reason I believe is that we might trigger infinite recursion if the
modification hooks log a message for some reason.

Btw, I'm somewhat worried by the solution being proposed: it removes a
general safety device and replaces it by a solution that targets only
bug#21824, a much narrower class of problems.  Is that wise?

Can we turn the table and ask whether it makes sense to delete an
overlay from the modification hooks of that same overlay?  Maybe
ggtags needs to find a better/safer solution for whatever feature it
wants to implement?





  reply	other threads:[~2018-08-18  6:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-15  4:15 bug#30823: 25.3; modification-hooks of overlays are not run in some cases Ren Victor
2018-03-15  6:00 ` Eli Zaretskii
2018-03-15  7:29   ` Ren Victor
2018-03-31 13:51     ` Noam Postavsky
2018-08-17 20:52       ` Noam Postavsky
2018-08-18  6:49         ` Eli Zaretskii [this message]
2018-08-19  3:48           ` Stefan Monnier
2018-08-19 14:46             ` Eli Zaretskii
2018-08-19 15:43               ` Stefan Monnier
2018-08-19 16:13                 ` Eli Zaretskii
2018-08-20  3:02                 ` Richard Stallman
2018-08-20 16:37                   ` Eli Zaretskii
2018-08-19 20:46           ` Stefan Monnier
2018-08-20 16:34             ` Eli Zaretskii
2018-08-23 12:13           ` Noam Postavsky
2018-08-23 13:57             ` Eli Zaretskii
2018-08-31  3:14               ` Noam Postavsky
2018-08-31 14:25                 ` Eli Zaretskii
2018-09-01 16:38                   ` Noam Postavsky
2018-09-11 11:59                     ` Eli Zaretskii
2018-09-13  1:34                       ` Noam Postavsky
2018-09-13 13:43                         ` Eli Zaretskii
2018-09-14 12:03                           ` Noam Postavsky
2018-09-15  9:23                             ` Eli Zaretskii
2018-09-15 14:10                               ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83o9e0f9uj.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=30823@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=npostavs@gmail.com \
    --cc=victorhge@gmail.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.