diff options
| author | Luc Teirlinck | 2005-05-22 22:07:22 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2005-05-22 22:07:22 +0000 |
| commit | 7fb8093523ddd808ffcdd93a7cb21f8975008ed6 (patch) | |
| tree | 08dfd2cd5a29bdc333b6ecaff02879ea4964de70 | |
| parent | 5f90d77ec8716a3753eaaaa2cff538c9f427dd3f (diff) | |
| download | emacs-7fb8093523ddd808ffcdd93a7cb21f8975008ed6.tar.gz emacs-7fb8093523ddd808ffcdd93a7cb21f8975008ed6.zip | |
(define-global-minor-mode): Use `after-change-major-mode-hook' instead
of `find-file-hook'.
| -rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 0892af1bb35..188dc172e07 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el | |||
| @@ -172,7 +172,7 @@ For example, you could write | |||
| 172 | (setq group | 172 | (setq group |
| 173 | `(:group ',(intern (replace-regexp-in-string | 173 | `(:group ',(intern (replace-regexp-in-string |
| 174 | "-mode\\'" "" mode-name))))) | 174 | "-mode\\'" "" mode-name))))) |
| 175 | 175 | ||
| 176 | `(progn | 176 | `(progn |
| 177 | ;; Define the variable to enable or disable the mode. | 177 | ;; Define the variable to enable or disable the mode. |
| 178 | ,(if (not globalp) | 178 | ,(if (not globalp) |
| @@ -306,9 +306,9 @@ in which `%s' turns it on." | |||
| 306 | ;; Setup hook to handle future mode changes and new buffers. | 306 | ;; Setup hook to handle future mode changes and new buffers. |
| 307 | (if ,global-mode | 307 | (if ,global-mode |
| 308 | (progn | 308 | (progn |
| 309 | (add-hook 'find-file-hook ',buffers) | 309 | (add-hook 'after-change-major-mode-hook ',buffers) |
| 310 | (add-hook 'change-major-mode-hook ',cmmh)) | 310 | (add-hook 'change-major-mode-hook ',cmmh)) |
| 311 | (remove-hook 'find-file-hook ',buffers) | 311 | (remove-hook 'after-change-major-mode-hook ',buffers) |
| 312 | (remove-hook 'change-major-mode-hook ',cmmh)) | 312 | (remove-hook 'change-major-mode-hook ',cmmh)) |
| 313 | 313 | ||
| 314 | ;; Go through existing buffers. | 314 | ;; Go through existing buffers. |