diff options
Diffstat (limited to 'lisp/simple.el')
| -rw-r--r-- | lisp/simple.el | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 54adc3d3a01..1b7b40a367a 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1279,7 +1279,9 @@ Return 0 if current buffer is not a mini-buffer." | |||
| 1279 | (defalias 'advertised-undo 'undo) | 1279 | (defalias 'advertised-undo 'undo) |
| 1280 | 1280 | ||
| 1281 | (defconst undo-equiv-table (make-hash-table :test 'eq :weakness t) | 1281 | (defconst undo-equiv-table (make-hash-table :test 'eq :weakness t) |
| 1282 | "Table mapping redo records to the corresponding undo one.") | 1282 | "Table mapping redo records to the corresponding undo one. |
| 1283 | A redo record for undo-in-region maps to t. | ||
| 1284 | A redo record for ordinary undo maps to the following (earlier) undo.") | ||
| 1283 | 1285 | ||
| 1284 | (defvar undo-in-region nil | 1286 | (defvar undo-in-region nil |
| 1285 | "Non-nil if `pending-undo-list' is not just a tail of `buffer-undo-list'.") | 1287 | "Non-nil if `pending-undo-list' is not just a tail of `buffer-undo-list'.") |
| @@ -1339,7 +1341,7 @@ as an argument limits undo to changes within the current region." | |||
| 1339 | (message (if undo-in-region | 1341 | (message (if undo-in-region |
| 1340 | (if equiv "Redo in region!" "Undo in region!") | 1342 | (if equiv "Redo in region!" "Undo in region!") |
| 1341 | (if equiv "Redo!" "Undo!")))) | 1343 | (if equiv "Redo!" "Undo!")))) |
| 1342 | (when (and equiv undo-no-redo) | 1344 | (when (and (consp equiv) undo-no-redo) |
| 1343 | ;; The equiv entry might point to another redo record if we have done | 1345 | ;; The equiv entry might point to another redo record if we have done |
| 1344 | ;; undo-redo-undo-redo-... so skip to the very last equiv. | 1346 | ;; undo-redo-undo-redo-... so skip to the very last equiv. |
| 1345 | (while (let ((next (gethash equiv undo-equiv-table))) | 1347 | (while (let ((next (gethash equiv undo-equiv-table))) |
| @@ -1350,10 +1352,13 @@ as an argument limits undo to changes within the current region." | |||
| 1350 | (prefix-numeric-value arg) | 1352 | (prefix-numeric-value arg) |
| 1351 | 1)) | 1353 | 1)) |
| 1352 | ;; Record the fact that the just-generated undo records come from an | 1354 | ;; Record the fact that the just-generated undo records come from an |
| 1353 | ;; undo operation, so we can skip them later on. | 1355 | ;; undo operation--that is, they are redo records. |
| 1356 | ;; In the ordinary case (not within a region), map the redo | ||
| 1357 | ;; record to the following undos. | ||
| 1354 | ;; I don't know how to do that in the undo-in-region case. | 1358 | ;; I don't know how to do that in the undo-in-region case. |
| 1355 | (unless undo-in-region | 1359 | (puthash buffer-undo-list |
| 1356 | (puthash buffer-undo-list pending-undo-list undo-equiv-table)) | 1360 | (if undo-in-region t pending-undo-list) |
| 1361 | undo-equiv-table) | ||
| 1357 | ;; Don't specify a position in the undo record for the undo command. | 1362 | ;; Don't specify a position in the undo record for the undo command. |
| 1358 | ;; Instead, undoing this should move point to where the change is. | 1363 | ;; Instead, undoing this should move point to where the change is. |
| 1359 | (let ((tail buffer-undo-list) | 1364 | (let ((tail buffer-undo-list) |
| @@ -2547,7 +2552,7 @@ The argument is used for internal purposes; do not supply one." | |||
| 2547 | ;; This is actually used in subr.el but defcustom does not work there. | 2552 | ;; This is actually used in subr.el but defcustom does not work there. |
| 2548 | (defcustom yank-excluded-properties | 2553 | (defcustom yank-excluded-properties |
| 2549 | '(read-only invisible intangible field mouse-face help-echo local-map keymap | 2554 | '(read-only invisible intangible field mouse-face help-echo local-map keymap |
| 2550 | yank-handler) | 2555 | yank-handler follow-link) |
| 2551 | "*Text properties to discard when yanking. | 2556 | "*Text properties to discard when yanking. |
| 2552 | The value should be a list of text properties to discard or t, | 2557 | The value should be a list of text properties to discard or t, |
| 2553 | which means to discard all text properties." | 2558 | which means to discard all text properties." |