aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2000-10-26 07:44:46 +0000
committerMiles Bader2000-10-26 07:44:46 +0000
commit3c1b77ca339ad317c30425a641c837be00c24827 (patch)
treeda60b11001eb4d555b6f844d3b442ae1bc82fee8
parente276a14ac53a1f5b9bb8ebb81de908e9dcbcbfcc (diff)
downloademacs-3c1b77ca339ad317c30425a641c837be00c24827.tar.gz
emacs-3c1b77ca339ad317c30425a641c837be00c24827.zip
(undo): Correctly distinguish between numeric and non-numeric prefix
args in non-transient-mark-mode, as per the doc string. When in transient-mark-mode, treat all prefix-args as numeric.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/simple.el22
2 files changed, 18 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index dd2c3907dc8..73dc391a5ca 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
12000-10-26 Miles Bader <miles@lsi.nec.co.jp> 12000-10-26 Miles Bader <miles@lsi.nec.co.jp>
2 2
3 * simple.el (undo): Correctly distinguish between numeric and
4 non-numeric prefix args in non-transient-mark-mode, as per the doc
5 string. When in transient-mark-mode, treat all prefix-args as
6 numeric.
7
3 * simple.el (previous-matching-history-element): Position point on 8 * simple.el (previous-matching-history-element): Position point on
4 match. Handle N == 0 correctly. Miscellaneous cleanup. 9 match. Handle N == 0 correctly. Miscellaneous cleanup.
5 10
diff --git a/lisp/simple.el b/lisp/simple.el
index c95fd36c863..8bf1a78dabf 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -879,9 +879,9 @@ Return 0 if current buffer is not a mini-buffer."
879Repeat this command to undo more changes. 879Repeat this command to undo more changes.
880A numeric argument serves as a repeat count. 880A numeric argument serves as a repeat count.
881 881
882Just C-u as argument requests selective undo, 882In Transient Mark mode when the mark is active, only undo changes within
883limited to changes within the current region. 883the current region. Similarly, when not in Transient Mark mode, just C-u
884Likewise in Transient Mark mode when the mark is active." 884as an argument limits undo to changes within the current region."
885 (interactive "*P") 885 (interactive "*P")
886 ;; If we don't get all the way thru, make last-command indicate that 886 ;; If we don't get all the way thru, make last-command indicate that
887 ;; for the following command. 887 ;; for the following command.
@@ -890,12 +890,16 @@ Likewise in Transient Mark mode when the mark is active."
890 (recent-save (recent-auto-save-p))) 890 (recent-save (recent-auto-save-p)))
891 (or (eq (selected-window) (minibuffer-window)) 891 (or (eq (selected-window) (minibuffer-window))
892 (message "Undo!")) 892 (message "Undo!"))
893 (or (eq last-command 'undo) 893 (unless (eq last-command 'undo)
894 (progn (if (or arg (and transient-mark-mode mark-active)) 894 (if (if transient-mark-mode mark-active (and arg (not (numberp arg))))
895 (undo-start (region-beginning) (region-end)) 895 (undo-start (region-beginning) (region-end))
896 (undo-start)) 896 (undo-start))
897 (undo-more 1))) 897 ;; get rid of initial undo boundary
898 (undo-more (if arg (prefix-numeric-value arg) 1)) 898 (undo-more 1))
899 (undo-more
900 (if (or transient-mark-mode (numberp arg))
901 (prefix-numeric-value arg)
902 1))
899 ;; Don't specify a position in the undo record for the undo command. 903 ;; Don't specify a position in the undo record for the undo command.
900 ;; Instead, undoing this should move point to where the change is. 904 ;; Instead, undoing this should move point to where the change is.
901 (let ((tail buffer-undo-list) 905 (let ((tail buffer-undo-list)