Function: facemenu-set-face

facemenu-set-face is an interactive and byte-compiled function defined in facemenu.el.gz.

Signature

(facemenu-set-face FACE &optional START END)

Documentation

Apply FACE to the region or next character typed.

If the region is active (normally true except in Transient Mark mode) and nonempty, and there is no prefix argument, this command applies FACE to the region. Otherwise, it applies FACE to the faces to use for the next character inserted. (Moving point or switching buffers before typing a character to insert cancels the specification.)

If FACE is default, to "apply" it means clearing the list of faces to be used. For any other value of FACE, to "apply" it means putting FACE at the front of the list of faces to be used, and removing any faces further along in the list that would be completely overridden by preceding faces (including FACE).

This command can also add FACE to the menu of faces, if facemenu-listed-faces says to do that.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/facemenu.el.gz
(defun facemenu-set-face (face &optional start end)
  "Apply FACE to the region or next character typed.

If the region is active (normally true except in Transient
Mark mode) and nonempty, and there is no prefix argument,
this command applies FACE to the region.  Otherwise, it applies FACE
to the faces to use for the next character
inserted.  (Moving point or switching buffers before typing
a character to insert cancels the specification.)

If FACE is `default', to \"apply\" it means clearing
the list of faces to be used.  For any other value of FACE,
to \"apply\" it means putting FACE at the front of the list
of faces to be used, and removing any faces further
along in the list that would be completely overridden by
preceding faces (including FACE).

This command can also add FACE to the menu of faces,
if `facemenu-listed-faces' says to do that."
  (interactive (list (progn
		       (barf-if-buffer-read-only)
		       (read-face-name "Use face" (face-at-point t)))
		     (if (and mark-active (not current-prefix-arg))
			 (region-beginning))
		     (if (and mark-active (not current-prefix-arg))
			 (region-end))))
  (facemenu-add-new-face face)
  (facemenu-add-face face start end))