comparison lispref/modes.texi @ 53430:7abfe409def6

(Search-based Fontification): Explain that face specs are symbols with face names as values.
author Richard M. Stallman <rms@gnu.org>
date Mon, 29 Dec 2003 21:27:13 +0000
parents 1a5c50faf357
children bb6e41200945
comparison
equal deleted inserted replaced
53429:246f74971d9a 53430:7abfe409def6
2022 2022
2023 If you use @code{regexp-opt} to produce the regular expression 2023 If you use @code{regexp-opt} to produce the regular expression
2024 @var{matcher}, then you can use @code{regexp-opt-depth} (@pxref{Syntax 2024 @var{matcher}, then you can use @code{regexp-opt-depth} (@pxref{Syntax
2025 of Regexps}) to calculate the value for @var{match}. 2025 of Regexps}) to calculate the value for @var{match}.
2026 2026
2027 @item (@var{matcher} . @var{facename}) 2027 @item (@var{matcher} . @var{facespec})
2028 In this kind of element, @var{facename} is an expression whose value 2028 In this kind of element, @var{facespec} is an object which specifies
2029 specifies the face name to use for highlighting. 2029 the face variable to use for highlighting. In the simplest case, it
2030 is a Lisp variable (a symbol), whose value should be a face name.
2030 2031
2031 @example 2032 @example
2032 ;; @r{Highlight occurrences of @samp{fubar},} 2033 ;; @r{Highlight occurrences of @samp{fubar},}
2033 ;; @r{using the face which is the value of @code{fubar-face}.} 2034 ;; @r{using the face which is the value of @code{fubar-face}.}
2034 ("fubar" . fubar-face) 2035 ("fubar" . fubar-face)
2035 @end example 2036 @end example
2036 2037
2037 The value of @var{facename} is usually a face name (a symbol), but it 2038 However, @var{facespec} can also be a list of the form
2038 can also be a list of the form
2039 2039
2040 @example 2040 @example
2041 (face @var{face} @var{prop1} @var{val1} @var{prop2} @var{val2}@dots{}) 2041 (face @var{face} @var{prop1} @var{val1} @var{prop2} @var{val2}@dots{})
2042 @end example 2042 @end example
2043 2043
2051 In this kind of element, @var{highlighter} is a list 2051 In this kind of element, @var{highlighter} is a list
2052 which specifies how to highlight matches found by @var{matcher}. 2052 which specifies how to highlight matches found by @var{matcher}.
2053 It has the form 2053 It has the form
2054 2054
2055 @example 2055 @example
2056 (@var{subexp} @var{facename} @var{override} @var{laxmatch}) 2056 (@var{subexp} @var{facespec} @var{override} @var{laxmatch})
2057 @end example 2057 @end example
2058 2058
2059 The @sc{car}, @var{subexp}, is an integer specifying which subexpression 2059 The @sc{car}, @var{subexp}, is an integer specifying which subexpression
2060 of the match to fontify (0 means the entire matching text). The second 2060 of the match to fontify (0 means the entire matching text). The second
2061 subelement, @var{facename}, specifies the face, as described above. 2061 subelement, @var{facespec}, specifies the face, as described above.
2062 2062
2063 The last two values in @var{highlighter}, @var{override} and 2063 The last two values in @var{highlighter}, @var{override} and
2064 @var{laxmatch}, are flags. If @var{override} is @code{t}, this 2064 @var{laxmatch}, are flags. If @var{override} is @code{t}, this
2065 element can override existing fontification made by previous elements 2065 element can override existing fontification made by previous elements
2066 of @code{font-lock-keywords}. If it is @code{keep}, then each 2066 of @code{font-lock-keywords}. If it is @code{keep}, then each
2067 character is fontified if it has not been fontified already by some 2067 character is fontified if it has not been fontified already by some
2068 other element. If it is @code{prepend}, the face @var{facename} is 2068 other element. If it is @code{prepend}, the face specified by
2069 added to the beginning of the @code{font-lock-face} property. If it 2069 @var{facespec} is added to the beginning of the @code{font-lock-face}
2070 is @code{append}, the face @var{facename} is added to the end of the 2070 property. If it is @code{append}, the face is added to the end of the
2071 @code{font-lock-face} property. 2071 @code{font-lock-face} property.
2072 2072
2073 If @var{laxmatch} is non-@code{nil}, it means there should be no error 2073 If @var{laxmatch} is non-@code{nil}, it means there should be no error
2074 if there is no subexpression numbered @var{subexp} in @var{matcher}. 2074 if there is no subexpression numbered @var{subexp} in @var{matcher}.
2075 Obviously, fontification of the subexpression numbered @var{subexp} will 2075 Obviously, fontification of the subexpression numbered @var{subexp} will
2229 2229
2230 @defvar font-lock-extra-managed-props 2230 @defvar font-lock-extra-managed-props
2231 Additional properties (other than @code{font-lock-face}) that are 2231 Additional properties (other than @code{font-lock-face}) that are
2232 being managed by Font Lock mode. Font Lock mode normally manages only 2232 being managed by Font Lock mode. Font Lock mode normally manages only
2233 the @code{font-lock-face} property; if you want it to manage others as 2233 the @code{font-lock-face} property; if you want it to manage others as
2234 well, you must specify them in a @var{facename} in 2234 well, you must specify them in a @var{facespec} in
2235 @code{font-lock-keywords} as well as adding them to this list. 2235 @code{font-lock-keywords} as well as adding them to this list.
2236 @end defvar 2236 @end defvar
2237 2237
2238 @defvar font-lock-syntactic-face-function 2238 @defvar font-lock-syntactic-face-function
2239 A function to determine which face to use for a given syntactic 2239 A function to determine which face to use for a given syntactic