aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2015-04-22 09:49:27 +0000
committerAlan Mackenzie2015-04-22 09:49:27 +0000
commitc5e89be20a3feba9c67be6855b1dbdc6d8ae5ce2 (patch)
tree45d3c2e7b6a2b568dcf90bb217ddb9596c4e1d54
parentf974317897441f638808cbcfecb2c8fd1c0281ec (diff)
downloademacs-c5e89be20a3feba9c67be6855b1dbdc6d8ae5ce2.tar.gz
emacs-c5e89be20a3feba9c67be6855b1dbdc6d8ae5ce2.zip
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'.
-rw-r--r--lisp/subr.el29
1 files changed, 15 insertions, 14 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 1d41e015fa7..062c9f95d44 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2811,20 +2811,21 @@ if it's an autoloaded macro."
2811 "Process text properties between START and END, inserted for a `yank'. 2811 "Process text properties between START and END, inserted for a `yank'.
2812Perform the handling specified by `yank-handled-properties', then 2812Perform the handling specified by `yank-handled-properties', then
2813remove properties specified by `yank-excluded-properties'." 2813remove properties specified by `yank-excluded-properties'."
2814 (let ((inhibit-read-only t)) 2814 (with-silent-modifications
2815 (dolist (handler yank-handled-properties) 2815 (let ((inhibit-read-only t))
2816 (let ((prop (car handler)) 2816 (dolist (handler yank-handled-properties)
2817 (fun (cdr handler)) 2817 (let ((prop (car handler))
2818 (run-start start)) 2818 (fun (cdr handler))
2819 (while (< run-start end) 2819 (run-start start))
2820 (let ((value (get-text-property run-start prop)) 2820 (while (< run-start end)
2821 (run-end (next-single-property-change 2821 (let ((value (get-text-property run-start prop))
2822 run-start prop nil end))) 2822 (run-end (next-single-property-change
2823 (funcall fun value run-start run-end) 2823 run-start prop nil end)))
2824 (setq run-start run-end))))) 2824 (funcall fun value run-start run-end)
2825 (if (eq yank-excluded-properties t) 2825 (setq run-start run-end)))))
2826 (set-text-properties start end nil) 2826 (if (eq yank-excluded-properties t)
2827 (remove-list-of-text-properties start end yank-excluded-properties)))) 2827 (set-text-properties start end nil)
2828 (remove-list-of-text-properties start end yank-excluded-properties)))))
2828 2829
2829(defvar yank-undo-function) 2830(defvar yank-undo-function)
2830 2831