1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-20 11:33:09 -08:00

Limit yanks to a single set of modification hook calls

* lisp/subr.el (insert-for-yank-1): Locally set
`inhibit-modification-hooks' to t prior to changing yanked text
properties.  Bug#77221
This commit is contained in:
JD Smith 2026-01-10 15:25:02 -05:00
parent e5a8c4ae00
commit 0bb36ec255

View file

@ -4837,6 +4837,7 @@ It also runs the string through `yank-transform-functions'."
(param (or (nth 1 handler) string))
(opoint (point))
(inhibit-read-only inhibit-read-only)
(inhibit-modification-hooks inhibit-modification-hooks)
end)
;; FIXME: This throws away any yank-undo-function set by previous calls
@ -4847,9 +4848,10 @@ It also runs the string through `yank-transform-functions'."
(insert param))
(setq end (point))
;; Prevent read-only properties from interfering with the
;; following text property changes.
(setq inhibit-read-only t)
;; Prevent read-only properties from interfering with the following
;; text property changes, and inhibit further modification hook
;; calls.
(setq inhibit-read-only t inhibit-modification-hooks t)
(unless (nth 2 handler) ; NOEXCLUDE
(remove-yank-excluded-properties opoint end))