Mercurial > emacs
diff lisp/simple.el @ 1740:6d74de06a35d
* 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.
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Thu, 07 Jan 1993 02:50:39 +0000 |
parents | 9de0900ca56a |
children | 05492c456293 |
line wrap: on
line diff
--- a/lisp/simple.el Thu Jan 07 02:49:15 1993 +0000 +++ b/lisp/simple.el Thu Jan 07 02:50:39 1993 +0000 @@ -769,7 +769,7 @@ (if (= (length key) 1) ;; Make sure self-insert-command finds the proper character; ;; unread the character and let the command loop process it. - (setq unread-command-event (string-to-char key)) + (setq unread-command-event (aref key 0)) ;; We can't push back a longer string, so we'll emulate the ;; command loop ourselves. (command-execute (key-binding key))))) @@ -950,10 +950,12 @@ If the previous command was also a kill command, the text killed this time appends to the text killed last time to make one entry in the kill ring." - (interactive "r") + (interactive "*r") (cond - (buffer-read-only - (copy-region-as-kill beg end)) + ;; If the buffer was read-only, we used to just do a + ;; copy-region-as-kill. This was never what I wanted - usually I + ;; was making a mistake and trying to edit a file checked into RCS - + ;; so I've taken the code out. ((not (or (eq buffer-undo-list t) (eq last-command 'kill-region) (eq beg end))) @@ -1150,8 +1152,8 @@ (defun set-mark-command (arg) "Set mark at where point is, or jump to mark. -With no prefix argument, set mark, and push previous mark on mark ring. -With argument, jump to mark, and pop into mark off the mark ring. +With no prefix argument, set mark, and push old mark position on mark ring. +With argument, jump to mark, and pop a new position for mark off the ring. Novice Emacs Lisp programmers often try to use the mark for the wrong purposes. See the documentation of `set-mark' for more information."