aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1993-01-07 02:50:39 +0000
committerJim Blandy1993-01-07 02:50:39 +0000
commit799268891209ebd2e383bc234909e95e5382382a (patch)
treeb2d79968c49b061f9e9c8694f90656d2d91a7329
parente33981b69dd78e2a83bf69f6607cad50f000d3d9 (diff)
downloademacs-799268891209ebd2e383bc234909e95e5382382a.tar.gz
emacs-799268891209ebd2e383bc234909e95e5382382a.zip
* simple.el (kill-region): Change interactive spec to signal an
error if the buffer is read-only, and remove the code to do a copy-region-as-kill if the buffer is read-only. * simple.el (set-mark-command): Clarify doc string. * simple.el (prefix-arg-internal): Don't apply string-to-char to get the first element of the key sequence - it might be a vector.
-rw-r--r--lisp/simple.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index c0d796b97b7..fba98ee27cb 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -769,7 +769,7 @@ Repeating \\[universal-argument] without digits or minus sign
769 (if (= (length key) 1) 769 (if (= (length key) 1)
770 ;; Make sure self-insert-command finds the proper character; 770 ;; Make sure self-insert-command finds the proper character;
771 ;; unread the character and let the command loop process it. 771 ;; unread the character and let the command loop process it.
772 (setq unread-command-event (string-to-char key)) 772 (setq unread-command-event (aref key 0))
773 ;; We can't push back a longer string, so we'll emulate the 773 ;; We can't push back a longer string, so we'll emulate the
774 ;; command loop ourselves. 774 ;; command loop ourselves.
775 (command-execute (key-binding key))))) 775 (command-execute (key-binding key)))))
@@ -950,10 +950,12 @@ Any command that calls this function is a \"kill command\".
950If the previous command was also a kill command, 950If the previous command was also a kill command,
951the text killed this time appends to the text killed last time 951the text killed this time appends to the text killed last time
952to make one entry in the kill ring." 952to make one entry in the kill ring."
953 (interactive "r") 953 (interactive "*r")
954 (cond 954 (cond
955 (buffer-read-only 955 ;; If the buffer was read-only, we used to just do a
956 (copy-region-as-kill beg end)) 956 ;; copy-region-as-kill. This was never what I wanted - usually I
957 ;; was making a mistake and trying to edit a file checked into RCS -
958 ;; so I've taken the code out.
957 ((not (or (eq buffer-undo-list t) 959 ((not (or (eq buffer-undo-list t)
958 (eq last-command 'kill-region) 960 (eq last-command 'kill-region)
959 (eq beg end))) 961 (eq beg end)))
@@ -1150,8 +1152,8 @@ most recent first.")
1150 1152
1151(defun set-mark-command (arg) 1153(defun set-mark-command (arg)
1152 "Set mark at where point is, or jump to mark. 1154 "Set mark at where point is, or jump to mark.
1153With no prefix argument, set mark, and push previous mark on mark ring. 1155With no prefix argument, set mark, and push old mark position on mark ring.
1154With argument, jump to mark, and pop into mark off the mark ring. 1156With argument, jump to mark, and pop a new position for mark off the ring.
1155 1157
1156Novice Emacs Lisp programmers often try to use the mark for the wrong 1158Novice Emacs Lisp programmers often try to use the mark for the wrong
1157purposes. See the documentation of `set-mark' for more information." 1159purposes. See the documentation of `set-mark' for more information."