aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-07-03 19:12:35 +0000
committerRichard M. Stallman1993-07-03 19:12:35 +0000
commit12bcd3b6da0bff6893549ed528501d45f15c6593 (patch)
tree3c73edc5888defc41e711fdff1895f60ac143d98
parent88046be2adb17f7f874f694d2ec9e74c2343b606 (diff)
downloademacs-12bcd3b6da0bff6893549ed528501d45f15c6593.tar.gz
emacs-12bcd3b6da0bff6893549ed528501d45f15c6593.zip
(kill-region): Cope with change hooks that change props.
-rw-r--r--lisp/simple.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index ebf1a45812b..0416ba9bb26 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1040,11 +1040,18 @@ to make one entry in the kill ring."
1040 (eq last-command 'kill-region) 1040 (eq last-command 'kill-region)
1041 (eq beg end))) 1041 (eq beg end)))
1042 ;; Don't let the undo list be truncated before we can even access it. 1042 ;; Don't let the undo list be truncated before we can even access it.
1043 (let ((undo-strong-limit (+ (- (max beg end) (min beg end)) 100))) 1043 (let ((undo-strong-limit (+ (- (max beg end) (min beg end)) 100))
1044 (old-list buffer-undo-list)
1045 tail)
1044 (delete-region beg end) 1046 (delete-region beg end)
1047 ;; Search back in buffer-undo-list for this string,
1048 ;; in case a change hook made property changes.
1049 (setq tail buffer-undo-list)
1050 (while (not (stringp (car (car tail))))
1051 (setq tail (cdr tail)))
1045 ;; Take the same string recorded for undo 1052 ;; Take the same string recorded for undo
1046 ;; and put it in the kill-ring. 1053 ;; and put it in the kill-ring.
1047 (kill-new (car (car buffer-undo-list))) 1054 (kill-new (car (car tail)))
1048 (setq this-command 'kill-region))) 1055 (setq this-command 'kill-region)))
1049 1056
1050 (t 1057 (t