Function: buffer-face-toggle

buffer-face-toggle is an autoloaded, interactive and byte-compiled function defined in face-remap.el.gz.

Signature

(buffer-face-toggle &rest SPECS)

Documentation

Toggle buffer-face-mode(var)/buffer-face-mode(fun), using face specs SPECS.

Each argument in SPECS should be a face, i.e. either a face name or a property list of face attributes and values. If more than one face is listed, that specifies an aggregate face, like in a face text property.

If buffer-face-mode(var)/buffer-face-mode(fun) is already enabled, and is currently using the face specs SPECS, then it is disabled; if buffer-face-mode(var)/buffer-face-mode(fun) is disabled, or is enabled and currently displaying some other face, then is left enabled, but the face changed to reflect SPECS.

This function will make the variable buffer-face-mode-face buffer local, and set it to SPECS.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/face-remap.el.gz
;;;###autoload
(defun buffer-face-toggle (&rest specs)
  "Toggle `buffer-face-mode', using face specs SPECS.
Each argument in SPECS should be a face, i.e. either a face name
or a property list of face attributes and values.  If more than
one face is listed, that specifies an aggregate face, like in a
`face' text property.

If `buffer-face-mode' is already enabled, and is currently using
the face specs SPECS, then it is disabled; if `buffer-face-mode'
is disabled, or is enabled and currently displaying some other
face, then is left enabled, but the face changed to reflect SPECS.

This function will make the variable `buffer-face-mode-face'
buffer local, and set it to SPECS."
  (interactive (list buffer-face-mode-face))
  (while (and (consp specs) (null (cdr specs)))
    (setq specs (car specs)))
  (if (or (null specs)
	  (and buffer-face-mode (equal buffer-face-mode-face specs)))
      (buffer-face-mode 0)
    (setq-local buffer-face-mode-face specs)
    (buffer-face-mode t)))