diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2009-08-16 05:25:21 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2009-08-16 05:25:21 +0000 |
commit | daad00fc06cc055034094e8a1941c6d22967e6bd (patch) | |
tree | 09e8501410ec8b4a463286040aae1c74c12f1838 /lisp/facemenu.el | |
parent | 2ec536de9457ca2460592c1996f443eafb3dbd20 (diff) | |
download | emacs-daad00fc06cc055034094e8a1941c6d22967e6bd.tar.gz emacs-daad00fc06cc055034094e8a1941c6d22967e6bd.tar.bz2 emacs-daad00fc06cc055034094e8a1941c6d22967e6bd.zip |
* facemenu.el (facemenu-read-color): Use a completion function
that accepts any defined color, such as RGB triplets (Bug#3677).
Diffstat (limited to 'lisp/facemenu.el')
-rw-r--r-- | lisp/facemenu.el | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/facemenu.el b/lisp/facemenu.el index a9f4f729edd..7da1c37fcbe 100644 --- a/lisp/facemenu.el +++ b/lisp/facemenu.el @@ -460,11 +460,17 @@ These special properties include `invisible', `intangible' and `read-only'." (defun facemenu-read-color (&optional prompt) "Read a color using the minibuffer." (let* ((completion-ignore-case t) - (require-match (not (eq window-system 'ns))) - (col (completing-read (or prompt "Color: ") - (or facemenu-color-alist - (defined-colors)) - nil require-match))) + (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))) |