/[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.1 by walters, Tue May 21 20:39:54 2002 UTC revision 1.2 by walters, Thu May 23 03:38:22 2002 UTC
# Line 144  wish to have fontification turned on and Line 144  wish to have fontification turned on and
144  variable is non-nil, then calling `font-lock-mode' will simply toggle  variable is non-nil, then calling `font-lock-mode' will simply toggle
145  the symbol property `face' of CATEGORY-SYMBOL.")  the symbol property `face' of CATEGORY-SYMBOL.")
146    
147    (defvar font-lock-function 'font-lock-default-function
148      "A function which is called when `font-lock-mode' is toggled.
149    It will be passed one argument, which is the current value of
150    `font-lock-mode'.")
151    (make-variable-buffer-local 'font-lock-default-function)
152    
153  (define-minor-mode font-lock-mode  (define-minor-mode font-lock-mode
154    "Toggle Font Lock mode.    "Toggle Font Lock mode.
155  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 198  syntactic change on other lines, you can Line 204  syntactic change on other lines, you can
204    
205  See the variable `font-lock-defaults-alist' for the Font Lock mode default  See the variable `font-lock-defaults-alist' for the Font Lock mode default
206  settings.  You can set your own default settings for some mode, by setting a  settings.  You can set your own default settings for some mode, by setting a
207  buffer local value for `font-lock-defaults', via its mode hook."  buffer local value for `font-lock-defaults', via its mode hook.
208    
209    The above is the default behavior of `font-lock-mode'; you may specify
210    your own function which is called when `font-lock-mode' is toggled via
211    `font-lock-function'. "
212    nil nil nil    nil nil nil
213    ;; Don't turn on Font Lock mode if we don't have a display (we're running a    ;; Don't turn on Font Lock mode if we don't have a display (we're running a
214    ;; batch job) or if the buffer is invisible (the name starts with a space).    ;; batch job) or if the buffer is invisible (the name starts with a space).
215    (when (or noninteractive (eq (aref (buffer-name) 0) ?\ ))    (when (or noninteractive (eq (aref (buffer-name) 0) ?\ ))
216      (setq font-lock-mode nil))      (setq font-lock-mode nil))
217      (funcall font-lock-function font-lock-mode))
218    
219    (defun font-lock-default-function (font-lock-mode)
220    ;; Turn on Font Lock mode.    ;; Turn on Font Lock mode.
221    (when font-lock-mode    (when font-lock-mode
222      (font-lock-set-defaults)      (font-lock-set-defaults)

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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