branch: elpa/vm commit bc3907cabec01b3ca686c80869b0e348219259fd Author: Stefan Monnier <monn...@iro.umontreal.ca> Commit: Stefan Monnier <monn...@iro.umontreal.ca>
Assume Emacs-22 hook names --- lisp/vm-folder.el | 15 +++++---------- lisp/vm-misc.el | 18 ------------------ 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/lisp/vm-folder.el b/lisp/vm-folder.el index dd3829dd31..ac13ba2075 100644 --- a/lisp/vm-folder.el +++ b/lisp/vm-folder.el @@ -4027,7 +4027,7 @@ Same as \\[vm-recover-folder]." ;; working any more. Not on GNU Emacs. USR, 2010-01-23 (defun vm-handle-file-recovery-or-reversion (recovery) - (if (and vm-summary-buffer (buffer-name vm-summary-buffer)) + (if (buffer-live-p vm-summary-buffer) (kill-buffer vm-summary-buffer)) (vm-virtual-quit) ;; reset major mode, this will cause vm to start from scratch. @@ -5260,16 +5260,11 @@ argument GARBAGE." (error nil)) (setq vm-message-garbage-alist (cdr vm-message-garbage-alist))))) -(vm-add-write-file-hook 'vm-write-file-hook) -(vm-add-find-file-hook 'vm-handle-file-recovery) -(vm-add-find-file-hook 'vm-handle-file-reversion) +(add-hook 'before-save-hook #'vm-write-file-hook) ;FIXME: Buffer-local! +(add-hook 'find-file-hook #'vm-handle-file-recovery) ;FIXME: Buffer-local! +(add-hook 'find-file-hook #'vm-handle-file-reversion) ;FIXME: Buffer-local! -;; after-revert-hook is new to FSF v19.23 -(defvar after-revert-hook) -(if (boundp 'after-revert-hook) - (setq after-revert-hook - (cons 'vm-after-revert-buffer-hook after-revert-hook)) - (setq after-revert-hook (list 'vm-after-revert-buffer-hook))) +(add-hook 'after-revert-hook #'vm-after-revert-buffer-hook) ;FIXME: Buffer-local! (defun vm-message-can-be-external (m) "Check if the message M can be used in external (headers-only) mode." diff --git a/lisp/vm-misc.el b/lisp/vm-misc.el index 4c22a97656..0643af83d2 100644 --- a/lisp/vm-misc.el +++ b/lisp/vm-misc.el @@ -1708,24 +1708,6 @@ If MODES is nil the take the modes from the variable (setq vm-disable-modes-ignore (cons m vm-disable-modes-ignore))) nil))))) -(defun vm-add-write-file-hook (vm-hook-fn) - "Add a function to the hook called during write-file. - -Emacs changed the name of write-file-hooks to write-file-functions as of -Emacs 22.1. This function is used to supress compiler warnings." - (if (boundp 'write-file-functions) - (add-hook 'write-file-functions vm-hook-fn) - (add-hook 'write-file-hooks vm-hook-fn))) - -(defun vm-add-find-file-hook (vm-hook-fn) - "Add a function to the hook called during find-file. - -Emacs changed the name of the hook find-file-hooks to find-file-hook in -Emacs 22.1. This function used to supress compiler warnings." - (if (boundp 'find-file-hook) - (add-hook 'find-file-hook vm-hook-fn) - (add-hook 'find-file-hooks vm-hook-fn))) - ;; Aliases for VM functions