Mercurial > emacs
comparison lispref/text.texi @ 79681:3b1cb1535715
(Links and Mouse-1): Fix xref for commands.texi change.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 04 Jan 2008 05:43:39 +0000 |
parents | e8263132a24d |
children | a1e16e813aed |
comparison
equal
deleted
inserted
replaced
79680:681c8988ee67 | 79681:3b1cb1535715 |
---|---|
2987 attribute. With this feature, you do not need to create a face each | 2987 attribute. With this feature, you do not need to create a face each |
2988 time you want to specify a particular attribute for certain text. | 2988 time you want to specify a particular attribute for certain text. |
2989 @xref{Face Attributes}. | 2989 @xref{Face Attributes}. |
2990 | 2990 |
2991 @item | 2991 @item |
2992 A cons cell with the form @code{(foreground-color . @var{color-name})} or | 2992 A cons cell with the form @code{(foreground-color . @var{color-name})} |
2993 @code{(background-color . @var{color-name})}. These elements specify | 2993 or @code{(background-color . @var{color-name})}. These are older, |
2994 just the foreground color or just the background color. @xref{Color | 2994 deprecated equivalents for @code{(:foreground @var{color-name})} and |
2995 Names}, for the supported forms of @var{color-name}. | 2995 @code{(:background @var{color-name})}. Please convert code that uses |
2996 | 2996 them. |
2997 A cons cell of @code{(foreground-color . @var{color-name})} is equivalent to | |
2998 specifying @code{(:foreground @var{color-name})}; likewise for the | |
2999 background. | |
3000 @end itemize | 2997 @end itemize |
3001 | 2998 |
3002 You can use Font Lock Mode (@pxref{Font Lock Mode}), to dynamically | 2999 It works to use the latter two forms directly as the value |
3003 update @code{face} properties based on the contents of the text. | 3000 of the @code{face} property. |
3001 | |
3002 Font Lock mode (@pxref{Font Lock Mode}) works in most buffers by | |
3003 dynamically updating the @code{face} property of characters based on | |
3004 the context. | |
3004 | 3005 |
3005 @item font-lock-face | 3006 @item font-lock-face |
3006 @kindex font-lock-face @r{(text property)} | 3007 @kindex font-lock-face @r{(text property)} |
3007 The @code{font-lock-face} property is the same in all respects as the | 3008 The @code{font-lock-face} property is equivalent to the @code{face} |
3008 @code{face} property, but its state of activation is controlled by | 3009 property when Font Lock mode is enabled. When Font Lock mode is disabled, |
3009 @code{font-lock-mode}. This can be advantageous for special buffers | 3010 @code{font-lock-face} has no effect. |
3010 which are not intended to be user-editable, or for static areas of | 3011 |
3011 text which are always fontified in the same way. | 3012 The @code{font-lock-mode} property is useful for special modes that |
3012 @xref{Precalculated Fontification}. | 3013 implement their own highlighting. @xref{Precalculated Fontification}. |
3013 | |
3014 Strictly speaking, @code{font-lock-face} is not a built-in text | |
3015 property; rather, it is implemented in Font Lock mode using | |
3016 @code{char-property-alias-alist}. @xref{Examining Properties}. | |
3017 | 3014 |
3018 This property is new in Emacs 22.1. | 3015 This property is new in Emacs 22.1. |
3019 | 3016 |
3020 @item mouse-face | 3017 @item mouse-face |
3021 @kindex mouse-face @r{(text property)} | 3018 @kindex mouse-face @r{(text property)} |
3715 @end smallexample | 3712 @end smallexample |
3716 | 3713 |
3717 @defun mouse-on-link-p pos | 3714 @defun mouse-on-link-p pos |
3718 This function returns non-@code{nil} if position @var{pos} in the | 3715 This function returns non-@code{nil} if position @var{pos} in the |
3719 current buffer is on a link. @var{pos} can also be a mouse event | 3716 current buffer is on a link. @var{pos} can also be a mouse event |
3720 location, as returned by @code{event-start} (@pxref{Accessing Events}). | 3717 location, as returned by @code{event-start} (@pxref{Accessing Mouse}). |
3721 @end defun | 3718 @end defun |
3722 | 3719 |
3723 @node Fields | 3720 @node Fields |
3724 @subsection Defining and Using Fields | 3721 @subsection Defining and Using Fields |
3725 @cindex fields | 3722 @cindex fields |