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:
parent
d88080f436
commit
386d85656c
8
vlf.el
8
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."
|
||||
|
Loading…
x
Reference in New Issue
Block a user