comparison lisp/simple.el @ 46647:cdd51b0b1929

(undo, undo-more): Adjust messages when undoing in a region.
author Richard M. Stallman <rms@gnu.org>
date Tue, 23 Jul 2002 19:25:27 +0000
parents 25e7debccc64
children e06b5768debd
comparison
equal deleted inserted replaced
46646:ba559abe46e6 46647:cdd51b0b1929
930 ;; you must type some other command. 930 ;; you must type some other command.
931 (setq this-command 'undo) 931 (setq this-command 'undo)
932 (let ((modified (buffer-modified-p)) 932 (let ((modified (buffer-modified-p))
933 (recent-save (recent-auto-save-p))) 933 (recent-save (recent-auto-save-p)))
934 (or (eq (selected-window) (minibuffer-window)) 934 (or (eq (selected-window) (minibuffer-window))
935 (message "Undo!")) 935 (message (if (and transient-mark-mode mark-active)
936 "Undo in region!"
937 "Undo!")))
936 (unless (eq last-command 'undo) 938 (unless (eq last-command 'undo)
937 (if (if transient-mark-mode mark-active (and arg (not (numberp arg)))) 939 (if (if transient-mark-mode mark-active (and arg (not (numberp arg))))
938 (undo-start (region-beginning) (region-end)) 940 (undo-start (region-beginning) (region-end))
939 (undo-start)) 941 (undo-start))
940 ;; get rid of initial undo boundary 942 ;; get rid of initial undo boundary
977 (defun undo-more (count) 979 (defun undo-more (count)
978 "Undo back N undo-boundaries beyond what was already undone recently. 980 "Undo back N undo-boundaries beyond what was already undone recently.
979 Call `undo-start' to get ready to undo recent changes, 981 Call `undo-start' to get ready to undo recent changes,
980 then call `undo-more' one or more times to undo them." 982 then call `undo-more' one or more times to undo them."
981 (or pending-undo-list 983 (or pending-undo-list
982 (error "No further undo information")) 984 (error (format "No further undo information%s"
985 (if (and transient-mark-mode mark-active)
986 " for region" ""))))
983 (let ((undo-in-progress t)) 987 (let ((undo-in-progress t))
984 (setq pending-undo-list (primitive-undo count pending-undo-list)))) 988 (setq pending-undo-list (primitive-undo count pending-undo-list))))
985 989
986 ;; Deep copy of a list 990 ;; Deep copy of a list
987 (defun undo-copy-list (list) 991 (defun undo-copy-list (list)