diff options
author | Juri Linkov <juri@jurta.org> | 2010-07-03 01:28:52 +0300 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2010-07-03 01:28:52 +0300 |
commit | c91e692bdff3f5c7e68a538f02b293d1487188b4 (patch) | |
tree | 866a987a1ac156850cfe487f1c57eb9962ecf826 /lisp/faces.el | |
parent | c532d349630038c45897e88004a8142a82e9dc85 (diff) | |
download | emacs-c91e692bdff3f5c7e68a538f02b293d1487188b4.tar.gz |
* lisp/faces.el (read-face-name): Rename arg `string-describing-default'
to `default'. Doc fix. Display the default value in quotes
in the prompt. With empty input, return the `default' arg,
unless the default value is a string (in which case return nil).
(describe-face): Replace the string `default' arg of `read-face-name'
with the symbol `default'.
http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg01109.html
Diffstat (limited to 'lisp/faces.el')
-rw-r--r-- | lisp/faces.el | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index 61476e3cd5f..83c7c8b2a0f 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -915,13 +915,14 @@ of the default face. Value is FACE." ;;; Interactively modifying faces. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defun read-face-name (prompt &optional string-describing-default multiple) +(defun read-face-name (prompt &optional default multiple) "Read a face, defaulting to the face or faces on the char after point. If it has the property `read-face-name', that overrides the `face' property. PROMPT should be a string that describes what the caller will do with the face; it should not end in a space. -STRING-DESCRIBING-DEFAULT should describe what default the caller will use if -the user just types RET; you can omit it. +The optional argument DEFAULT provides the value to display in the +minibuffer prompt that is returned if the user just types RET +unless DEFAULT is a string (in which case nil is returned). If MULTIPLE is non-nil, return a list of faces (possibly only one). Otherwise, return a single face." (let ((faceprop (or (get-char-property (point) 'read-face-name) @@ -960,10 +961,10 @@ Otherwise, return a single face." (let* ((input ;; Read the input. (completing-read-multiple - (if (or faces string-describing-default) - (format "%s (default %s): " prompt + (if (or faces default) + (format "%s (default `%s'): " prompt (if faces (mapconcat 'symbol-name faces ",") - string-describing-default)) + default)) (format "%s: " prompt)) (completion-table-in-turn nonaliasfaces aliasfaces) nil t nil 'face-name-history @@ -971,7 +972,7 @@ Otherwise, return a single face." ;; Canonicalize the output. (output (cond ((or (equal input "") (equal input '(""))) - faces) + (or faces (unless (stringp default) default))) ((stringp input) (mapcar 'intern (split-string input ", *" t))) ((listp input) @@ -1334,7 +1335,7 @@ and FRAME defaults to the selected frame. If the optional argument FRAME is given, report on face FACE in that frame. If FRAME is t, report on the defaults for face FACE (for new frames). If FRAME is omitted or nil, use the selected frame." - (interactive (list (read-face-name "Describe face" "= `default' face" t))) + (interactive (list (read-face-name "Describe face" 'default t))) (let* ((attrs '((:family . "Family") (:foundry . "Foundry") (:width . "Width") |