changeset 62635:a33f6ed6e52e

(define-global-minor-mode): Use `after-change-major-mode-hook' instead of `find-file-hook'.
author Luc Teirlinck <teirllm@auburn.edu>
date Sun, 22 May 2005 22:07:22 +0000
parents 2c8a105a05e1
children 1db2bedaa05e
files lisp/emacs-lisp/easy-mmode.el
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/easy-mmode.el	Sun May 22 22:01:22 2005 +0000
+++ b/lisp/emacs-lisp/easy-mmode.el	Sun May 22 22:07:22 2005 +0000
@@ -172,7 +172,7 @@
       (setq group
 	    `(:group ',(intern (replace-regexp-in-string
 				"-mode\\'" "" mode-name)))))
-    
+
     `(progn
        ;; Define the variable to enable or disable the mode.
        ,(if (not globalp)
@@ -306,9 +306,9 @@
 	 ;; Setup hook to handle future mode changes and new buffers.
 	 (if ,global-mode
 	     (progn
-	       (add-hook 'find-file-hook ',buffers)
+	       (add-hook 'after-change-major-mode-hook ',buffers)
 	       (add-hook 'change-major-mode-hook ',cmmh))
-	   (remove-hook 'find-file-hook ',buffers)
+	   (remove-hook 'after-change-major-mode-hook ',buffers)
 	   (remove-hook 'change-major-mode-hook ',cmmh))
 
 	 ;; Go through existing buffers.