emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master c5e89be: On C-y, stop some text property entries be


From: Alan Mackenzie
Subject: [Emacs-diffs] master c5e89be: On C-y, stop some text property entries being written into buffer-undo-list
Date: Wed, 22 Apr 2015 09:50:31 +0000

branch: master
commit c5e89be20a3feba9c67be6855b1dbdc6d8ae5ce2
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>

    On C-y, stop some text property entries being written into buffer-undo-list
    
    lisp/subr.el (remove-yank-excluded-properties): enclose the code in
    `with-silent-modifications'.
---
 lisp/subr.el |   29 +++++++++++++++--------------
 1 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/lisp/subr.el b/lisp/subr.el
index 1d41e01..062c9f9 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2811,20 +2811,21 @@ if it's an autoloaded macro."
   "Process text properties between START and END, inserted for a `yank'.
 Perform the handling specified by `yank-handled-properties', then
 remove properties specified by `yank-excluded-properties'."
-  (let ((inhibit-read-only t))
-    (dolist (handler yank-handled-properties)
-      (let ((prop (car handler))
-           (fun  (cdr handler))
-           (run-start start))
-       (while (< run-start end)
-         (let ((value (get-text-property run-start prop))
-               (run-end (next-single-property-change
-                         run-start prop nil end)))
-           (funcall fun value run-start run-end)
-           (setq run-start run-end)))))
-    (if (eq yank-excluded-properties t)
-       (set-text-properties start end nil)
-      (remove-list-of-text-properties start end yank-excluded-properties))))
+  (with-silent-modifications
+    (let ((inhibit-read-only t))
+      (dolist (handler yank-handled-properties)
+       (let ((prop (car handler))
+             (fun  (cdr handler))
+             (run-start start))
+         (while (< run-start end)
+           (let ((value (get-text-property run-start prop))
+                 (run-end (next-single-property-change
+                           run-start prop nil end)))
+             (funcall fun value run-start run-end)
+             (setq run-start run-end)))))
+      (if (eq yank-excluded-properties t)
+         (set-text-properties start end nil)
+       (remove-list-of-text-properties start end yank-excluded-properties)))))
 
 (defvar yank-undo-function)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]