diff options
| author | Miles Bader | 2008-06-01 05:04:24 +0000 |
|---|---|---|
| committer | Miles Bader | 2008-06-01 05:04:24 +0000 |
| commit | f2cec7a9907796d97bbe4f99ce00d1866b773dfb (patch) | |
| tree | 24b0e99f39a2da47cc60d4f8c3848c01f7f0bf99 /doc | |
| parent | 70583cb56977d91d94bff77cb2fb93922c44876c (diff) | |
| download | emacs-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/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 55 |
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 @@ | |||
| 1 | 2008-06-01 Miles Bader <miles@gnu.org> | ||
| 2 | |||
| 3 | * display.texi (Displaying Faces): Add face-remapping-alist. | ||
| 4 | |||
| 1 | 2008-05-30 Stefan Monnier <monnier@iro.umontreal.ca> | 5 | 2008-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 |
| 2366 | priority overrides those with lower priority. @xref{Overlays}. | 2366 | priority 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 | ||
| 2370 | appearance of a face, for instance making the @code{default} face a | ||
| 2371 | variable-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 | ||
| 2375 | text using the face @var{face} using @var{remapping...} instead of | ||
| 2376 | @var{face}'s global definition. @var{remapping...} may be any face | ||
| 2377 | specification suitable for a @code{face} text property, usually a face | ||
| 2378 | name, 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 | |||
| 2384 | Two points bear emphasizing: | ||
| 2385 | |||
| 2386 | @enumerate | ||
| 2387 | @item | ||
| 2388 | The new definition @var{remapping...} is the complete | ||
| 2389 | specification of how to display @var{face}---it entirely replaces, | ||
| 2390 | rather than augmenting or modifying, the normal definition of that | ||
| 2391 | face. | ||
| 2392 | |||
| 2393 | @item | ||
| 2394 | If @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 | ||
| 2398 | definition of @var{face} instead of the ``remapped'' definition. | ||
| 2399 | |||
| 2400 | For instance, if the @code{mode-line} face is remapped using this | ||
| 2401 | entry in @code{face-remapping-alist}: | ||
| 2402 | @example | ||
| 2403 | (mode-line italic mode-line) | ||
| 2404 | @end example | ||
| 2405 | @noindent | ||
| 2406 | then 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 | ||
| 2412 | buffer's @code{default} face; for example, the following changes a | ||
| 2413 | buffer's @code{default} face to use the @code{variable-pitch} face, | ||
| 2414 | with 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 | ||