summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2008-02-24 10:09:07 +0000
committerMiles Bader <miles@gnu.org>2008-02-24 10:09:07 +0000
commitb03f96dc5a6651d1dc84b81b2a15cad6908b9809 (patch)
tree699d727fdfb007a12a07d1e1f2e172617cc159ef /lisp/subr.el
parent52bec650ae314402c242ce700bb09be42ef8ae55 (diff)
parent20ca5ee4f7d897d79416a6fdd084db1eabb392b0 (diff)
downloademacs-b03f96dc5a6651d1dc84b81b2a15cad6908b9809.tar.gz
Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1074
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el37
1 files changed, 19 insertions, 18 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 6980bf69959..679aeed876f 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1944,24 +1944,25 @@ This finishes the change group by reverting all of its changes."
(with-current-buffer (car elt)
(setq elt (cdr elt))
(let ((old-car
- (if (consp elt) (car elt)))
- (old-cdr
- (if (consp elt) (cdr elt))))
- ;; Temporarily truncate the undo log at ELT.
- (when (consp elt)
- (setcar elt nil) (setcdr elt nil))
- (unless (eq last-command 'undo) (undo-start))
- ;; Make sure there's no confusion.
- (when (and (consp elt) (not (eq elt (last pending-undo-list))))
- (error "Undoing to some unrelated state"))
- ;; Undo it all.
- (while (listp pending-undo-list) (undo-more 1))
- ;; Reset the modified cons cell ELT to its original content.
- (when (consp elt)
- (setcar elt old-car)
- (setcdr elt old-cdr))
- ;; Revert the undo info to what it was when we grabbed the state.
- (setq buffer-undo-list elt)))))
+ (if (consp elt) (car elt)))
+ (old-cdr
+ (if (consp elt) (cdr elt))))
+ ;; Temporarily truncate the undo log at ELT.
+ (when (consp elt)
+ (setcar elt nil) (setcdr elt nil))
+ (unless (eq last-command 'undo) (undo-start))
+ ;; Make sure there's no confusion.
+ (when (and (consp elt) (not (eq elt (last pending-undo-list))))
+ (error "Undoing to some unrelated state"))
+ ;; Undo it all.
+ (save-excursion
+ (while (listp pending-undo-list) (undo-more 1)))
+ ;; Reset the modified cons cell ELT to its original content.
+ (when (consp elt)
+ (setcar elt old-car)
+ (setcdr elt old-cdr))
+ ;; Revert the undo info to what it was when we grabbed the state.
+ (setq buffer-undo-list elt)))))
;;;; Display-related functions.