diff options
author | Gerd Moellmann <gerd@gnu.org> | 2002-04-25 14:21:47 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2002-04-25 14:21:47 +0000 |
commit | d29a536ab9e253f4b02282ac7356422bc6201ac0 (patch) | |
tree | 62005119bfbc52dcc54a76a0f9d52fba076cffc8 /lisp/cus-edit.el | |
parent | 6f4426332dab4a0bd2c587d4877db45817062b9f (diff) | |
download | emacs-d29a536ab9e253f4b02282ac7356422bc6201ac0.tar.gz |
(customize-face-other-window, customize-face):
Interactively, when point is on text with a face, suggest to
customize that face.
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r-- | lisp/cus-edit.el | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index c1b69d5f006..797d0d5b04c 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1035,9 +1035,16 @@ Show the buffer in another window, but don't select it." ;;;###autoload (defun customize-face (&optional symbol) "Customize SYMBOL, which should be a face name or nil. -If SYMBOL is nil, customize all faces." - (interactive (list (completing-read "Customize face: (default all) " - obarray 'custom-facep t))) +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 (completing-read "Customize face (default all): " + obarray 'custom-facep t + (let ((face (get-char-property (point) 'face))) + (when (and face (symbolp face)) + (symbol-name face)))))) (if (or (null symbol) (and (stringp symbol) (zerop (length symbol)))) (custom-buffer-create (custom-sort-items (mapcar (lambda (symbol) @@ -1055,9 +1062,16 @@ If SYMBOL is nil, customize all faces." ;;;###autoload (defun customize-face-other-window (&optional symbol) - "Show customization buffer for face SYMBOL in other window." - (interactive (list (completing-read "Customize face: " - obarray 'custom-facep t))) + "Show customization buffer for face SYMBOL in other window. + +Interactively, when point is on text which has a face specified, +suggest to customized that face, if it's customizable." + (interactive + (list (completing-read "Customize face: " + obarray 'custom-facep t + (let ((face (get-char-property (point) 'face))) + (when (and face (symbolp face)) + (symbol-name face)))))) (if (or (null symbol) (and (stringp symbol) (zerop (length symbol)))) () (if (stringp symbol) |