# HG changeset patch # User Richard M. Stallman # Date 895555370 0 # Node ID 632fc074e4d7ba8c752c70beec7ed7f84f89a28d # Parent 468e3489f1c014008e85d1c5d60a7f4240f2814d (kill-region): Set this-command unconditionally in a read-only buffer. diff -r 468e3489f1c0 -r 632fc074e4d7 lisp/simple.el --- a/lisp/simple.el Tue May 19 05:21:42 1998 +0000 +++ b/lisp/simple.el Tue May 19 05:22:50 1998 +0000 @@ -1647,10 +1647,11 @@ ;; However, there's no harm in putting ;; the region's text in the kill ring, anyway. (copy-region-as-kill beg end) - ;; This should always barf, and give us the correct error. + ;; Set this-command now, so it will be set even if we get an error. + (setq this-command 'kill-region) + ;; This should barf, if appropriate, and give us the correct error. (if kill-read-only-ok (message "Read only text copied to kill ring") - (setq this-command 'kill-region) ;; Signal an error if the buffer is read-only. (barf-if-buffer-read-only) ;; If the buffer isn't read-only, the text is.