aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/simple.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 9666f13af94..5f671053a98 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1344,7 +1344,8 @@ as an argument limits undo to changes within the current region."
1344 ;; and will get another error. To begin undoing the undos, 1344 ;; and will get another error. To begin undoing the undos,
1345 ;; you must type some other command. 1345 ;; you must type some other command.
1346 (let ((modified (buffer-modified-p)) 1346 (let ((modified (buffer-modified-p))
1347 (recent-save (recent-auto-save-p))) 1347 (recent-save (recent-auto-save-p))
1348 message)
1348 ;; If we get an error in undo-start, 1349 ;; If we get an error in undo-start,
1349 ;; the next command should not be a "consecutive undo". 1350 ;; the next command should not be a "consecutive undo".
1350 ;; So set `this-command' to something other than `undo'. 1351 ;; So set `this-command' to something other than `undo'.
@@ -1373,9 +1374,9 @@ as an argument limits undo to changes within the current region."
1373 ;; so, ask the user whether she wants to skip the redo/undo pair. 1374 ;; so, ask the user whether she wants to skip the redo/undo pair.
1374 (let ((equiv (gethash pending-undo-list undo-equiv-table))) 1375 (let ((equiv (gethash pending-undo-list undo-equiv-table)))
1375 (or (eq (selected-window) (minibuffer-window)) 1376 (or (eq (selected-window) (minibuffer-window))
1376 (message (if undo-in-region 1377 (setq message (if undo-in-region
1377 (if equiv "Redo in region!" "Undo in region!") 1378 (if equiv "Redo in region!" "Undo in region!")
1378 (if equiv "Redo!" "Undo!")))) 1379 (if equiv "Redo!" "Undo!"))))
1379 (when (and (consp equiv) undo-no-redo) 1380 (when (and (consp equiv) undo-no-redo)
1380 ;; The equiv entry might point to another redo record if we have done 1381 ;; The equiv entry might point to another redo record if we have done
1381 ;; undo-redo-undo-redo-... so skip to the very last equiv. 1382 ;; undo-redo-undo-redo-... so skip to the very last equiv.
@@ -1417,7 +1418,10 @@ as an argument limits undo to changes within the current region."
1417 ;; Record what the current undo list says, 1418 ;; Record what the current undo list says,
1418 ;; so the next command can tell if the buffer was modified in between. 1419 ;; so the next command can tell if the buffer was modified in between.
1419 (and modified (not (buffer-modified-p)) 1420 (and modified (not (buffer-modified-p))
1420 (delete-auto-save-file-if-necessary recent-save)))) 1421 (delete-auto-save-file-if-necessary recent-save))
1422 ;; Display a message announcing success.
1423 (if message
1424 (message message))))
1421 1425
1422(defun buffer-disable-undo (&optional buffer) 1426(defun buffer-disable-undo (&optional buffer)
1423 "Make BUFFER stop keeping undo information. 1427 "Make BUFFER stop keeping undo information.