mirror of
https://github.com/m00natic/vlfi.git
synced 2025-02-24 05:48:06 +00:00
Use derived-mode-p.
This commit is contained in:
parent
8ba5bead36
commit
1f9ba7ce5f
6
vlf.el
6
vlf.el
@ -128,7 +128,7 @@ values are: `write', `ediff', `occur', `search', `goto-line'."
|
|||||||
(remove-hook 'write-file-functions 'vlf-write t)
|
(remove-hook 'write-file-functions 'vlf-write t)
|
||||||
(remove-hook 'after-change-major-mode-hook
|
(remove-hook 'after-change-major-mode-hook
|
||||||
'vlf-keep-alive t)
|
'vlf-keep-alive t)
|
||||||
(let ((hexl (eq major-mode 'hexl-mode)))
|
(let ((hexl (derived-mode-p 'hexl-mode)))
|
||||||
(if hexl (hexl-mode-exit))
|
(if hexl (hexl-mode-exit))
|
||||||
(let ((pos (+ vlf-start-pos (position-bytes (point)))))
|
(let ((pos (+ vlf-start-pos (position-bytes (point)))))
|
||||||
(vlf-with-undo-disabled
|
(vlf-with-undo-disabled
|
||||||
@ -140,7 +140,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 (derived-mode-p 'hexl-mode)
|
||||||
(set (make-local-variable 'revert-buffer-function) 'vlf-revert))
|
(set (make-local-variable 'revert-buffer-function) 'vlf-revert))
|
||||||
(setq vlf-mode t))
|
(setq vlf-mode t))
|
||||||
|
|
||||||
@ -209,7 +209,7 @@ When prefix argument is negative
|
|||||||
;; hexl mode integration
|
;; hexl mode integration
|
||||||
(defun vlf-hexl-before (&optional operation)
|
(defun vlf-hexl-before (&optional operation)
|
||||||
"Temporarily disable `hexl-mode' for OPERATION."
|
"Temporarily disable `hexl-mode' for OPERATION."
|
||||||
(when (eq major-mode 'hexl-mode)
|
(when (derived-mode-p 'hexl-mode)
|
||||||
(hexl-mode-exit)
|
(hexl-mode-exit)
|
||||||
(set (make-local-variable 'vlf-restore-hexl-mode) operation)))
|
(set (make-local-variable 'vlf-restore-hexl-mode) operation)))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user