]> git.eshelyaron.com Git - emacs.git/commitdiff
(define-global-minor-mode): Use `after-change-major-mode-hook' instead
authorLuc Teirlinck <teirllm@auburn.edu>
Sun, 22 May 2005 22:07:22 +0000 (22:07 +0000)
committerLuc Teirlinck <teirllm@auburn.edu>
Sun, 22 May 2005 22:07:22 +0000 (22:07 +0000)
of `find-file-hook'.

lisp/emacs-lisp/easy-mmode.el

index 0892af1bb35d2d7c10e617b0eab5b52c0933edb4..188dc172e07be202b16f6687ad3966020741129f 100644 (file)
@@ -172,7 +172,7 @@ For example, you could write
       (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 @@ in which `%s' turns it on."
         ;; 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.