aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman2004-03-04 17:00:09 +0000
committerRichard M. Stallman2004-03-04 17:00:09 +0000
commit2c6a22540aca3109251f6c548783c4eba227276b (patch)
treef256edcedf0f9bf41d24a8f8827e6b57f4b31f14 /lisp
parent01fce6ab8cd7f5adb089f0202529a32f9f9d2918 (diff)
downloademacs-2c6a22540aca3109251f6c548783c4eba227276b.tar.gz
emacs-2c6a22540aca3109251f6c548783c4eba227276b.zip
(undo): Temporarily set this-command to `undo-start',
then set it to `undo' once undo-start returns without error. (minibuffer-history-sexp-flag): Doc fix. (kill-line): Don't disregard trailing whitespace in eol condition, if show-trailing-whitespace is set.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/simple.el23
1 files changed, 16 insertions, 7 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index d3e189dbe13..1f710576fa9 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -739,11 +739,11 @@ to get different commands to edit and resubmit."
739This is used for all minibuffer input 739This is used for all minibuffer input
740except when an alternate history list is specified.") 740except when an alternate history list is specified.")
741(defvar minibuffer-history-sexp-flag nil 741(defvar minibuffer-history-sexp-flag nil
742 "Non-nil when doing history operations on the variable `command-history'. 742 "Control whether history list elements are expressions or strings.
743More generally, indicates that the history list being acted on 743If the value of this variable equals current minibuffer depth,
744contains expressions rather than strings. 744they are expressions; otherwise they are strings.
745It is only valid if its value equals the current minibuffer depth, 745\(That convention is designed to do the right thing fora
746to handle recursive uses of the minibuffer.") 746recursive uses of the minibuffer.)")
747(setq minibuffer-history-variable 'minibuffer-history) 747(setq minibuffer-history-variable 'minibuffer-history)
748(setq minibuffer-history-position nil) 748(setq minibuffer-history-position nil)
749(defvar minibuffer-history-search-history nil) 749(defvar minibuffer-history-search-history nil)
@@ -972,9 +972,13 @@ as an argument limits undo to changes within the current region."
972 ;; another undo command will find the undo history empty 972 ;; another undo command will find the undo history empty
973 ;; and will get another error. To begin undoing the undos, 973 ;; and will get another error. To begin undoing the undos,
974 ;; you must type some other command. 974 ;; you must type some other command.
975 (setq this-command 'undo)
976 (let ((modified (buffer-modified-p)) 975 (let ((modified (buffer-modified-p))
977 (recent-save (recent-auto-save-p))) 976 (recent-save (recent-auto-save-p)))
977 ;; If we get an error in undo-start,
978 ;; the next command should not be a "consecutive undo".
979 ;; So set `this-command' to something other than `undo'.
980 (setq this-command 'undo-start)
981
978 (unless (eq last-command 'undo) 982 (unless (eq last-command 'undo)
979 (setq undo-in-region 983 (setq undo-in-region
980 (if transient-mark-mode mark-active (and arg (not (numberp arg))))) 984 (if transient-mark-mode mark-active (and arg (not (numberp arg)))))
@@ -983,6 +987,8 @@ as an argument limits undo to changes within the current region."
983 (undo-start)) 987 (undo-start))
984 ;; get rid of initial undo boundary 988 ;; get rid of initial undo boundary
985 (undo-more 1)) 989 (undo-more 1))
990 ;; If we got this far, the next command should be a consecutive undo.
991 (setq this-command 'undo)
986 ;; Check to see whether we're hitting a redo record, and if 992 ;; Check to see whether we're hitting a redo record, and if
987 ;; so, ask the user whether she wants to skip the redo/undo pair. 993 ;; so, ask the user whether she wants to skip the redo/undo pair.
988 (let ((equiv (gethash pending-undo-list undo-equiv-table))) 994 (let ((equiv (gethash pending-undo-list undo-equiv-table)))
@@ -2239,7 +2245,10 @@ even beep.)"
2239 (save-excursion 2245 (save-excursion
2240 (end-of-visible-line) (point)))) 2246 (end-of-visible-line) (point))))
2241 (if (or (save-excursion 2247 (if (or (save-excursion
2242 (skip-chars-forward " \t" end) 2248 ;; If trailing whitespace is visible,
2249 ;; don't treat it as nothing.
2250 (unless show-trailing-whitespace
2251 (skip-chars-forward " \t" end))
2243 (= (point) end)) 2252 (= (point) end))
2244 (and kill-whole-line (bolp))) 2253 (and kill-whole-line (bolp)))
2245 (forward-visible-line 1) 2254 (forward-visible-line 1)