aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMiles Bader2008-06-01 05:04:24 +0000
committerMiles Bader2008-06-01 05:04:24 +0000
commitf2cec7a9907796d97bbe4f99ce00d1866b773dfb (patch)
tree24b0e99f39a2da47cc60d4f8c3848c01f7f0bf99 /doc
parent70583cb56977d91d94bff77cb2fb93922c44876c (diff)
downloademacs-f2cec7a9907796d97bbe4f99ce00d1866b773dfb.tar.gz
emacs-f2cec7a9907796d97bbe4f99ce00d1866b773dfb.zip
Implement face-remapping-alist feature
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1195
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/ChangeLog4
-rw-r--r--doc/lispref/display.texi55
2 files changed, 59 insertions, 0 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 36aa760ee4c..943504fce04 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,7 @@
12008-06-01 Miles Bader <miles@gnu.org>
2
3 * display.texi (Displaying Faces): Add face-remapping-alist.
4
12008-05-30 Stefan Monnier <monnier@iro.umontreal.ca> 52008-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
2 6
3 * tips.texi (Coding Conventions): Do not encourage the use of "-flag" 7 * tips.texi (Coding Conventions): Do not encourage the use of "-flag"
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 1f9cfdbd72a..bc57cfea26d 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -2365,6 +2365,61 @@ line or a header line), and last the @code{default} face.
2365 When multiple overlays cover one character, an overlay with higher 2365 When multiple overlays cover one character, an overlay with higher
2366priority overrides those with lower priority. @xref{Overlays}. 2366priority overrides those with lower priority. @xref{Overlays}.
2367 2367
2368@defvar face-remapping-alist
2369 This variable is used for buffer-local or global changes in the
2370appearance of a face, for instance making the @code{default} face a
2371variable-pitch face in a particular buffer.
2372
2373 Its value should be an alist, whose elements have the form
2374@code{(@var{face} @var{remapping...})}. This causes Emacs to display
2375text using the face @var{face} using @var{remapping...} instead of
2376@var{face}'s global definition. @var{remapping...} may be any face
2377specification suitable for a @code{face} text property, usually a face
2378name, but also perhaps a property list of face attribute/value pairs.
2379@xref{Special Properties}.
2380
2381 To affect display only in a single buffer,
2382@code{face-remapping-alist} should be made buffer-local.
2383
2384Two points bear emphasizing:
2385
2386@enumerate
2387@item
2388The new definition @var{remapping...} is the complete
2389specification of how to display @var{face}---it entirely replaces,
2390rather than augmenting or modifying, the normal definition of that
2391face.
2392
2393@item
2394If @var{remapping...} recursively references the same face name
2395@var{face}, either directly remapping entry, or via the
2396@code{:inherit} attribute of some other face in
2397@var{remapping...}, then that reference uses normal frame-wide
2398definition of @var{face} instead of the ``remapped'' definition.
2399
2400For instance, if the @code{mode-line} face is remapped using this
2401entry in @code{face-remapping-alist}:
2402@example
2403(mode-line italic mode-line)
2404@end example
2405@noindent
2406then the new definition of the @code{mode-line} face inherits from the
2407@code{italic} face, and the @emph{normal} (non-remapped) definition of
2408@code{mode-line} face.
2409@end enumerate
2410
2411 A typical use of the @code{face-remapping-alist} is to change a
2412buffer's @code{default} face; for example, the following changes a
2413buffer's @code{default} face to use the @code{variable-pitch} face,
2414with the height doubled:
2415
2416@example
2417(set (make-local-variable 'face-remapping-alist)
2418 '((default variable-pitch :height 2.0)))
2419@end example
2420
2421@end defvar
2422
2368@node Font Selection 2423@node Font Selection
2369@subsection Font Selection 2424@subsection Font Selection
2370 2425