diff options
| author | Chong Yidong | 2013-01-09 17:43:38 +0800 |
|---|---|---|
| committer | Chong Yidong | 2013-01-09 17:43:38 +0800 |
| commit | 5b64ccd7a261f617e70c391394e30c6cbc5f9f41 (patch) | |
| tree | e98fde4847980102107effdfd49baa11780cc8ea | |
| parent | ebb965fcf860516c7ec8de351cda8d18811283c1 (diff) | |
| download | emacs-5b64ccd7a261f617e70c391394e30c6cbc5f9f41.tar.gz emacs-5b64ccd7a261f617e70c391394e30c6cbc5f9f41.zip | |
* faces.el (read-face-name): Doc fix.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/faces.el | 35 |
2 files changed, 22 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a35b537bdb1..2df7452d5b4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-01-09 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * faces.el (read-face-name): Doc fix. | ||
| 4 | |||
| 1 | 2013-01-09 Glenn Morris <rgm@gnu.org> | 5 | 2013-01-09 Glenn Morris <rgm@gnu.org> |
| 2 | 6 | ||
| 3 | * emacs-lisp/trace.el (trace-function, trace-function-background): | 7 | * emacs-lisp/trace.el (trace-function, trace-function-background): |
diff --git a/lisp/faces.el b/lisp/faces.el index 4b89335f4cc..7843aef8d71 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -926,27 +926,28 @@ of the default face. Value is FACE." | |||
| 926 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 926 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 927 | 927 | ||
| 928 | (defun read-face-name (prompt &optional default multiple) | 928 | (defun read-face-name (prompt &optional default multiple) |
| 929 | "Read a face, defaulting to the face or faces at point. | 929 | "Read one or more face names, defaulting to the face(s) at point. |
| 930 | If the text at point has the property `read-face-name', that | 930 | PROMPT should be a prompt string; it should not end in a space. |
| 931 | overrides the `face' property for determining the default. | ||
| 932 | 931 | ||
| 933 | PROMPT should be a string that describes what the caller will do | 932 | The optional argument DEFAULT specifies the default face name(s) |
| 934 | with the face; it should not end in a space. | 933 | to return if the user just types RET. If its value is non-nil, |
| 934 | it should be a list of face names (symbols); in that case, the | ||
| 935 | default return value is the `car' of DEFAULT (if the argument | ||
| 936 | MULTIPLE is non-nil), or DEFAULT (if MULTIPLE is nil). See below | ||
| 937 | for the meaning of MULTIPLE. | ||
| 935 | 938 | ||
| 939 | If DEFAULT is nil, the list of default face names is taken from | ||
| 940 | the `read-face-name' property of the text at point, or, if that | ||
| 941 | is nil, from the `face' property of the text at point. | ||
| 936 | 942 | ||
| 937 | This function uses `completing-read-multiple' with \",\" as the | 943 | This function uses `completing-read-multiple' with \",\" as the |
| 938 | separator character, i.e. | 944 | separator character. Thus, the user may enter multiple face |
| 939 | 945 | names, separated by commas. The optional argument MULTIPLE | |
| 940 | 946 | specifies the form of the return value. If MULTIPLE is non-nil, | |
| 941 | 947 | return a list of face names; if the user entered just one face | |
| 942 | 948 | name, the return value would be a list of one face name. | |
| 943 | 949 | Otherwise, return a single face name; if the user entered more | |
| 944 | The optional argument DEFAULT provides the value to display in the | 950 | than one face name, return only the first one." |
| 945 | minibuffer prompt that is returned if the user just types RET | ||
| 946 | unless DEFAULT is a string (in which case nil is returned). | ||
| 947 | |||
| 948 | If MULTIPLE is non-nil, return a list of faces (possibly only one). | ||
| 949 | Otherwise, return a single face." | ||
| 950 | (let ((faceprop (or (get-char-property (point) 'read-face-name) | 951 | (let ((faceprop (or (get-char-property (point) 'read-face-name) |
| 951 | (get-char-property (point) 'face))) | 952 | (get-char-property (point) 'face))) |
| 952 | (aliasfaces nil) | 953 | (aliasfaces nil) |