;;; facemenu.el --- create a face menu for interactively adding fonts to text
;; Copyright (C) 1994, 1995, 1996, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
;; Author: Boris Goldowsky <boris@gnu.org>
;; Keywords: faces
:group 'facemenu)
(defcustom facemenu-new-faces-at-end t
- "*Where in the menu to insert newly-created faces.
+ "Where in the menu to insert newly-created faces.
This should be nil to put them at the top of the menu, or t to put them
just before \"Other\" at the end."
:type 'boolean
"22.1,\n and has no effect on the Face menu")
(defcustom facemenu-listed-faces nil
- "*List of faces to include in the Face menu.
+ "List of faces to include in the Face menu.
Each element should be a symbol, the name of a face.
The \"basic \" faces in `facemenu-keybindings' are automatically
added to the Face menu, and need not be in this list.
(defun facemenu-read-color (&optional prompt)
"Read a color using the minibuffer."
(let* ((completion-ignore-case t)
- (col (completing-read (or prompt "Color: ")
- (or facemenu-color-alist
- (defined-colors))
- nil t)))
+ (color-list (or facemenu-color-alist (defined-colors)))
+ (completer
+ (lambda (string pred all-completions)
+ (if all-completions
+ (or (all-completions string color-list pred)
+ (if (color-defined-p string)
+ (list string)))
+ (or (try-completion string color-list pred)
+ (if (color-defined-p string)
+ string)))))
+ (col (completing-read (or prompt "Color: ") completer nil t)))
(if (equal "" col)
nil
col)))
(l list))
(while (cdr l)
(if (and (facemenu-color-equal (car (car l)) (car (car (cdr l))))
- (not (if (boundp 'w32-default-color-map)
- (not (assoc (car (car l)) w32-default-color-map)))))
+ (not (if (fboundp 'w32-default-color-map)
+ (not (assoc (car (car l)) (w32-default-color-map))))))
(progn
(setcdr (car l) (cons (car (car (cdr l))) (cdr (car l))))
(setcdr l (cdr (cdr l))))