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

Disable hexl-save-buffer and hexl revert when vlf-mode is active.

This commit is contained in:
Andrey Kotlarski 2014-02-15 02:40:31 +02:00
parent 6bb60b72ad
commit 2c231dfb15

9
vlf.el
View File

@ -138,7 +138,7 @@ values are: `write', `ediff', `occur', `search', `goto-line'."
(defun vlf-keep-alive () (defun vlf-keep-alive ()
"Keep `vlf-mode' on major mode change." "Keep `vlf-mode' on major mode change."
(if (eq major-mode 'hexl-mode) (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)) (setq vlf-mode t))
;;;###autoload ;;;###autoload
@ -222,6 +222,13 @@ When prefix argument is negative
(add-hook 'vlf-before-chunk-update 'vlf-hexl-before) (add-hook 'vlf-before-chunk-update 'vlf-hexl-before)
(add-hook 'vlf-after-chunk-update 'vlf-hexl-after) (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 (defadvice hexl-scroll-up (around vlf-hexl-scroll-up
activate compile) activate compile)
"Slide to next batch if at end of buffer in `vlf-mode'." "Slide to next batch if at end of buffer in `vlf-mode'."