From: Richard M. Stallman Date: Tue, 19 May 1998 05:22:50 +0000 (+0000) Subject: (kill-region): Set this-command unconditionally in a read-only buffer. X-Git-Tag: emacs-20.3~933 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cb3e1b4c4cb11ea4461dd09cd5c756b6c5340a5a;p=emacs.git (kill-region): Set this-command unconditionally in a read-only buffer. --- diff --git a/lisp/simple.el b/lisp/simple.el index 9e79a114891..ae4ce391110 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1647,10 +1647,11 @@ to make one entry in the kill ring." ;; 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.