diff options
| author | Richard M. Stallman | 2003-08-13 17:23:22 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2003-08-13 17:23:22 +0000 |
| commit | bda7c6ddc538ee30d3b4276f634ddebb43138207 (patch) | |
| tree | 671df83c59421d16f012f5a9b55a5fe97ab196c9 | |
| parent | 229644e7b176d89d4f1069d0821daa8ac798c6ac (diff) | |
| download | emacs-bda7c6ddc538ee30d3b4276f634ddebb43138207.tar.gz emacs-bda7c6ddc538ee30d3b4276f634ddebb43138207.zip | |
(Emulating Mode Line): New node.
(Search-based Fontification): Font Lock uses font-lock-face property.
(Other Font Lock Variables): Likewise.
| -rw-r--r-- | lispref/modes.texi | 51 |
1 files changed, 39 insertions, 12 deletions
diff --git a/lispref/modes.texi b/lispref/modes.texi index 25f44b92e09..5c895747a94 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi | |||
| @@ -1161,6 +1161,7 @@ actually appears. | |||
| 1161 | * %-Constructs:: Putting information into a mode line. | 1161 | * %-Constructs:: Putting information into a mode line. |
| 1162 | * Properties in Mode:: Using text properties in the mode line. | 1162 | * Properties in Mode:: Using text properties in the mode line. |
| 1163 | * Header Lines:: Like a mode line, but at the top. | 1163 | * Header Lines:: Like a mode line, but at the top. |
| 1164 | * Emulating Mode Line:: Formating text as the mode line would. | ||
| 1164 | @end menu | 1165 | @end menu |
| 1165 | 1166 | ||
| 1166 | @node Mode Line Data | 1167 | @node Mode Line Data |
| @@ -1610,6 +1611,31 @@ that do not override it. This is the same as @code{(default-value | |||
| 1610 | It is normally @code{nil}, so that ordinary buffers have no header line. | 1611 | It is normally @code{nil}, so that ordinary buffers have no header line. |
| 1611 | @end defvar | 1612 | @end defvar |
| 1612 | 1613 | ||
| 1614 | @node Emulating Mode Line | ||
| 1615 | @section Emulating Mode Line Formating | ||
| 1616 | |||
| 1617 | You can use the function @code{format-mode-line} to compute | ||
| 1618 | the text that would appear in a mode line or header line | ||
| 1619 | based on certain mode line specification. | ||
| 1620 | |||
| 1621 | @defun format-mode-line &optional format window no-props | ||
| 1622 | This function formats a line of text according to @var{format} as if | ||
| 1623 | it were generating the mode line for @var{window}, but instead of | ||
| 1624 | displaying the text in the mode line or the header line, it returns | ||
| 1625 | the text as a string. | ||
| 1626 | |||
| 1627 | If @var{format} is @code{nil}, that means to use | ||
| 1628 | @code{mode-line-format} and return the text that would appear in the | ||
| 1629 | mode line. If @var{format} is @code{t}, that means to use | ||
| 1630 | @code{header-line-format} so as to return the text that would appear | ||
| 1631 | in the header line (@code{""} if the window has no header line). | ||
| 1632 | The argument @var{window} defaults to the selected window. | ||
| 1633 | |||
| 1634 | The value string normally has text properties that correspond to the | ||
| 1635 | faces, keymaps, etc., that the mode line would have. If | ||
| 1636 | @var{no-props} is non-@code{nil}, the value has no text properties. | ||
| 1637 | @end defun | ||
| 1638 | |||
| 1613 | @node Imenu | 1639 | @node Imenu |
| 1614 | @section Imenu | 1640 | @section Imenu |
| 1615 | 1641 | ||
| @@ -1970,13 +1996,14 @@ of the match to fontify (0 means the entire matching text). The second | |||
| 1970 | subelement, @var{facename}, specifies the face, as described above. | 1996 | subelement, @var{facename}, specifies the face, as described above. |
| 1971 | 1997 | ||
| 1972 | The last two values in @var{highlighter}, @var{override} and | 1998 | The last two values in @var{highlighter}, @var{override} and |
| 1973 | @var{laxmatch}, are flags. If @var{override} is @code{t}, this element | 1999 | @var{laxmatch}, are flags. If @var{override} is @code{t}, this |
| 1974 | can override existing fontification made by previous elements of | 2000 | element can override existing fontification made by previous elements |
| 1975 | @code{font-lock-keywords}. If it is @code{keep}, then each character is | 2001 | of @code{font-lock-keywords}. If it is @code{keep}, then each |
| 1976 | fontified if it has not been fontified already by some other element. | 2002 | character is fontified if it has not been fontified already by some |
| 1977 | If it is @code{prepend}, the face @var{facename} is added to the | 2003 | other element. If it is @code{prepend}, the face @var{facename} is |
| 1978 | beginning of the @code{face} property. If it is @code{append}, the face | 2004 | added to the beginning of the @code{font-lock-face} property. If it |
| 1979 | @var{facename} is added to the end of the @code{face} property. | 2005 | is @code{append}, the face @var{facename} is added to the end of the |
| 2006 | @code{font-lock-face} property. | ||
| 1980 | 2007 | ||
| 1981 | If @var{laxmatch} is non-@code{nil}, it means there should be no error | 2008 | If @var{laxmatch} is non-@code{nil}, it means there should be no error |
| 1982 | if there is no subexpression numbered @var{subexp} in @var{matcher}. | 2009 | if there is no subexpression numbered @var{subexp} in @var{matcher}. |
| @@ -2132,11 +2159,11 @@ textual modes. | |||
| 2132 | @end defvar | 2159 | @end defvar |
| 2133 | 2160 | ||
| 2134 | @defvar font-lock-extra-managed-props | 2161 | @defvar font-lock-extra-managed-props |
| 2135 | Additional properties (other than @code{face}) that are being managed | 2162 | Additional properties (other than @code{font-lock-face}) that are |
| 2136 | by Font Lock mode. Font Lock mode normally manages only the @code{face} | 2163 | being managed by Font Lock mode. Font Lock mode normally manages only |
| 2137 | property; if you want it to manage others as well, you must specify | 2164 | the @code{font-lock-face} property; if you want it to manage others as |
| 2138 | them in a @var{facename} in @code{font-lock-keywords} as well as adding | 2165 | well, you must specify them in a @var{facename} in |
| 2139 | them to this list. | 2166 | @code{font-lock-keywords} as well as adding them to this list. |
| 2140 | @end defvar | 2167 | @end defvar |
| 2141 | 2168 | ||
| 2142 | @node Levels of Font Lock | 2169 | @node Levels of Font Lock |