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

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

[elpa] externals/vlf 2c231df 226/310: Disable hexl-save-buffer and hexl


From: Stefan Monnier
Subject: [elpa] externals/vlf 2c231df 226/310: Disable hexl-save-buffer and hexl revert when vlf-mode is active.
Date: Sat, 28 Nov 2020 00:33:20 -0500 (EST)

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

    Disable hexl-save-buffer and hexl revert when vlf-mode is active.
---
 vlf.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/vlf.el b/vlf.el
index e19a919..959c935 100644
--- a/vlf.el
+++ b/vlf.el
@@ -138,7 +138,7 @@ values are: `write', `ediff', `occur', `search', 
`goto-line'."
 (defun vlf-keep-alive ()
   "Keep `vlf-mode' on major mode change."
   (if (eq major-mode 'hexl-mode)
-      (remove-hook 'write-contents-functions 'hexl-save-buffer t))
+      (set (make-local-variable 'revert-buffer-function) 'vlf-revert))
   (setq vlf-mode t))
 
 ;;;###autoload
@@ -222,6 +222,13 @@ When prefix argument is negative
 (add-hook 'vlf-before-chunk-update 'vlf-hexl-before)
 (add-hook 'vlf-after-chunk-update 'vlf-hexl-after)
 
+(defadvice hexl-save-buffer (around vlf-hexl-save
+                                    activate compile)
+  "Prevent hexl save if `vlf-mode' is active."
+  (if vlf-mode
+      (vlf-write)
+    ad-do-it))
+
 (defadvice hexl-scroll-up (around vlf-hexl-scroll-up
                                   activate compile)
   "Slide to next batch if at end of buffer in `vlf-mode'."



reply via email to

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