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

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

[elpa] externals/vlf 5405a30 045/310: Intercept buffer saving with vlfi-


From: Stefan Monnier
Subject: [elpa] externals/vlf 5405a30 045/310: Intercept buffer saving with vlfi-write.
Date: Sat, 28 Nov 2020 00:32:44 -0500 (EST)

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

    Intercept buffer saving with vlfi-write.
---
 vlfi.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/vlfi.el b/vlfi.el
index ff1bd59..ffa5263 100644
--- a/vlfi.el
+++ b/vlfi.el
@@ -393,6 +393,7 @@ successful.  Return nil if nothing found."
   "Major mode for editing large file chunks."
   (setq buffer-read-only nil)
   (buffer-enable-undo)
+  (add-hook 'write-contents-functions 'vlfi-write)
   (message (substitute-command-keys
             "Editing: Type \\[vlfi-write] to write chunk \
 or \\[vlfi-discard-edit] to discard changes.")))
@@ -405,7 +406,8 @@ or \\[vlfi-discard-edit] to discard changes.")))
 End of chunk will be garbled.  Continue? "))
     (write-region nil nil buffer-file-name vlfi-start-pos)
     (vlfi-move-to-chunk vlfi-start-pos vlfi-end-pos)
-    (vlfi-mode)))
+    (vlfi-mode))
+  t)
 
 (defun vlfi-discard-edit ()
   "Discard edit and refresh chunk from file."



reply via email to

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