From d9090cc15a6ec3039fc0dc9ef4c826b8541d78f1 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 4 Feb 2008 15:29:44 +0000 Subject: [PATCH] (cancel-change-group): Don't move point. --- lisp/ChangeLog | 45 +++++++++++++++++++++++---------------------- lisp/subr.el | 45 +++++++++++++++++++++++---------------------- 2 files changed, 46 insertions(+), 44 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 20554f8442d..93b63a00f55 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,10 +1,14 @@ +2008-02-04 Stefan Monnier + + * subr.el (cancel-change-group): Don't move point. + 2008-02-02 Michael Albinus Sync with Tramp 2.0.57. * net/tramp.el (tramp-handle-make-auto-save-file-name) - (tramp-completion-dissect-file-name, tramp-find-executable): Use - `mapc' instead of `mapcar'. + (tramp-completion-dissect-file-name, tramp-find-executable): + Use `mapc' instead of `mapcar'. (tramp-open-connection-setup-interactive-shell): Send only single prompt setting commands, in order to avoid double-prompt. @@ -112,8 +116,8 @@ 2008-01-26 Alan Mackenzie - * progmodes/cc-defs.el (c-save-buffer-state): Bind - buffer-file-name and buffer-file-truename to nil, to prevent + * progmodes/cc-defs.el (c-save-buffer-state): + Bind buffer-file-name and buffer-file-truename to nil, to prevent primitives generating "buffer is read only" messages. 2008-01-26 Eli Zaretskii @@ -179,9 +183,8 @@ 2008-01-16 Alan Mackenzie - * progmodes/cc-vars.el (c-constant-symbol): Put this defun inside - an eval-and-compile, so as to permit byte-compiling (e.g. in - bootstrap). + * progmodes/cc-vars.el (c-constant-symbol): Put this defun inside an + eval-and-compile, so as to permit byte-compiling (e.g. in bootstrap). 2008-01-16 Juanma Barranquero @@ -225,7 +228,7 @@ * progmodes/cc-vars.el (c-hanging-braces-alist): Remove the obscure non-working fragment ":value c-". - * progmodes/cc-engine.el (c-guess-basic-syntax): prevent a macro + * progmodes/cc-engine.el (c-guess-basic-syntax): Prevent a macro call inside a struct being recognised as a K&R argument. 2008-01-14 Jason Rumney @@ -240,15 +243,14 @@ 2008-01-12 Eli Zaretskii - * view.el (view-file-other-window, view-file-other-frame): Don't - kill the buffer if it is modified. Doc fixes. + * view.el (view-file-other-window, view-file-other-frame): + Don't kill the buffer if it is modified. Doc fixes. (kill-buffer-if-not-modified): New function. (view-file): Don't kill the buffer if it is modified. - * progmodes/ebrowse.el (ebrowse-view-file-other-window): Delete - function. - (ebrowse-view/find-file-and-search-pattern): Call - view-file-other-window instead of ebrowse-view-file-other-window. + * progmodes/ebrowse.el (ebrowse-view-file-other-window): Delete. + (ebrowse-view/find-file-and-search-pattern): + Call view-file-other-window instead of ebrowse-view-file-other-window. (ebrowse-view-file-other-frame): Don't call current-window-configuration. Fix second argument in the call to view-mode-enter. Doc fix. @@ -263,8 +265,8 @@ 2008-01-10 Dan Nicolaescu - * files.el (safe-local-eval-forms): Mark - (add-hook 'write-file-hooks 'time-stamp) as safe. + * files.el (safe-local-eval-forms): + Mark (add-hook 'write-file-hooks 'time-stamp) as safe. 2008-01-10 Nick Roberts @@ -344,8 +346,8 @@ (verilog-auto-input-ignore-regexp) (verilog-auto-inout-ignore-regexp) (verilog-auto-output-ignore-regexp) - (verilog-auto-unused-ignore-regexp, verilog-typedef-regexp): Add - safe-local-variable properties. + (verilog-auto-unused-ignore-regexp, verilog-typedef-regexp): + Add safe-local-variable properties. (verilog-statement-menu, verilog-company) (verilog-re-search-forward, verilog-re-search-backward) (verilog-error-regexp-add, verilog-end-block-re) @@ -431,13 +433,12 @@ 2008-01-07 Nick Roberts - * progmodes/gdb-ui.el (gud-gdb-command-name): Explain - "--annotate=3" option is necessary for the Graphical Interface. + * progmodes/gdb-ui.el (gud-gdb-command-name): + Explain "--annotate=3" option is necessary for the Graphical Interface. 2008-01-07 Dan Nicolaescu - * vc-hg.el (vc-hg-dir-state): Pass the dir argument to - vc-hg-command. + * vc-hg.el (vc-hg-dir-state): Pass the dir argument to vc-hg-command. 2008-01-07 Glenn Morris 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. -- 2.11.4.GIT