summaryrefslogtreecommitdiff
path: root/lisp/faces.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2005-06-13 20:47:08 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2005-06-13 20:47:08 +0000
commite3b5b35b9a9247979d6147f5cac56208cd626cc6 (patch)
treed19f717b0c45ccbee7218ffd8ae27a6aae169579 /lisp/faces.el
parent9ed49065194cae011a97dfa49b08e3b60eb241d7 (diff)
downloademacs-e3b5b35b9a9247979d6147f5cac56208cd626cc6.tar.gz
(read-face-name): Use complete-in-turn complete non-aliases
in preference to face aliases.
Diffstat (limited to 'lisp/faces.el')
-rw-r--r--lisp/faces.el15
1 files changed, 12 insertions, 3 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index 866f739a13d..fcac684b3a1 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1,6 +1,6 @@
;;; faces.el --- Lisp faces
-;; Copyright (C) 1992,1993,1994,1995,1996,1998,1999,2000,2001,2002,2004
+;; Copyright (C) 1992,1993,1994,1995,1996,1998,1999,2000,2001,2002,2004,2005
;; Free Software Foundation, Inc.
;; Maintainer: FSF
@@ -854,6 +854,8 @@ If MULTIPLE is non-nil, return a list of faces (possibly only one).
Otherwise, return a single face."
(let ((faceprop (or (get-char-property (point) 'read-face-name)
(get-char-property (point) 'face)))
+ (aliasfaces nil)
+ (nonaliasfaces nil)
faces)
;; Make a list of the named faces that the `face' property uses.
(if (and (listp faceprop)
@@ -870,6 +872,13 @@ Otherwise, return a single face."
(memq (intern-soft (thing-at-point 'symbol)) (face-list)))
(setq faces (list (intern-soft (thing-at-point 'symbol)))))
+ ;; Build up the completion tables.
+ (mapatoms (lambda (s)
+ (if (custom-facep s)
+ (if (get s 'face-alias)
+ (push (symbol-name s) aliasfaces)
+ (push (symbol-name s) nonaliasfaces)))))
+
;; If we only want one, and the default is more than one,
;; discard the unwanted ones now.
(unless multiple
@@ -883,7 +892,7 @@ Otherwise, return a single face."
(if faces (mapconcat 'symbol-name faces ", ")
string-describing-default))
(format "%s: " prompt))
- obarray 'custom-facep t))
+ (complete-in-turn nonaliasfaces aliasfaces) nil t))
;; Canonicalize the output.
(output
(if (equal input "")
@@ -2289,5 +2298,5 @@ If that can't be done, return nil."
(provide 'faces)
-;;; arch-tag: 19a4759f-2963-445f-b004-425b9aadd7d6
+;; arch-tag: 19a4759f-2963-445f-b004-425b9aadd7d6
;;; faces.el ends here