summaryrefslogtreecommitdiff
path: root/lisp/face-remap.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2012-03-21 15:02:13 +0800
committerChong Yidong <cyd@gnu.org>2012-03-21 15:02:13 +0800
commitfb5b8aca9928223c3fef042f1de4b50cd08fde43 (patch)
treeb1da6f261d64e95a4bbdf0566157c3919185adb2 /lisp/face-remap.el
parentdc9924b8bd30e0f3f43b552070f6cac5c11942f7 (diff)
downloademacs-fb5b8aca9928223c3fef042f1de4b50cd08fde43.tar.gz
Updates to Display chapter of Lisp manual.
* doc/lispref/display.texi (The Echo Area): Add xref to Output Streams. (Displaying Messages): Improve doc of message. (Echo Area Customization, Invisible Text): Copyedits. (Invisible Text): Mention that spec comparison is done with eq. (Width): Improve doc of char-width. (Faces): Recommend using symbol instead of string for face name. Minor clarifications. (Defining Faces): Copyedits. Update face example. (Attribute Functions): Mark set-face-foreground etc as commands. (Face Remapping): Mention text-scale-adjust. Clarify face-remapping-alist and related docs. (Face Functions): Don't document make-face or copy-face. * lisp/faces.el (make-face, make-empty-face, copy-face): * lisp/face-remap.el (face-remap-add-relative, face-remap-set-base): Doc fixes. * src/xfaces.c (Vface_remapping_alist): Doc fix.
Diffstat (limited to 'lisp/face-remap.el')
-rw-r--r--lisp/face-remap.el42
1 files changed, 24 insertions, 18 deletions
diff --git a/lisp/face-remap.el b/lisp/face-remap.el
index 3af9e31a6f7..ca7a28328f9 100644
--- a/lisp/face-remap.el
+++ b/lisp/face-remap.el
@@ -106,21 +106,20 @@ The list structure of ENTRY may be destructively modified."
;;;###autoload
(defun face-remap-add-relative (face &rest specs)
"Add a face remapping entry of FACE to SPECS in the current buffer.
-
-Return a cookie which can be used to delete the remapping with
+Return a cookie which can be used to delete this remapping with
`face-remap-remove-relative'.
-SPECS can be any value suitable for the `face' text property,
-including a face name, a list of face names, or a face-attribute
-property list. The attributes given by SPECS will be merged with
-any other currently active face remappings of FACE, and with the
-global definition of FACE. An attempt is made to sort multiple
-entries so that entries with relative face-attributes are applied
-after entries with absolute face-attributes.
-
-The base (lowest priority) remapping may be set to a specific
-value, instead of the default of the global face definition,
-using `face-remap-set-base'."
+The remaining arguments, SPECS, should be either a list of face
+names, or a property list of face attribute/value pairs. The
+remapping specified by SPECS takes effect alongside the
+remappings from other calls to `face-remap-add-relative', as well
+as the normal definition of FACE (at lowest priority). This
+function tries to sort multiple remappings for the same face, so
+that remappings specifying relative face attributes are applied
+after remappings specifying absolute face attributes.
+
+The base (lowest priority) remapping may be set to something
+other than the normal definition of FACE via `face-remap-set-base'."
(while (and (consp specs) (null (cdr specs)))
(setq specs (car specs)))
(make-local-variable 'face-remapping-alist)
@@ -148,7 +147,9 @@ COOKIE should be the return value from that function."
;;;###autoload
(defun face-remap-reset-base (face)
- "Set the base remapping of FACE to inherit from FACE's global definition."
+ "Set the base remapping of FACE to the normal definition of FACE.
+This causes the remappings specified by `face-remap-add-relative'
+to apply on top of the normal definition of FACE."
(let ((entry (assq face face-remapping-alist)))
(when entry
;; If there's nothing except a base remapping, we simply remove
@@ -163,10 +164,15 @@ COOKIE should be the return value from that function."
;;;###autoload
(defun face-remap-set-base (face &rest specs)
"Set the base remapping of FACE in the current buffer to SPECS.
-If SPECS is empty, the default base remapping is restored, which
-inherits from the global definition of FACE; note that this is
-different from SPECS containing a single value `nil', which does
-not inherit from the global definition of FACE."
+This causes the remappings specified by `face-remap-add-relative'
+to apply on top of the face specification given by SPECS. SPECS
+should be either a list of face names, or a property list of face
+attribute/value pairs.
+
+If SPECS is empty, call `face-remap-reset-base' to use the normal
+definition of FACE as the base remapping; note that this is
+different from SPECS containing a single value `nil', which means
+not to inherit from the global definition of FACE at all."
(while (and (consp specs) (not (null (car specs))) (null (cdr specs)))
(setq specs (car specs)))
(if (or (null specs)