emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/vlf 386d856 179/310: Restore undo information after tem


From: Stefan Monnier
Subject: [elpa] externals/vlf 386d856 179/310: Restore undo information after temporarily disabling it.
Date: Sat, 28 Nov 2020 00:33:11 -0500 (EST)

branch: externals/vlf
commit 386d85656cdc84ce64fe43187665c611b962fbee
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>

    Restore undo information after temporarily disabling it.
---
 vlf.el | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/vlf.el b/vlf.el
index 90eb66a..4ce3bb5 100644
--- a/vlf.el
+++ b/vlf.el
@@ -108,12 +108,10 @@ continuously recenter.")
 
 (defmacro vlf-with-undo-disabled (&rest body)
   "Execute BODY with temporarily disabled undo."
-  `(let ((undo-enabled (not (eq buffer-undo-list t))))
-     (if undo-enabled
-         (buffer-disable-undo))
+  `(let ((undo-list buffer-undo-list))
+     (setq buffer-undo-list t)
      (unwind-protect (progn ,@body)
-       (if undo-enabled
-           (buffer-enable-undo)))))
+       (setq buffer-undo-list undo-list))))
 
 (define-minor-mode vlf-mode
   "Mode to browse large files in."



reply via email to

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