1
0
mirror of https://github.com/m00natic/vlfi.git synced 2025-01-18 12:05:31 +00:00

Restore undo information after temporarily disabling it.

This commit is contained in:
Andrey Kotlarski 2013-12-18 00:04:54 +02:00
parent d88080f436
commit 386d85656c

8
vlf.el
View File

@ -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."