aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2003-08-13 17:23:22 +0000
committerRichard M. Stallman2003-08-13 17:23:22 +0000
commitbda7c6ddc538ee30d3b4276f634ddebb43138207 (patch)
tree671df83c59421d16f012f5a9b55a5fe97ab196c9
parent229644e7b176d89d4f1069d0821daa8ac798c6ac (diff)
downloademacs-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.texi51
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
1610It is normally @code{nil}, so that ordinary buffers have no header line. 1611It 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
1618the text that would appear in a mode line or header line
1619based on certain mode line specification.
1620
1621@defun format-mode-line &optional format window no-props
1622This function formats a line of text according to @var{format} as if
1623it were generating the mode line for @var{window}, but instead of
1624displaying the text in the mode line or the header line, it returns
1625the text as a string.
1626
1627If @var{format} is @code{nil}, that means to use
1628@code{mode-line-format} and return the text that would appear in the
1629mode 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
1631in the header line (@code{""} if the window has no header line).
1632The argument @var{window} defaults to the selected window.
1633
1634The value string normally has text properties that correspond to the
1635faces, 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
1970subelement, @var{facename}, specifies the face, as described above. 1996subelement, @var{facename}, specifies the face, as described above.
1971 1997
1972The last two values in @var{highlighter}, @var{override} and 1998The 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
1974can override existing fontification made by previous elements of 2000element can override existing fontification made by previous elements
1975@code{font-lock-keywords}. If it is @code{keep}, then each character is 2001of @code{font-lock-keywords}. If it is @code{keep}, then each
1976fontified if it has not been fontified already by some other element. 2002character is fontified if it has not been fontified already by some
1977If it is @code{prepend}, the face @var{facename} is added to the 2003other element. If it is @code{prepend}, the face @var{facename} is
1978beginning of the @code{face} property. If it is @code{append}, the face 2004added 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. 2005is @code{append}, the face @var{facename} is added to the end of the
2006@code{font-lock-face} property.
1980 2007
1981If @var{laxmatch} is non-@code{nil}, it means there should be no error 2008If @var{laxmatch} is non-@code{nil}, it means there should be no error
1982if there is no subexpression numbered @var{subexp} in @var{matcher}. 2009if 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
2135Additional properties (other than @code{face}) that are being managed 2162Additional properties (other than @code{font-lock-face}) that are
2136by Font Lock mode. Font Lock mode normally manages only the @code{face} 2163being managed by Font Lock mode. Font Lock mode normally manages only
2137property; if you want it to manage others as well, you must specify 2164the @code{font-lock-face} property; if you want it to manage others as
2138them in a @var{facename} in @code{font-lock-keywords} as well as adding 2165well, you must specify them in a @var{facename} in
2139them 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