# HG changeset patch # User Richard M. Stallman # Date 870668631 0 # Node ID 8aad7cef6fc0dafbceecb0013661c2592a6e048e # Parent e5e8552b076af48bb2f6f756c960fb76c7fa0e2e (internal-face-interactive): Handle default in usual way, Provide completion for color reading. (set-face-foreground, set-face-background): Specify `color' when reading the color name interactively. diff -r e5e8552b076a -r 8aad7cef6fc0 lisp/faces.el --- a/lisp/faces.el Mon Aug 04 03:57:04 1997 +0000 +++ b/lisp/faces.el Mon Aug 04 04:23:51 1997 +0000 @@ -189,7 +189,7 @@ "Change the foreground color of face FACE to COLOR (a string). If the optional FRAME argument is provided, change only in that frame; otherwise change each frame." - (interactive (internal-face-interactive "foreground")) + (interactive (internal-face-interactive "foreground" 'color)) (internal-set-face-1 face 'foreground color 4 frame)) (defvar face-default-stipple "gray3" @@ -214,7 +214,7 @@ "Change the background color of face FACE to COLOR (a string). If the optional FRAME argument is provided, change only in that frame; otherwise change each frame." - (interactive (internal-face-interactive "background")) + (interactive (internal-face-interactive "background" 'color)) ;; For a specific frame, use gray stipple instead of gray color ;; if the display does not support a gray color. (if (and frame (not (eq frame t)) color @@ -455,11 +455,20 @@ (default (if (fboundp fn) (or (funcall fn face (selected-frame)) (funcall fn 'default (selected-frame))))) - (value (if bool - (y-or-n-p (concat "Should face " (symbol-name face) - " be " bool "? ")) - (read-string (concat prompt " " (symbol-name face) " to: ") - default)))) + value) + (setq value + (cond ((eq bool 'color) + (completing-read (concat prompt " " (symbol-name face) " to: ") + (mapcar (function (lambda (color) + (cons color color))) + x-colors) + nil nil nil nil default)) + (bool + (y-or-n-p (concat "Should face " (symbol-name face) + " be " bool "? "))) + (t + (read-string (concat prompt " " (symbol-name face) " to: ") + nil nil default)))) (list face (if (equal value "") nil value)))) (defun internal-face-interactive-stipple (what)