summaryrefslogtreecommitdiff
path: root/lisp/cus-edit.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2002-04-26 22:31:57 +0000
committerRichard M. Stallman <rms@gnu.org>2002-04-26 22:31:57 +0000
commitcdd50deacfaa8073807a9b77a1426957d95f4ff7 (patch)
tree4e2e168017446e633f7ad811e76f9238a582a65b /lisp/cus-edit.el
parenta482f364557e64a1e864bac5edc657b4308a05b6 (diff)
downloademacs-cdd50deacfaa8073807a9b77a1426957d95f4ff7.tar.gz
(customize-face): Use read-face-name and handle multiple faces.
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r--lisp/cus-edit.el32
1 files changed, 14 insertions, 18 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 58aa5f825fe..bbc3f2b8ad2 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -1033,34 +1033,30 @@ Show the buffer in another window, but don't select it."
(format "*Customize Option: %s*" (custom-unlispify-tag-name symbol))))
;;;###autoload
-(defun customize-face (&optional symbol)
+(defun customize-face (&optional face)
"Customize SYMBOL, which should be a face name or nil.
If SYMBOL is nil, customize all faces.
Interactively, when point is on text which has a face specified,
suggest to customized that face, if it's customizable."
(interactive
- (list
- (let ((face (get-char-property (point) 'face)))
- (if (and face (symbolp face))
- (completing-read (format "Customize face (default `%s'): " face)
- obarray 'custom-facep t nil nil (symbol-name face))
- (completing-read "Customize face (default all): "
- obarray 'custom-facep t)))))
- (if (or (null symbol) (and (stringp symbol) (zerop (length symbol))))
+ (list (read-face-name "Customize face" "all faces" t)))
+ (if (member face '(nil ""))
+ (setq face (face-list)))
+ (if (and (listp face) (null (cdr face)))
+ (setq face (car face)))
+ (if (listp face)
(custom-buffer-create (custom-sort-items
- (mapcar (lambda (symbol)
- (list symbol 'custom-face))
- (face-list))
+ (mapcar (lambda (s)
+ (list s 'custom-face))
+ face)
t nil)
"*Customize Faces*")
- (when (stringp symbol)
- (setq symbol (intern symbol)))
- (unless (symbolp symbol)
- (error "Should be a symbol %S" symbol))
- (custom-buffer-create (list (list symbol 'custom-face))
+ (unless (facep face)
+ (error "Invalid face %S"))
+ (custom-buffer-create (list (list face 'custom-face))
(format "*Customize Face: %s*"
- (custom-unlispify-tag-name symbol)))))
+ (custom-unlispify-tag-name face)))))
;;;###autoload
(defun customize-face-other-window (&optional symbol)