Function: face-read-string

face-read-string is a byte-compiled function defined in faces.el.gz.

Signature

(face-read-string FACE DEFAULT NAME &optional COMPLETION-ALIST)

Documentation

Interactively read a face attribute string value.

FACE is the face whose attribute is read. If non-nil, DEFAULT is the default string to return if no new value is entered. NAME is a descriptive name of the attribute for prompting. COMPLETION-ALIST is an alist of valid values, if non-nil.

Entering nothing accepts the default string DEFAULT. Value is the new attribute value.

Source Code

;; Defined in /usr/src/emacs/lisp/faces.el.gz
(defun face-read-string (face default name &optional completion-alist)
  "Interactively read a face attribute string value.
FACE is the face whose attribute is read.  If non-nil, DEFAULT is the
default string to return if no new value is entered.  NAME is a
descriptive name of the attribute for prompting.  COMPLETION-ALIST is an
alist of valid values, if non-nil.

Entering nothing accepts the default string DEFAULT.
Value is the new attribute value."
  ;; Capitalize NAME (we don't use `capitalize' because that capitalizes
  ;; each word in a string separately).
  (setq name (concat (upcase (substring name 0 1)) (substring name 1)))
  (let* ((completion-ignore-case t)
	 (value (completing-read
                 (format-prompt "%s for face `%s'" default name face)
		 completion-alist nil nil nil nil default)))
    (if (equal value "") default value)))