# HG changeset patch # User Richard M. Stallman # Date 1019860317 0 # Node ID 01a5b217fd7fdf29969d3823b5b0879d34d1ff0a # Parent fe167023fdf0d5604b63fb1fcf57b1ade3121d1d (customize-face): Use read-face-name and handle multiple faces. diff -r fe167023fdf0 -r 01a5b217fd7f lisp/cus-edit.el --- a/lisp/cus-edit.el Fri Apr 26 22:31:16 2002 +0000 +++ b/lisp/cus-edit.el Fri Apr 26 22:31:57 2002 +0000 @@ -1033,34 +1033,30 @@ (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)