Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
713c9020
Commit
713c9020
authored
Apr 11, 2005
by
Richard M. Stallman
Browse files
(undo): Record t in undo-equiv-table
for the redo record made by an undo-in-region.
parent
94285c26
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/simple.el
lisp/simple.el
+10
-5
No files found.
lisp/ChangeLog
View file @
713c9020
2005-04-11 Richard M. Stallman <rms@gnu.org>
* simple.el (undo): Record t in undo-equiv-table
for the redo record made by an undo-in-region.
2005-04-12 Nick Roberts <nickrob@snap.net.nz>
* progmodes/gdb-ui.el (gdb-display-inferior-io-buffer)
...
...
lisp/simple.el
View file @
713c9020
...
...
@@ -1279,7 +1279,9 @@ Return 0 if current buffer is not a mini-buffer."
(defalias 'advertised-undo 'undo)
(defconst undo-equiv-table (make-hash-table :test 'eq :weakness t)
"
Table
mapping
redo
records
to
the
corresponding
undo
one.
")
"
Table
mapping
redo
records
to
the
corresponding
undo
one.
A
redo
record
for
undo-in-region
maps
to
t.
A
redo
record
for
ordinary
undo
maps
to
the
following
(
earlier
)
undo.
")
(defvar undo-in-region nil
"
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."
(message (if undo-in-region
(if equiv "
Redo
in
region!
" "
Undo
in
region!
")
(if equiv "
Redo!
" "
Undo!
"))))
(when (and equiv undo-no-redo)
(when (and
(listp
equiv
)
undo-no-redo)
;; The equiv entry might point to another redo record if we have done
;; undo-redo-undo-redo-... so skip to the very last equiv.
(while (let ((next (gethash equiv undo-equiv-table)))
...
...
@@ -1350,10 +1352,13 @@ as an argument limits undo to changes within the current region."
(prefix-numeric-value arg)
1))
;; Record the fact that the just-generated undo records come from an
;; undo operation, so we can skip them later on.
;; undo operation--that is, they are redo records.
;; In the ordinary case (not within a region), map the redo
;; record to the following undos.
;; I don't know how to do that in the undo-in-region case.
(unless undo-in-region
(puthash buffer-undo-list pending-undo-list undo-equiv-table))
(puthash buffer-undo-list
(if undo-in-region t pending-undo-list)
undo-equiv-table)
;; Don't specify a position in the undo record for the undo command.
;; Instead, undoing this should move point to where the change is.
(let ((tail buffer-undo-list)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment