73 |
`font-lock-inhibit-thing-lock' and `font-lock-maximum-size'.") |
`font-lock-inhibit-thing-lock' and `font-lock-maximum-size'.") |
74 |
(make-variable-buffer-local 'font-lock-defaults) |
(make-variable-buffer-local 'font-lock-defaults) |
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 |
;; 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 |
;; 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 |
;; we can't avoid it. In the future, this stuff will hopefully be |
267 |
(set (make-local-variable 'font-lock-set-defaults) t) |
(set (make-local-variable 'font-lock-set-defaults) t) |
268 |
(make-local-variable 'font-lock-fontified) |
(make-local-variable 'font-lock-fontified) |
269 |
(make-local-variable 'font-lock-multiline) |
(make-local-variable 'font-lock-multiline) |
270 |
;; Detect if this is a simple mode, which doesn't use any |
(let ((defaults (or font-lock-defaults |
271 |
;; syntactic fontification functions. |
(assq major-mode font-lock-defaults-alist)))) |
272 |
(when (or font-lock-defaults |
(when (and defaults |
273 |
(assq major-mode font-lock-defaults-alist)) |
;; Detect if this is a simple mode, which doesn't use |
274 |
(require 'font-lock) |
;; any syntactic fontification functions. |
275 |
(font-lock-set-defaults-1)))) |
(not (cdr (assq 'font-lock-core-only |
276 |
|
(nthcdr 5 defaults))))) |
277 |
|
(require 'font-lock) |
278 |
|
(font-lock-set-defaults-1))))) |
279 |
|
|
280 |
;;; Global Font Lock mode. |
;;; Global Font Lock mode. |
281 |
|
|