From 386d85656cdc84ce64fe43187665c611b962fbee Mon Sep 17 00:00:00 2001 From: Andrey Kotlarski Date: Wed, 18 Dec 2013 00:04:54 +0200 Subject: [PATCH] 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."