/[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.28 by teirllm, Sun May 22 22:08:59 2005 UTC revision 1.29 by teirllm, Sat Jun 4 22:18:53 2005 UTC
# Line 88  settings.  See the variable `font-lock-d Line 88  settings.  See the variable `font-lock-d
88  It will be passed one argument, which is the current value of  It will be passed one argument, which is the current value of
89  `font-lock-mode'.")  `font-lock-mode'.")
90    
91    ;; The mode for which font-lock was initialized, or nil if none.
92    (defvar font-lock-mode-major-mode)
93  (define-minor-mode font-lock-mode  (define-minor-mode font-lock-mode
94    "Toggle Font Lock mode.    "Toggle Font Lock mode.
95  With arg, turn Font Lock mode off if and only if arg is a non-positive  With arg, turn Font Lock mode off if and only if arg is a non-positive
# Line 156  your own function which is called when ` Line 158  your own function which is called when `
158    ;; Arrange to unfontify this buffer if we change major mode later.    ;; Arrange to unfontify this buffer if we change major mode later.
159    (if font-lock-mode    (if font-lock-mode
160        (add-hook 'change-major-mode-hook 'font-lock-change-mode nil t)        (add-hook 'change-major-mode-hook 'font-lock-change-mode nil t)
161      (remove-hook 'change-major-mode-hook 'font-lock-change-mode t)))      (remove-hook 'change-major-mode-hook 'font-lock-change-mode t))
162      (when font-lock-mode
163        (setq font-lock-mode-major-mode major-mode)))
164    
165  ;; Get rid of fontification for the old major mode.  ;; Get rid of fontification for the old major mode.
166  ;; We do this when changing major modes.  ;; We do this when changing major modes.
# Line 175  this function onto `change-major-mode-ho Line 179  this function onto `change-major-mode-ho
179                                        '(font-lock-face)))                                        '(font-lock-face)))
180      (restore-buffer-modified-p modp)))      (restore-buffer-modified-p modp)))
181    
182    (defvar font-lock-set-defaults)
183  (defun font-lock-default-function (mode)  (defun font-lock-default-function (mode)
184    ;; Turn on Font Lock mode.    ;; Turn on Font Lock mode.
185    (when mode    (when mode
# Line 201  this function onto `change-major-mode-ho Line 206  this function onto `change-major-mode-ho
206    ;; Only do hard work if the mode has specified stuff in    ;; Only do hard work if the mode has specified stuff in
207    ;; `font-lock-defaults'.    ;; `font-lock-defaults'.
208    (when (or font-lock-defaults    (when (or font-lock-defaults
209              (and (boundp 'font-lock-keywords) font-lock-keywords)              (if (boundp 'font-lock-keywords) font-lock-keywords)
210              (with-no-warnings              (with-no-warnings
211               (cdr (assq major-mode font-lock-defaults-alist))))                (cdr (assq major-mode font-lock-defaults-alist)))
212                (and mode
213                     (boundp 'font-lock-set-defaults)
214                     font-lock-set-defaults
215                     font-lock-mode-major-mode
216                     (not (eq font-lock-mode-major-mode major-mode))))
217      (font-lock-mode-internal mode)))      (font-lock-mode-internal mode)))
218    
219  (defun turn-on-font-lock ()  (defun turn-on-font-lock ()

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

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