diff options
| author | Colin Walters | 2002-06-08 20:31:13 +0000 |
|---|---|---|
| committer | Colin Walters | 2002-06-08 20:31:13 +0000 |
| commit | 1f63f8141f593bd57508b107d7240f4d82f85000 (patch) | |
| tree | 8d5b8bc654550147ddcc6beca8d0b84f8b48ef58 | |
| parent | 651f7556c173ddc553bb1bcfa8730ad221674e47 (diff) | |
| download | emacs-1f63f8141f593bd57508b107d7240f4d82f85000.tar.gz emacs-1f63f8141f593bd57508b107d7240f4d82f85000.zip | |
(char-property-alias-alist): New variable; describe its relation to
`default-text-properties' and the `category' property.
(default-text-properties): Note `char-property-alias-alist'.
(Special Properties): Document new property `font-lock-face'.
| -rw-r--r-- | lispref/text.texi | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/lispref/text.texi b/lispref/text.texi index d5760a73d89..bbbbb6eca82 100644 --- a/lispref/text.texi +++ b/lispref/text.texi | |||
| @@ -2318,6 +2318,15 @@ string, only text properties are considered, since strings never have | |||
| 2318 | overlays. | 2318 | overlays. |
| 2319 | @end defun | 2319 | @end defun |
| 2320 | 2320 | ||
| 2321 | @defvar char-property-alias-alist | ||
| 2322 | This variable holds an alist which maps property names to a list of | ||
| 2323 | alternative property names. If a character does not specify a direct | ||
| 2324 | value for a property, the alternative property names are consulted in | ||
| 2325 | order; the first non-nil value is used. This variable takes | ||
| 2326 | precedence over @code{default-text-properties}, and @code{category} | ||
| 2327 | properties take precedence over this variable. | ||
| 2328 | @end defvar | ||
| 2329 | |||
| 2321 | @defun text-properties-at position &optional object | 2330 | @defun text-properties-at position &optional object |
| 2322 | This function returns the entire property list of the character at | 2331 | This function returns the entire property list of the character at |
| 2323 | @var{position} in the string or buffer @var{object}. If @var{object} is | 2332 | @var{position} in the string or buffer @var{object}. If @var{object} is |
| @@ -2327,11 +2336,13 @@ This function returns the entire property list of the character at | |||
| 2327 | @defvar default-text-properties | 2336 | @defvar default-text-properties |
| 2328 | This variable holds a property list giving default values for text | 2337 | This variable holds a property list giving default values for text |
| 2329 | properties. Whenever a character does not specify a value for a | 2338 | properties. Whenever a character does not specify a value for a |
| 2330 | property, neither directly nor through a category symbol, the value | 2339 | property, neither directly, through a category symbol, or through |
| 2331 | stored in this list is used instead. Here is an example: | 2340 | @code{char-property-alias-alist}, the value stored in this list is |
| 2341 | used instead. Here is an example: | ||
| 2332 | 2342 | ||
| 2333 | @example | 2343 | @example |
| 2334 | (setq default-text-properties '(foo 69)) | 2344 | (setq default-text-properties '(foo 69) |
| 2345 | char-property-alias-alist nil) | ||
| 2335 | ;; @r{Make sure character 1 has no properties of its own.} | 2346 | ;; @r{Make sure character 1 has no properties of its own.} |
| 2336 | (set-text-properties 1 2 nil) | 2347 | (set-text-properties 1 2 nil) |
| 2337 | ;; @r{What we get, when we ask, is the default value.} | 2348 | ;; @r{What we get, when we ask, is the default value.} |
| @@ -2653,8 +2664,23 @@ just the foreground color or just the background color. | |||
| 2653 | @code{(:foreground @var{color-name})}, and likewise for the background. | 2664 | @code{(:foreground @var{color-name})}, and likewise for the background. |
| 2654 | @end itemize | 2665 | @end itemize |
| 2655 | 2666 | ||
| 2656 | @xref{Font Lock Mode}, for information on how to update @code{face} | 2667 | You can use Font Lock Mode (@pxref{Font Lock Mode}), to dynamically |
| 2657 | properties automatically based on the contents of the text. | 2668 | update @code{face} properties based on the contents of the text. |
| 2669 | |||
| 2670 | @item font-lock-face | ||
| 2671 | @kindex font-lock-face @r{(text property)} | ||
| 2672 | The @code{font-lock-face} property is the same in all respects as the | ||
| 2673 | @code{face} property, but its state of activation is controlled by | ||
| 2674 | @code{font-lock-mode}. This can be advantageous for special buffers | ||
| 2675 | which are not intended to be user-editable, or for static areas of | ||
| 2676 | text which are always fontified in the same way. | ||
| 2677 | @xref{Precalculated Fontification}. | ||
| 2678 | |||
| 2679 | Strictly speaking, @code{font-lock-face} is not a built-in text | ||
| 2680 | property; rather, it is implemented in Font Lock mode using | ||
| 2681 | @code{char-property-alias-alist}. @xref{Examining Properties}. | ||
| 2682 | |||
| 2683 | This property is new in Emacs 21.4. | ||
| 2658 | 2684 | ||
| 2659 | @item mouse-face | 2685 | @item mouse-face |
| 2660 | @kindex mouse-face @r{(text property)} | 2686 | @kindex mouse-face @r{(text property)} |