Commit daad00fc authored by Chong Yidong's avatar Chong Yidong
Browse files

* facemenu.el (facemenu-read-color): Use a completion function

that accepts any defined color, such as RGB triplets (Bug#3677).
parent 2ec536de
2009-08-16 Chong Yidong <cyd@stupidchicken.com> 2009-08-16 Chong Yidong <cyd@stupidchicken.com>
* facemenu.el (facemenu-read-color): Use a completion function
that accepts any defined color, such as RGB triplets (Bug#3677).
* files.el (get-free-disk-space): Change fallback default * files.el (get-free-disk-space): Change fallback default
directory to /. Expand DIR argument before switching to fallback. directory to /. Expand DIR argument before switching to fallback.
Suggested by Kevin Ryde (Bug#2631, Bug#3911). Suggested by Kevin Ryde (Bug#2631, Bug#3911).
......
...@@ -460,11 +460,17 @@ These special properties include `invisible', `intangible' and `read-only'." ...@@ -460,11 +460,17 @@ These special properties include `invisible', `intangible' and `read-only'."
(defun facemenu-read-color (&optional prompt) (defun facemenu-read-color (&optional prompt)
"Read a color using the minibuffer." "Read a color using the minibuffer."
(let* ((completion-ignore-case t) (let* ((completion-ignore-case t)
(require-match (not (eq window-system 'ns))) (color-list (or facemenu-color-alist (defined-colors)))
(col (completing-read (or prompt "Color: ") (completer
(or facemenu-color-alist (lambda (string pred all-completions)
(defined-colors)) (if all-completions
nil require-match))) (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) (if (equal "" col)
nil nil
col))) col)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment