diff options
| author | JD Smith | 2026-01-10 15:25:02 -0500 |
|---|---|---|
| committer | JD Smith | 2026-01-10 15:35:18 -0500 |
| commit | 0bb36ec255071afee2bdf8928290f47ee0e3d7ab (patch) | |
| tree | 44d4d03adf10434407d947fa0929367e3c5fb960 | |
| parent | e5a8c4ae00cbd71ad14caeac627b9af49a0bb179 (diff) | |
| download | emacs-0bb36ec255071afee2bdf8928290f47ee0e3d7ab.tar.gz emacs-0bb36ec255071afee2bdf8928290f47ee0e3d7ab.zip | |
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
| -rw-r--r-- | lisp/subr.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index 4ae3647b7d4..e9a8623595b 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -4837,6 +4837,7 @@ It also runs the string through `yank-transform-functions'." | |||
| 4837 | (param (or (nth 1 handler) string)) | 4837 | (param (or (nth 1 handler) string)) |
| 4838 | (opoint (point)) | 4838 | (opoint (point)) |
| 4839 | (inhibit-read-only inhibit-read-only) | 4839 | (inhibit-read-only inhibit-read-only) |
| 4840 | (inhibit-modification-hooks inhibit-modification-hooks) | ||
| 4840 | end) | 4841 | end) |
| 4841 | 4842 | ||
| 4842 | ;; FIXME: This throws away any yank-undo-function set by previous calls | 4843 | ;; 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'." | |||
| 4847 | (insert param)) | 4848 | (insert param)) |
| 4848 | (setq end (point)) | 4849 | (setq end (point)) |
| 4849 | 4850 | ||
| 4850 | ;; Prevent read-only properties from interfering with the | 4851 | ;; Prevent read-only properties from interfering with the following |
| 4851 | ;; following text property changes. | 4852 | ;; text property changes, and inhibit further modification hook |
| 4852 | (setq inhibit-read-only t) | 4853 | ;; calls. |
| 4854 | (setq inhibit-read-only t inhibit-modification-hooks t) | ||
| 4853 | 4855 | ||
| 4854 | (unless (nth 2 handler) ; NOEXCLUDE | 4856 | (unless (nth 2 handler) ; NOEXCLUDE |
| 4855 | (remove-yank-excluded-properties opoint end)) | 4857 | (remove-yank-excluded-properties opoint end)) |