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: Thu, 13 Jun 2019 22:05:48 +0300
> From: Pip Cet <pipcet <at> gmail.com>
> Date: Thu, 13 Jun 2019 18:48:23 +0000
> Cc: 36190 <at> debbugs.gnu.org
> 
> > > As far as I can tell, this makes `put-text-property' with a buffer
> > > argument pretty useless.
> >
> > Only if you have a buffer-local value of after-change-functions.
> 
> I'm not sure what you're saying.

I'm saying that the buffer argument to put-text-property is pretty
useless only if you consider after-change-functions.  The primary
purpose of put-text-property is to modify text properties, not to call
after-change-functions.  For that primary purpose, the buffer argument
is not useless.

> That seems pretty wrong to me. In which cases do you think we're
> seeing the right behavior?

Where did I say that this behavior was right?

> Here's a first patch, which adds a "buffer" argument to
> signal_after_change, to be explicit about where the change happens. It
> should be pretty cheap in the case where we don't switch buffers.

Not sure I have a clear idea of how you intend to use that additional
argument.  Are you suggesting that we switch to that buffer?  If so,
how is that different from not using the buffer argument at all, and
instead wrapping the call to put-text-property with
with-current-buffer?

Also, passing current_buffer sounds redundant to me anyway, because in
that case signal_after_change will not need to do anything that it
doesn't already do.  I would pass NULL instead.

Thanks.




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.