]> code.delx.au - gnu-emacs-elpa/commitdiff
packages/vlf/vlf.el: use derived-mode-p to check major mode.
authorAndrey Kotlarski <m00naticus@gmail.com>
Sun, 23 Feb 2014 16:22:13 +0000 (18:22 +0200)
committerAndrey Kotlarski <m00naticus@gmail.com>
Sun, 23 Feb 2014 16:22:13 +0000 (18:22 +0200)
packages/vlf/vlf.el

index f90b77087abbdb6523dbef150ede486b436698da..2e3c9a1b8eef4ff515a33b3b1e5403cfda66c635 100644 (file)
@@ -128,7 +128,7 @@ values are: `write', `ediff', `occur', `search', `goto-line'."
          (remove-hook 'write-file-functions 'vlf-write t)
          (remove-hook 'after-change-major-mode-hook
                       'vlf-keep-alive t)
-         (let ((hexl (eq major-mode 'hexl-mode)))
+         (let ((hexl (derived-mode-p 'hexl-mode)))
            (if hexl (hexl-mode-exit))
            (let ((pos (+ vlf-start-pos (position-bytes (point)))))
              (vlf-with-undo-disabled
@@ -140,7 +140,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)
+  (if (derived-mode-p 'hexl-mode)
       (set (make-local-variable 'revert-buffer-function) 'vlf-revert))
   (setq vlf-mode t))
 
@@ -209,7 +209,7 @@ When prefix argument is negative
 ;; hexl mode integration
 (defun vlf-hexl-before (&optional operation)
   "Temporarily disable `hexl-mode' for OPERATION."
-  (when (eq major-mode 'hexl-mode)
+  (when (derived-mode-p 'hexl-mode)
     (hexl-mode-exit)
     (set (make-local-variable 'vlf-restore-hexl-mode) operation)))