diff options
| author | Colin Walters | 2002-06-12 04:54:30 +0000 |
|---|---|---|
| committer | Colin Walters | 2002-06-12 04:54:30 +0000 |
| commit | 61fd2c68327f5ec3785ff7493b975aec905d882c (patch) | |
| tree | 89ebd843ec811088372891e5457c840510b5f049 | |
| parent | 333c5e0cba58e3d475b4c833196c21d4eba7a70c (diff) | |
| download | emacs-61fd2c68327f5ec3785ff7493b975aec905d882c.tar.gz emacs-61fd2c68327f5ec3785ff7493b975aec905d882c.zip | |
font-core.el (font-lock-core-only): Variable deleted. All uses removed.
(font-lock-set-defaults): Variable alist settings moved back into
font-lock-set-defaults-1.
(turn-on-font-lock-if-enabled): Always turn on font-lock unless it
is specifically excluded by the user.
| -rw-r--r-- | lisp/ChangeLog | 14 | ||||
| -rw-r--r-- | lisp/font-core.el | 25 |
2 files changed, 19 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c9d25507f30..da78ba8874e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -6,6 +6,20 @@ | |||
| 6 | font-lock-set-defaults-1. | 6 | font-lock-set-defaults-1. |
| 7 | (turn-on-font-lock-if-enabled): Always turn on font-lock unless it | 7 | (turn-on-font-lock-if-enabled): Always turn on font-lock unless it |
| 8 | is specifically excluded by the user. | 8 | is specifically excluded by the user. |
| 9 | |||
| 10 | * font-lock.el (font-lock-set-defaults-1): Set variable alist here. | ||
| 11 | |||
| 12 | * help-mode.el (help-mode): Don't set `font-lock-defaults'. | ||
| 13 | |||
| 14 | * ibuffer.el (ibuffer-mode): Don't set `font-lock-defaults'. | ||
| 15 | |||
| 16 | * info.el (Info-mode): Don't set `font-lock-defaults'. | ||
| 17 | |||
| 18 | * replace.el (occur-mode): Don't set `font-lock-defaults'. | ||
| 19 | |||
| 20 | * help-mode.el (help-highlight-p, help-highlight-face): Variable | ||
| 21 | was unused; deleted. | ||
| 22 | (help-make-xrefs): Doc fix. | ||
| 9 | 23 | ||
| 10 | 2002-06-11 Richard M. Stallman <rms@gnu.org> | 24 | 2002-06-11 Richard M. Stallman <rms@gnu.org> |
| 11 | 25 | ||
diff --git a/lisp/font-core.el b/lisp/font-core.el index 31bd6660411..6e3c994d61a 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el | |||
| @@ -73,9 +73,6 @@ and those for buffer-specialised fontification functions, | |||
| 73 | `font-lock-inhibit-thing-lock' and `font-lock-maximum-size'.") | 73 | `font-lock-inhibit-thing-lock' and `font-lock-maximum-size'.") |
| 74 | (make-variable-buffer-local 'font-lock-defaults) | 74 | (make-variable-buffer-local 'font-lock-defaults) |
| 75 | 75 | ||
| 76 | (defvar font-lock-core-only nil | ||
| 77 | "If non-nil, then don't load font-lock.el unless necessary.") | ||
| 78 | |||
| 79 | ;; This variable is used where font-lock.el itself supplies the | 76 | ;; This variable is used where font-lock.el itself supplies the |
| 80 | ;; keywords. Really, this shouldn't need to be in font-core.el, but | 77 | ;; keywords. Really, this shouldn't need to be in font-core.el, but |
| 81 | ;; we can't avoid it. In the future, this stuff will hopefully be | 78 | ;; we can't avoid it. In the future, this stuff will hopefully be |
| @@ -225,8 +222,7 @@ your own function which is called when `font-lock-mode' is toggled via | |||
| 225 | (push (list 'face 'font-lock-face) char-property-alias-alist))) | 222 | (push (list 'face 'font-lock-face) char-property-alias-alist))) |
| 226 | ;; Only do hard work if the mode has specified stuff in | 223 | ;; Only do hard work if the mode has specified stuff in |
| 227 | ;; `font-lock-defaults'. | 224 | ;; `font-lock-defaults'. |
| 228 | (when (and font-lock-defaults | 225 | (when font-lock-defaults |
| 229 | (not font-lock-core-only)) | ||
| 230 | (add-hook 'after-change-functions 'font-lock-after-change-function t t) | 226 | (add-hook 'after-change-functions 'font-lock-after-change-function t t) |
| 231 | (font-lock-turn-on-thing-lock) | 227 | (font-lock-turn-on-thing-lock) |
| 232 | ;; Fontify the buffer if we have to. | 228 | ;; Fontify the buffer if we have to. |
| @@ -248,8 +244,7 @@ your own function which is called when `font-lock-mode' is toggled via | |||
| 248 | (setcdr elt (remq 'font-lock-face (cdr elt))) | 244 | (setcdr elt (remq 'font-lock-face (cdr elt))) |
| 249 | (when (null (cdr elt)) | 245 | (when (null (cdr elt)) |
| 250 | (setq char-property-alias-alist (delq elt char-property-alias-alist))))) | 246 | (setq char-property-alias-alist (delq elt char-property-alias-alist))))) |
| 251 | (when (and font-lock-defaults | 247 | (when font-lock-defaults |
| 252 | (not font-lock-core-only)) | ||
| 253 | (remove-hook 'after-change-functions 'font-lock-after-change-function t) | 248 | (remove-hook 'after-change-functions 'font-lock-after-change-function t) |
| 254 | (font-lock-unfontify-buffer) | 249 | (font-lock-unfontify-buffer) |
| 255 | (font-lock-turn-off-thing-lock)))) | 250 | (font-lock-turn-off-thing-lock)))) |
| @@ -271,13 +266,7 @@ Sets various variables using `font-lock-defaults' (or, if nil, using | |||
| 271 | (make-local-variable 'font-lock-multiline) | 266 | (make-local-variable 'font-lock-multiline) |
| 272 | (let ((defaults (or font-lock-defaults | 267 | (let ((defaults (or font-lock-defaults |
| 273 | (cdr (assq major-mode font-lock-defaults-alist))))) | 268 | (cdr (assq major-mode font-lock-defaults-alist))))) |
| 274 | ;; Variable alist? | 269 | (when defaults |
| 275 | (dolist (x (nthcdr 5 defaults)) | ||
| 276 | (set (make-local-variable (car x)) (cdr x))) | ||
| 277 | (when (and defaults | ||
| 278 | ;; Detect if this is a simple mode, which doesn't use | ||
| 279 | ;; any syntactic fontification functions. | ||
| 280 | (not font-lock-core-only)) | ||
| 281 | (require 'font-lock) | 270 | (require 'font-lock) |
| 282 | (font-lock-set-defaults-1))))) | 271 | (font-lock-set-defaults-1))))) |
| 283 | 272 | ||
| @@ -353,12 +342,8 @@ means that Font Lock mode is turned on for buffers in C and C++ modes only." | |||
| 353 | :group 'font-lock) | 342 | :group 'font-lock) |
| 354 | 343 | ||
| 355 | (defun turn-on-font-lock-if-enabled () | 344 | (defun turn-on-font-lock-if-enabled () |
| 356 | (when (and (or font-lock-defaults | 345 | (unless (and (eq (car-safe font-lock-global-modes) 'not) |
| 357 | (assq major-mode font-lock-defaults-alist)) | 346 | (memq major-mode (cdr font-lock-global-modes))) |
| 358 | (or (eq font-lock-global-modes t) | ||
| 359 | (if (eq (car-safe font-lock-global-modes) 'not) | ||
| 360 | (not (memq major-mode (cdr font-lock-global-modes))) | ||
| 361 | (memq major-mode font-lock-global-modes)))) | ||
| 362 | (let (inhibit-quit) | 347 | (let (inhibit-quit) |
| 363 | (turn-on-font-lock)))) | 348 | (turn-on-font-lock)))) |
| 364 | 349 | ||