--- Begin Message ---
Subject: |
27.0.50; `put-text-property' etc. with buffer argument calls current buffer's `after-change-functions' |
Date: |
Thu, 13 Jun 2019 13:48:40 +0000 |
In emacs -Q, evaluating:
(let ((buffer1 (generate-new-buffer "A"))
(buffer2 (generate-new-buffer "B")))
(with-current-buffer buffer2
(insert "BBB"))
(with-current-buffer buffer1
(add-hook 'after-change-functions
(lambda (beg end len)
(message "%S %S %S"
beg end len))
nil t)
(put-text-property 1 4 'read-only t buffer2)))
results in a "1 4 3" message. I would have expected no message, as
buffer2 was modified and buffer1, whose after-change-functions I'd
set, wasn't.
I've looked at the code, and it appears no particular provisions are
being made to make sure we switch to the modified buffer before
calling signal_after_change().
As far as I can tell, this makes `put-text-property' with a buffer
argument pretty useless. Am I missing something? Is this expected
behavior somehow?
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#36190: 27.0.50; `put-text-property' etc. with buffer argument calls current buffer's `after-change-functions' |
Date: |
Sat, 06 Jul 2019 19:22:32 +0300 |
> From: Pip Cet <address@hidden>
> Date: Sat, 6 Jul 2019 15:27:41 +0000
> Cc: address@hidden
>
> > LGTM, with a couple of minor comments below. Feel free to push after
> > fixing those.
>
> I don't have push access, so I hope it's okay just to send the new patch.
Thanks, pushed. Please in the future mention the bug number in the
log message, and be sure NOT to end with a period the header line of
the log message, per CONTRIBUTE.
--- End Message ---