summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2001-04-05 15:57:16 +0000
committerGerd Moellmann <gerd@gnu.org>2001-04-05 15:57:16 +0000
commit76834555a8f7185f22fee6f3eb92205656ecb40d (patch)
treef1600921b2438894b7fa4e8f1971f81723f999f7
parent18b6bc735c95b65b0ca146f9f707f6c5e0b6e08d (diff)
downloademacs-76834555a8f7185f22fee6f3eb92205656ecb40d.tar.gz
(widget-color-sample-face-get): Don't make
faces for undefined colors.
-rw-r--r--lisp/wid-edit.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index b28b52688c5..a3821dcfe0a 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -1,6 +1,6 @@
;;; wid-edit.el --- Functions for creating and using widgets -*-byte-compile-dynamic: t;-*-
;;
-;; Copyright (C) 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
;;
;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
;; Maintainer: FSF
@@ -3398,11 +3398,13 @@ To use this type, you must define :match or :match-alternatives."
(defun widget-color-sample-face-get (widget)
(let* ((value (condition-case nil
(widget-value widget)
- (error (widget-get widget :value))))
- (symbol (intern (concat "fg:" value))))
- (condition-case nil
- (facemenu-get-face symbol)
- (error 'default))))
+ (error (widget-get widget :value)))))
+ (if (color-defined-p value)
+ (let ((symbol (intern (concat "fg:" value))))
+ (condition-case nil
+ (facemenu-get-face symbol)
+ (error 'default)))
+ 'default)))
(defun widget-color-action (widget &optional event)
"Prompt for a color."