/[emacs]/emacs/lisp/font-core.el
ViewVC logotype

Diff of /emacs/lisp/font-core.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by walters, Sun Jun 9 02:27:43 2002 UTC revision 1.8 by walters, Wed Jun 12 04:51:07 2002 UTC
# Line 73  and those for buffer-specialised fontifi Line 73  and those for buffer-specialised fontifi
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    
 (defvar font-lock-core-only nil  
   "If non-nil, then don't load font-lock.el unless necessary.")  
   
76  ;; This variable is used where font-lock.el itself supplies the  ;; This variable is used where font-lock.el itself supplies the
77  ;; 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
78  ;; 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
# Line 225  your own function which is called when ` Line 222  your own function which is called when `
222          (push (list 'face 'font-lock-face) char-property-alias-alist)))          (push (list 'face 'font-lock-face) char-property-alias-alist)))
223      ;; Only do hard work if the mode has specified stuff in      ;; Only do hard work if the mode has specified stuff in
224      ;; `font-lock-defaults'.      ;; `font-lock-defaults'.
225      (when (and font-lock-defaults      (when font-lock-defaults
                (not font-lock-core-only))  
226        (add-hook 'after-change-functions 'font-lock-after-change-function t t)        (add-hook 'after-change-functions 'font-lock-after-change-function t t)
227        (font-lock-turn-on-thing-lock)        (font-lock-turn-on-thing-lock)
228        ;; Fontify the buffer if we have to.        ;; Fontify the buffer if we have to.
# Line 248  your own function which is called when ` Line 244  your own function which is called when `
244          (setcdr elt (remq 'font-lock-face (cdr elt)))          (setcdr elt (remq 'font-lock-face (cdr elt)))
245          (when (null (cdr elt))          (when (null (cdr elt))
246            (setq char-property-alias-alist (delq elt char-property-alias-alist)))))            (setq char-property-alias-alist (delq elt char-property-alias-alist)))))
247      (when (and font-lock-defaults      (when font-lock-defaults
                (not font-lock-core-only))  
248        (remove-hook 'after-change-functions 'font-lock-after-change-function t)        (remove-hook 'after-change-functions 'font-lock-after-change-function t)
249        (font-lock-unfontify-buffer)        (font-lock-unfontify-buffer)
250        (font-lock-turn-off-thing-lock))))        (font-lock-turn-off-thing-lock))))
# Line 271  Sets various variables using `font-lock- Line 266  Sets various variables using `font-lock-
266      (make-local-variable 'font-lock-multiline)      (make-local-variable 'font-lock-multiline)
267      (let ((defaults (or font-lock-defaults      (let ((defaults (or font-lock-defaults
268                          (cdr (assq major-mode font-lock-defaults-alist)))))                          (cdr (assq major-mode font-lock-defaults-alist)))))
269        ;; Variable alist?        (when defaults
       (dolist (x (nthcdr 5 defaults))  
         (set (make-local-variable (car x)) (cdr x)))  
       (when (and defaults  
                  ;; Detect if this is a simple mode, which doesn't use  
                  ;; any syntactic fontification functions.  
                  (not font-lock-core-only))  
270          (require 'font-lock)          (require 'font-lock)
271          (font-lock-set-defaults-1)))))          (font-lock-set-defaults-1)))))
272    
# Line 353  means that Font Lock mode is turned on f Line 342  means that Font Lock mode is turned on f
342    :group 'font-lock)    :group 'font-lock)
343    
344  (defun turn-on-font-lock-if-enabled ()  (defun turn-on-font-lock-if-enabled ()
345    (when (and (or font-lock-defaults    (unless (and (eq (car-safe font-lock-global-modes) 'not)
346                   (assq major-mode font-lock-defaults-alist))                 (memq major-mode (cdr font-lock-global-modes)))
              (or (eq font-lock-global-modes t)  
                  (if (eq (car-safe font-lock-global-modes) 'not)  
                      (not (memq major-mode (cdr font-lock-global-modes)))  
                    (memq major-mode font-lock-global-modes))))  
347      (let (inhibit-quit)      (let (inhibit-quit)
348        (turn-on-font-lock))))        (turn-on-font-lock))))
349    

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26