• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/

Lines Matching defs:font

0 ;;; font-core.el --- Core interface to font-lock
29 ;; defining their own keywords to use for `font-lock-keywords'. (The mode
31 (defvar font-lock-defaults nil
54 `font-lock-keywords', `font-lock-keywords-only',
55 `font-lock-keywords-case-fold-search', `font-lock-syntax-table' and
56 `font-lock-beginning-of-syntax-function', respectively.
61 Currently, appropriate variables include `font-lock-mark-block-function'.
63 enclosing block of text, for fontification via \\[font-lock-fontify-block].
69 `font-lock-syntactic-keywords' and those for buffer-specialized fontification
70 functions, `font-lock-fontify-buffer-function',
71 `font-lock-unfontify-buffer-function', `font-lock-fontify-region-function',
72 `font-lock-unfontify-region-function', and `font-lock-inhibit-thing-lock'.")
73 (make-variable-buffer-local 'font-lock-defaults)
75 (defvar font-lock-defaults-alist nil
83 settings. See the variable `font-lock-defaults', which takes precedence.")
84 (make-obsolete-variable 'font-lock-defaults-alist 'font-lock-defaults)
86 (defvar font-lock-function 'font-lock-default-function
87 "A function which is called when `font-lock-mode' is toggled.
89 `font-lock-mode'.")
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
102 - Comments are displayed in `font-lock-comment-face';
103 - Strings are displayed in `font-lock-string-face';
105 value of the variable `font-lock-keywords'.
113 (add-hook 'c-mode-hook 'turn-on-font-lock)
117 of `font-lock-global-modes'. For example, put in your ~/.emacs:
119 (global-font-lock-mode t)
122 the variable `font-lock-maximum-decoration' to specify which level you
125 less than `font-lock-maximum-size'.
128 selected automatically via the variable `font-lock-maximum-decoration', you can
129 use `font-lock-add-keywords'.
132 size, you can use \\[font-lock-fontify-buffer].
136 syntactic change on other lines, you can use \\[font-lock-fontify-block].
138 See the variable `font-lock-defaults-alist' for the Font Lock mode default
140 buffer local value for `font-lock-defaults', via its mode hook.
142 The above is the default behavior of `font-lock-mode'; you may specify
143 your own function which is called when `font-lock-mode' is toggled via
144 `font-lock-function'. "
149 (setq font-lock-mode nil))
150 (funcall font-lock-function font-lock-mode)
152 (if font-lock-mode
153 (add-hook 'change-major-mode-hook 'font-lock-change-mode nil t)
154 (remove-hook 'change-major-mode-hook 'font-lock-change-mode t))
155 (when font-lock-mode
156 (setq font-lock-mode-major-mode major-mode)))
160 (defun font-lock-change-mode ()
161 (font-lock-mode -1))
163 (defun font-lock-defontify ()
164 "Clear out all `font-lock-face' properties in current buffer.
165 A major mode that uses `font-lock-face' properties might want to put
172 '(font-lock-face)))
175 (defvar font-lock-set-defaults)
176 (defun font-lock-default-function (mode)
181 ;; Add `font-lock-face' as an alias for the `face' property.
184 (unless (memq 'font-lock-face (cdr elt))
185 (setcdr elt (nconc (cdr elt) (list 'font-lock-face))))
186 (push (list 'face 'font-lock-face) char-property-alias-alist))))
189 ;; Remove `font-lock-face' as an alias for the `face' property.
194 (setcdr elt (remq 'font-lock-face (cdr elt)))
200 ;; `font-lock-defaults'.
201 (when (or font-lock-defaults
202 (if (boundp 'font-lock-keywords) font-lock-keywords)
204 (cdr (assq major-mode font-lock-defaults-alist)))
206 (boundp 'font-lock-set-defaults)
207 font-lock-set-defaults
208 font-lock-mode-major-mode
209 (not (eq font-lock-mode-major-mode major-mode))))
210 (font-lock-mode-internal mode)))
212 (defun turn-on-font-lock ()
214 (unless font-lock-mode
215 (font-lock-mode)))
233 ;; function `font-lock-change-major-mode' to that hook. Of course, when this
235 ;; know what the final major mode will be. So, `font-lock-change-major-mode'
237 ;; `turn-on-font-lock-if-enabled' to the hook variables
256 ;; command to toggle the feature (`global-font-lock-mode') with a variable for
257 ;; finer control of the mode's behaviour (`font-lock-global-modes').
259 ;; The feature should not be enabled by loading font-lock.el, since other
260 ;; mechanisms for turning on Font Lock mode, such as M-x font-lock-mode RET or
261 ;; (add-hook 'c-mode-hook 'turn-on-font-lock), would cause Font Lock mode to be
266 (defcustom font-lock-global-modes t
268 Global Font Lock mode is controlled by the command `global-font-lock-mode'.
282 :group 'font-lock)
284 (defun turn-on-font-lock-if-enabled ()
285 (unless (and (eq (car-safe font-lock-global-modes) 'not)
286 (memq major-mode (cdr font-lock-global-modes)))
288 (turn-on-font-lock))))
290 (define-globalized-minor-mode global-font-lock-mode
291 font-lock-mode turn-on-font-lock-if-enabled
295 :group 'font-lock
300 (provide 'font-core)
303 ;;; font-core.el ends here