Function: face-remap-set-base

face-remap-set-base is an autoloaded and byte-compiled function defined in face-remap.el.gz.

Signature

(face-remap-set-base FACE &rest SPECS)

Documentation

Set the base remapping of FACE in the current buffer to SPECS.

This causes the remappings specified by face-remap-add-relative to apply on top of the face specification given by SPECS.

The remaining arguments, SPECS, specify the base of the remapping. Each one of SPECS should be either a face name or a property list of face attribute/value pairs, like in a face text property.

If SPECS is empty or a single face eq to FACE, 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.

Probably introduced at or before Emacs version 23.1.

Source Code

;; Defined in /usr/src/emacs/lisp/face-remap.el.gz
      (force-mode-line-update))))  ; otherwise, just inherit global def

;;;###autoload
(defun face-remap-set-base (face &rest specs)
  "Set the base remapping of FACE in the current buffer to SPECS.
This causes the remappings specified by `face-remap-add-relative'
to apply on top of the face specification given by SPECS.

The remaining arguments, SPECS, specify the base of the remapping.
Each one of SPECS should be either a face name or a property list
of face attribute/value pairs, like in a `face' text property.

If SPECS is empty or a single face `eq' to FACE, 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)
	  (and (eq (car specs) face) (null (cdr specs)))) ; default
      ;; Set entry back to default
      (face-remap-reset-base face)
    ;; Set the base remapping
    (make-local-variable 'face-remapping-alist)
    (let ((entry (assq face face-remapping-alist)))
      (if entry
	  (setcar (last entry) specs)	; overwrite existing base entry
	(push (list face specs) face-remapping-alist)))
    ;; Force redisplay of this buffer.
    (force-mode-line-update)))