# HG changeset patch # User Gerd Moellmann # Date 986486236 0 # Node ID bd650fe3380efa0465cd1dcd7943a441a1e17cc9 # Parent 78542938ed280f014d78727b32514a65755e4476 (widget-color-sample-face-get): Don't make faces for undefined colors. diff -r 78542938ed28 -r bd650fe3380e lisp/wid-edit.el --- a/lisp/wid-edit.el Thu Apr 05 14:59:37 2001 +0000 +++ b/lisp/wid-edit.el Thu Apr 05 15:57:16 2001 +0000 @@ -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 ;; Maintainer: FSF @@ -3398,11 +3398,13 @@ (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."