aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2002-04-26 22:31:57 +0000
committerRichard M. Stallman2002-04-26 22:31:57 +0000
commitcdd50deacfaa8073807a9b77a1426957d95f4ff7 (patch)
tree4e2e168017446e633f7ad811e76f9238a582a65b
parenta482f364557e64a1e864bac5edc657b4308a05b6 (diff)
downloademacs-cdd50deacfaa8073807a9b77a1426957d95f4ff7.tar.gz
emacs-cdd50deacfaa8073807a9b77a1426957d95f4ff7.zip
(customize-face): Use read-face-name and handle multiple faces.
-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."
1033 (format "*Customize Option: %s*" (custom-unlispify-tag-name symbol)))) 1033 (format "*Customize Option: %s*" (custom-unlispify-tag-name symbol))))
1034 1034
1035;;;###autoload 1035;;;###autoload
1036(defun customize-face (&optional symbol) 1036(defun customize-face (&optional face)
1037 "Customize SYMBOL, which should be a face name or nil. 1037 "Customize SYMBOL, which should be a face name or nil.
1038If SYMBOL is nil, customize all faces. 1038If SYMBOL is nil, customize all faces.
1039 1039
1040Interactively, when point is on text which has a face specified, 1040Interactively, when point is on text which has a face specified,
1041suggest to customized that face, if it's customizable." 1041suggest to customized that face, if it's customizable."
1042 (interactive 1042 (interactive
1043 (list 1043 (list (read-face-name "Customize face" "all faces" t)))
1044 (let ((face (get-char-property (point) 'face))) 1044 (if (member face '(nil ""))
1045 (if (and face (symbolp face)) 1045 (setq face (face-list)))
1046 (completing-read (format "Customize face (default `%s'): " face) 1046 (if (and (listp face) (null (cdr face)))
1047 obarray 'custom-facep t nil nil (symbol-name face)) 1047 (setq face (car face)))
1048 (completing-read "Customize face (default all): " 1048 (if (listp face)
1049 obarray 'custom-facep t)))))
1050 (if (or (null symbol) (and (stringp symbol) (zerop (length symbol))))
1051 (custom-buffer-create (custom-sort-items 1049 (custom-buffer-create (custom-sort-items
1052 (mapcar (lambda (symbol) 1050 (mapcar (lambda (s)
1053 (list symbol 'custom-face)) 1051 (list s 'custom-face))
1054 (face-list)) 1052 face)
1055 t nil) 1053 t nil)
1056 "*Customize Faces*") 1054 "*Customize Faces*")
1057 (when (stringp symbol) 1055 (unless (facep face)
1058 (setq symbol (intern symbol))) 1056 (error "Invalid face %S"))
1059 (unless (symbolp symbol) 1057 (custom-buffer-create (list (list face 'custom-face))
1060 (error "Should be a symbol %S" symbol))
1061 (custom-buffer-create (list (list symbol 'custom-face))
1062 (format "*Customize Face: %s*" 1058 (format "*Customize Face: %s*"
1063 (custom-unlispify-tag-name symbol))))) 1059 (custom-unlispify-tag-name face)))))
1064 1060
1065;;;###autoload 1061;;;###autoload
1066(defun customize-face-other-window (&optional symbol) 1062(defun customize-face-other-window (&optional symbol)