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

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

[elpa] externals/vlf e115e7e 053/310: Add custom revert function.


From: Stefan Monnier
Subject: [elpa] externals/vlf e115e7e 053/310: Add custom revert function.
Date: Sat, 28 Nov 2020 00:32:45 -0500 (EST)

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

    Add custom revert function.
---
 vlfi.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/vlfi.el b/vlfi.el
index c429408..436f082 100644
--- a/vlfi.el
+++ b/vlfi.el
@@ -75,6 +75,7 @@
   (set-buffer-modified-p nil)
   (buffer-disable-undo)
   (add-hook 'write-contents-functions 'vlfi-write)
+  (setq revert-buffer-function 'vlfi-revert)
   (make-local-variable 'vlfi-batch-size)
   (put 'vlfi-batch-size 'permanent-local t)
   (make-local-variable 'vlfi-start-pos)
@@ -242,6 +243,11 @@ buffer.  You can customize number of bytes displayed by 
customizing
     (vlfi-mode)
     (switch-to-buffer (current-buffer))))
 
+(defun vlfi-revert (&rest args)
+  "Revert current chunk.  Ignore ARGS."
+  (ignore args)
+  (vlfi-move-to-chunk vlfi-start-pos vlfi-end-pos))
+
 ;;;###autoload
 (defun dired-vlfi (from-end)
   "In Dired, visit the file on this line in VLFI mode.



reply via email to

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