comparison lisp/font-lock.el @ 380:8626e4521993 r21-2-5

Import from CVS: tag r21-2-5
author cvs
date Mon, 13 Aug 2007 11:07:10 +0200
parents 6240c7796c7a
children 7d59cb494b73
comparison
equal deleted inserted replaced
379:76b7d63099ad 380:8626e4521993
126 ;; i.e., (b) above, all modes that have items that can be thought of as, say, 126 ;; i.e., (b) above, all modes that have items that can be thought of as, say,
127 ;; keywords, should be highlighted with the same face, etc. 127 ;; keywords, should be highlighted with the same face, etc.
128 ;; - Keep the faces distinct from each other as far as possible. 128 ;; - Keep the faces distinct from each other as far as possible.
129 ;; i.e., (a) above. 129 ;; i.e., (a) above.
130 ;; - Make the face attributes fit the concept as far as possible. 130 ;; - Make the face attributes fit the concept as far as possible.
131 ;; i.e., function names might be a bold colour such as blue, comments might 131 ;; i.e., function names might be a bold color such as blue, comments might
132 ;; be a bright colour such as red, character strings might be brown, because, 132 ;; be a bright color such as red, character strings might be brown, because,
133 ;; err, strings are brown (that was not the reason, please believe me). 133 ;; err, strings are brown (that was not the reason, please believe me).
134 ;; - Don't use a non-nil OVERRIDE unless you have a good reason. 134 ;; - Don't use a non-nil OVERRIDE unless you have a good reason.
135 ;; Only use OVERRIDE for special things that are easy to define, such as the 135 ;; Only use OVERRIDE for special things that are easy to define, such as the
136 ;; way `...' quotes are treated in strings and comments in Emacs Lisp mode. 136 ;; way `...' quotes are treated in strings and comments in Emacs Lisp mode.
137 ;; Don't use it to, say, highlight keywords in commented out code or strings. 137 ;; Don't use it to, say, highlight keywords in commented out code or strings.
373 (MATCHER PRE-MATCH-FORM POST-MATCH-FORM MATCH-HIGHLIGHT ...) 373 (MATCHER PRE-MATCH-FORM POST-MATCH-FORM MATCH-HIGHLIGHT ...)
374 374
375 Where MATCHER is as for MATCH-HIGHLIGHT with one exception; see below. 375 Where MATCHER is as for MATCH-HIGHLIGHT with one exception; see below.
376 PRE-MATCH-FORM and POST-MATCH-FORM are evaluated before the first, and after 376 PRE-MATCH-FORM and POST-MATCH-FORM are evaluated before the first, and after
377 the last, instance MATCH-ANCHORED's MATCHER is used. Therefore they can be 377 the last, instance MATCH-ANCHORED's MATCHER is used. Therefore they can be
378 used to initialise before, and cleanup after, MATCHER is used. Typically, 378 used to initialize before, and cleanup after, MATCHER is used. Typically,
379 PRE-MATCH-FORM is used to move to some position relative to the original 379 PRE-MATCH-FORM is used to move to some position relative to the original
380 MATCHER, before starting with MATCH-ANCHORED's MATCHER. POST-MATCH-FORM might 380 MATCHER, before starting with MATCH-ANCHORED's MATCHER. POST-MATCH-FORM might
381 be used to move, before resuming with MATCH-ANCHORED's parent's MATCHER. 381 be used to move, before resuming with MATCH-ANCHORED's parent's MATCHER.
382 382
383 For example, an element of the form highlights (if not already highlighted): 383 For example, an element of the form highlights (if not already highlighted):
531 "Non nil means `font-lock-mode' is on" 531 "Non nil means `font-lock-mode' is on"
532 :group 'font-lock 532 :group 'font-lock
533 :type 'boolean 533 :type 'boolean
534 :initialize 'custom-initialize-default 534 :initialize 'custom-initialize-default
535 :require 'font-lock 535 :require 'font-lock
536 :set '(lambda (var val) 536 :set #'(lambda (var val) (font-lock-mode (or val 0)))
537 (font-lock-mode (or val 0)))
538 ) 537 )
539 538
540 (defvar font-lock-fontified nil) ; whether we have hacked this buffer 539 (defvar font-lock-fontified nil) ; whether we have hacked this buffer
541 (put 'font-lock-fontified 'permanent-local t) 540 (put 'font-lock-fontified 'permanent-local t)
542 541