summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-05-19 05:22:50 +0000
committerRichard M. Stallman <rms@gnu.org>1998-05-19 05:22:50 +0000
commitf391129829924381a329dbeac3071d19815c09b2 (patch)
treeb6d92b8f32f2a0638c813f970af214bed83d0870
parent268a9c3e9cc17cea035d547a42df839df9cf43f8 (diff)
downloademacs-f391129829924381a329dbeac3071d19815c09b2.tar.gz
(kill-region): Set this-command unconditionally in a read-only buffer.
-rw-r--r--lisp/simple.el5
1 files changed, 3 insertions, 2 deletions
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.