From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Customizing faces with `defcustom' Date: Sat, 12 Nov 2005 09:09:22 +0100 Message-ID: <4375A332.6070000@gmx.at> References: <43103F48.1020804@gmx.at> <4313F4CB.10200@gmx.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1131784196 2188 80.91.229.2 (12 Nov 2005 08:29:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 12 Nov 2005 08:29:56 +0000 (UTC) Cc: Per Abrahamsen , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 12 09:29:55 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Eaqkz-0001IV-8v for ged-emacs-devel@m.gmane.org; Sat, 12 Nov 2005 09:29:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eaqkw-00058A-Ht for ged-emacs-devel@m.gmane.org; Sat, 12 Nov 2005 03:29:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Eaqkf-000585-Jc for emacs-devel@gnu.org; Sat, 12 Nov 2005 03:28:45 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Eaqke-00057t-0G for emacs-devel@gnu.org; Sat, 12 Nov 2005 03:28:45 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eaqkd-00057q-3B for emacs-devel@gnu.org; Sat, 12 Nov 2005 03:28:43 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1Eaqkc-0004OM-T1 for emacs-devel@gnu.org; Sat, 12 Nov 2005 03:28:43 -0500 Original-Received: (qmail invoked by alias); 12 Nov 2005 08:28:40 -0000 Original-Received: from N864P019.adsl.highway.telekom.at (EHLO [62.47.51.243]) [62.47.51.243] by mail.gmx.net (mp019) with SMTP; 12 Nov 2005 09:28:40 +0100 X-Authenticated: #14592706 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Original-To: rms@gnu.org In-Reply-To: X-Y-GMX-Trusted: 0 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:45812 Archived-At: > Consider, for example, the customization buffer for `matching': > > [Made by M-x customize-group RET matching RET] > > (1) `match' stands out in `custom-face-tag-face', by default scaled by > 1.2 and bold. > > (2) `list-matching-lines-default-context-lines' is highlighted in > `custom-variable-tag-face', by default scaled by 1.2 and bold. > > > Then come the options > > (3) `list-matching-lines-face' and > `list-matching-lines-buffer-name-face' both in default face. > > That is a real bug. These are variables, and their names should be > highlighted like all other variable names. > > I think this is a consequence of the following definition for > widget type `face'. > > (define-widget 'face 'symbol > "A Lisp face name (with sample)." > :format "%t: (%{sample%}) %v" > :tag "Face" > :value 'default > :sample-face-get 'widget-face-sample-face-get > > I think that this :sample-face-get definition is affecting the > appearance of the variable's name. The code in the definition of the > `face' widget was adapted from the `color' widget. I tried this > example > > (defcustom foocolor "black" > "Foo" > :type 'color) > > and saw the same problem occur. > > I think it is a bug that the :sample-face-get of the type has an > effect on display of the variable name. I would expect it to affect > only where the value is displayed. But I have never understood the > widget code, so I have no idea how this happens. > > Can anyone figure out how to fix that? > The solution appears deceptively simple: *** cus-edit.el Sat Nov 5 20:44:24 2005 --- cus-edit.el Fri Nov 11 18:32:56 2005 *************** *** 3397,3403 **** (define-widget 'face 'symbol "A Lisp face name (with sample)." ! :format "%t: (%{sample%}) %v" :tag "Face" :value 'default :sample-face-get 'widget-face-sample-face-get --- 3397,3403 ---- (define-widget 'face 'symbol "A Lisp face name (with sample)." ! :format "%{%t%}: (%{sample%}) %v" :tag "Face" :value 'default :sample-face-get 'widget-face-sample-face-get *** wid-edit.el Sat Nov 5 20:44:42 2005 --- wid-edit.el Fri Nov 11 18:34:24 2005 *************** *** 3575,3581 **** ;; Fixme: match (define-widget 'color 'editable-field "Choose a color name (with sample)." ! :format "%t: %v (%{sample%})\n" :size 10 :tag "Color" :value "black" --- 3575,3581 ---- ;; Fixme: match (define-widget 'color 'editable-field "Choose a color name (with sample)." ! :format "%{%t%}: %v (%{sample%})\n" :size 10 :tag "Color" :value "black"