diff options
| author | Luc Teirlinck | 2005-05-22 22:13:49 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2005-05-22 22:13:49 +0000 |
| commit | 21178fee96a687c0809cb7db123984642b26f431 (patch) | |
| tree | f21a04ebd1ce17c4c6498485916edc6ff11a0e0c | |
| parent | 7fb8093523ddd808ffcdd93a7cb21f8975008ed6 (diff) | |
| download | emacs-21178fee96a687c0809cb7db123984642b26f431.tar.gz emacs-21178fee96a687c0809cb7db123984642b26f431.zip | |
Update comment.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/font-core.el | 24 |
2 files changed, 19 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 561610f2181..2273e72b118 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2005-05-22 Luc Teirlinck <teirllm@auburn.edu> | ||
| 2 | |||
| 3 | * font-core.el: Update comment. | ||
| 4 | |||
| 5 | * emacs-lisp/easy-mmode.el (define-global-minor-mode): Use | ||
| 6 | `after-change-major-mode-hook' instead of `find-file-hook'. | ||
| 7 | |||
| 8 | * buff-menu.el (Buffer-menu-mode): Use `run-mode-hooks'. | ||
| 9 | |||
| 1 | 2005-05-22 Eli Zaretskii <eliz@gnu.org> | 10 | 2005-05-22 Eli Zaretskii <eliz@gnu.org> |
| 2 | 11 | ||
| 3 | * simple.el (yank, yank-pop): Mention `yank-excluded-properties' | 12 | * simple.el (yank, yank-pop): Mention `yank-excluded-properties' |
diff --git a/lisp/font-core.el b/lisp/font-core.el index a077ce756c0..056c1b3515b 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el | |||
| @@ -231,24 +231,20 @@ this function onto `change-major-mode-hook'." | |||
| 231 | ;; hook is run, the major mode is in the process of being changed and we do not | 231 | ;; hook is run, the major mode is in the process of being changed and we do not |
| 232 | ;; know what the final major mode will be. So, `font-lock-change-major-mode' | 232 | ;; know what the final major mode will be. So, `font-lock-change-major-mode' |
| 233 | ;; only (a) notes the name of the current buffer, and (b) adds our function | 233 | ;; only (a) notes the name of the current buffer, and (b) adds our function |
| 234 | ;; `turn-on-font-lock-if-enabled' to the hook variables `find-file-hook' and | 234 | ;; `turn-on-font-lock-if-enabled' to the hook variables |
| 235 | ;; `post-command-hook' (for buffers that are not visiting files). By the time | 235 | ;; `after-change-major-mode-hook' and `post-command-hook' (for modes |
| 236 | ;; that do not yet run `after-change-major-mode-hook'). By the time | ||
| 236 | ;; the functions on the first of these hooks to be run are run, the new major | 237 | ;; the functions on the first of these hooks to be run are run, the new major |
| 237 | ;; mode is assumed to be in place. This way we get a Font Lock function run | 238 | ;; mode is assumed to be in place. This way we get a Font Lock function run |
| 238 | ;; when a major mode is turned on, without knowing major modes or their hooks. | 239 | ;; when a major mode is turned on, without knowing major modes or their hooks. |
| 239 | ;; | 240 | ;; |
| 240 | ;; Naturally this requires that (a) major modes run `kill-all-local-variables', | 241 | ;; Naturally this requires that major modes run `kill-all-local-variables' |
| 241 | ;; as they are supposed to do, and (b) the major mode is in place after the | 242 | ;; and `after-change-major-mode-hook', as they are supposed to. For modes |
| 242 | ;; file is visited or the command that ran `kill-all-local-variables' has | 243 | ;; that do not run `after-change-major-mode-hook' yet, `post-command-hook' |
| 243 | ;; finished, whichever the sooner. Arguably, any major mode that does not | 244 | ;; takes care of things if the mode is set directly or indirectly by |
| 244 | ;; follow the convension (a) is broken, and I can't think of any reason why (b) | 245 | ;; an interactive command; however, problems can occur if the mode is |
| 245 | ;; would not be met (except `gnudoit' on non-files). However, it is not clean. | 246 | ;; set by a timer or process: in that case, proper handling of Font Lock mode |
| 246 | ;; | 247 | ;; may be delayed until the next interactive command. |
| 247 | ;; Probably the cleanest solution is to have each major mode function run some | ||
| 248 | ;; hook, e.g., `major-mode-hook', but maybe implementing that change is | ||
| 249 | ;; impractical. I am personally against making `setq' a macro or be advised, | ||
| 250 | ;; or have a special function such as `set-major-mode', but maybe someone can | ||
| 251 | ;; come up with another solution? | ||
| 252 | 248 | ||
| 253 | ;; User interface. | 249 | ;; User interface. |
| 254 | ;; | 250 | ;; |