From d9090cc15a6ec3039fc0dc9ef4c826b8541d78f1 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 4 Feb 2008 15:29:44 +0000 Subject: (cancel-change-group): Don't move point. --- lisp/subr.el | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'lisp/subr.el') diff --git a/lisp/subr.el b/lisp/subr.el index b4bd4a0150c..ef908c0a7cb 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1871,28 +1871,29 @@ This finishes the change group by accepting its changes as final." (defun cancel-change-group (handle) "Finish a change group made with `prepare-change-group' (which see). This finishes the change group by reverting all of its changes." - (dolist (elt handle) - (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))))) + (save-excursion + (dolist (elt handle) + (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)))))) ;;;; Display-related functions. -- cgit v1.2.3 From cb11476b222555583a5afe3f61d08fc8191d0ccc Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 4 Feb 2008 15:31:09 +0000 Subject: (cancel-change-group): Improve last fix. --- lisp/subr.el | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'lisp/subr.el') diff --git a/lisp/subr.el b/lisp/subr.el index ef908c0a7cb..8420c8553dd 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1871,29 +1871,29 @@ This finishes the change group by accepting its changes as final." (defun cancel-change-group (handle) "Finish a change group made with `prepare-change-group' (which see). This finishes the change group by reverting all of its changes." - (save-excursion - (dolist (elt handle) - (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)))))) + (dolist (elt handle) + (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. + (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. -- cgit v1.2.3 From d66bd635bd6de3952758cc604fb431094053f524 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 21 Feb 2008 08:13:14 +0000 Subject: (sit-for): Fix obsolete form for nil second argument. --- lisp/ChangeLog | 4 ++++ lisp/subr.el | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'lisp/subr.el') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3071fd4107e..21b008ec5f2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2008-02-21 Glenn Morris + + * subr.el (sit-for): Fix obsolete form for nil second argument. + 2008-02-21 Dan Nicolaescu * progmodes/verilog-mode.el (eval-when-compile): Don't define diff --git a/lisp/subr.el b/lisp/subr.el index 8420c8553dd..329c4ca2c24 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1763,9 +1763,10 @@ in milliseconds; this was useful when Emacs was built without floating point support. \(fn SECONDS &optional NODISP)" - (when (or obsolete (numberp nodisp)) - (setq seconds (+ seconds (* 1e-3 nodisp))) - (setq nodisp obsolete)) + (if (numberp nodisp) + (setq seconds (+ seconds (* 1e-3 nodisp)) + nodisp obsolete) + (if obsolete (setq nodisp obsolete))) (cond (noninteractive (sleep-for seconds) -- cgit v1.2.3