emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 84055bd: * lisp/subr.el (atomic-change-group): Fix


From: Stefan Monnier
Subject: [Emacs-diffs] master 84055bd: * lisp/subr.el (atomic-change-group): Fix return value
Date: Tue, 30 Jan 2018 09:55:14 -0500 (EST)

branch: master
commit 84055bda91d48dd603110b0805560cf1df205a83
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * lisp/subr.el (atomic-change-group): Fix return value
    
    Suggested by Jarosław Rzeszótko <address@hidden>.
---
 lisp/subr.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/subr.el b/lisp/subr.el
index 24bd288..00bab70 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2586,7 +2586,7 @@ is nil and `use-dialog-box' is non-nil."
 ;;; Atomic change groups.
 
 (defmacro atomic-change-group (&rest body)
-  "Perform BODY as an atomic change group.
+  "Like `progn' but perform BODY as an atomic change group.
 This means that if BODY exits abnormally,
 all of its changes to the current buffer are undone.
 This works regardless of whether undo is enabled in the buffer.
@@ -2609,8 +2609,8 @@ user can undo the change normally."
             ;; it enables undo if that was disabled; we need
             ;; to make sure that it gets disabled again.
             (activate-change-group ,handle)
-            ,@body
-            (setq ,success t))
+            (prog1 ,(macroexp-progn body)
+              (setq ,success t)))
         ;; Either of these functions will disable undo
         ;; if it was disabled before.
         (if ,success



reply via email to

[Prev in Thread] Current Thread [Next in Thread]