GNU bug report logs - #36190
27.0.50; `put-text-property' etc. with buffer argument calls current buffer's `after-change-functions'

Previous Next

Package: emacs;

Reported by: Pip Cet <pipcet <at> gmail.com>

Date: Thu, 13 Jun 2019 13:50:02 UTC

Severity: normal

Found in version 27.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pip Cet <pipcet <at> gmail.com>
Cc: 36190 <at> debbugs.gnu.org
Subject: bug#36190: 27.0.50; `put-text-property' etc. with buffer argument calls current buffer's `after-change-functions'
Date: Sat, 06 Jul 2019 11:08:41 +0300
> From: Pip Cet <pipcet <at> gmail.com>
> Date: Sat, 15 Jun 2019 19:27:30 +0000
> Cc: 36190 <at> debbugs.gnu.org
> 
> > Looks better to me, but I'd suggest a comment explaining why we do
> > such an unusual thing.
> 
> Sounds good to me. The attached patch contains the comments and a hint
> in the documentation. (Maybe the comments should be a FIXME, because
> there's really no need to switch buffers at all when there are no
> applicable hooks?)

I'm okay with adding such a FIXME.

> Obviously, feel free to reword as you consider appropriate.

LGTM, with a couple of minor comments below.  Feel free to push after
fixing those.

> +  /* Ensure we run the modification hooks for the right buffer,
> +     without switching buffers twice (bug 36190). */
                                                   ^^
Here and elsewhere please keep 2 spaces between the period and "*/"

> +  if (BUFFERP (object) && XBUFFER (object) != current_buffer)
> +    {
> +      ptrdiff_t count = SPECPDL_INDEX ();
> +      record_unwind_current_buffer ();
> +      set_buffer_internal (XBUFFER (object));
> +      return unbind_to (count, Fremove_list_of_text_properties (start, end,
> +								list_of_properties,
> +								object));
> +    }

The indentation here is too deep; suggest reformatting, e.g., by
inserting a newline before Fremove_list_of_text_properties, and then
reindenting the rest.




This bug report was last modified 6 years and 16 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.