# HG changeset patch # User Richard M. Stallman # Date 741726755 0 # Node ID 42932adb70748f5993ffb5853bd8d686ce1a842c # Parent dcf86f82f2c85cdb5f5a5e9a683551fa78b7cfe8 (kill-region): Cope with change hooks that change props. diff -r dcf86f82f2c8 -r 42932adb7074 lisp/simple.el --- a/lisp/simple.el Sat Jul 03 10:17:56 1993 +0000 +++ b/lisp/simple.el Sat Jul 03 19:12:35 1993 +0000 @@ -1040,11 +1040,18 @@ (eq last-command 'kill-region) (eq beg end))) ;; Don't let the undo list be truncated before we can even access it. - (let ((undo-strong-limit (+ (- (max beg end) (min beg end)) 100))) + (let ((undo-strong-limit (+ (- (max beg end) (min beg end)) 100)) + (old-list buffer-undo-list) + tail) (delete-region beg end) + ;; Search back in buffer-undo-list for this string, + ;; in case a change hook made property changes. + (setq tail buffer-undo-list) + (while (not (stringp (car (car tail)))) + (setq tail (cdr tail))) ;; Take the same string recorded for undo ;; and put it in the kill-ring. - (kill-new (car (car buffer-undo-list))) + (kill-new (car (car tail))) (setq this-command 'kill-region))) (t