From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#8396: 24.0.50; why use options (vars) instead of faces for apropos? Date: Sun, 24 Apr 2011 13:07:28 -0700 Message-ID: <5814FFD2EF8F4E278D0ECDE2C5AC833A@us.oracle.com> References: <2F4E512F2C714C4EA5E50E94777DC22A@us.oracle.com> <87y62zv3g6.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1303677460 18204 80.91.229.12 (24 Apr 2011 20:37:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 24 Apr 2011 20:37:40 +0000 (UTC) Cc: 8396@debbugs.gnu.org To: "'Chong Yidong'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 24 22:37:36 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QE63i-0008KP-Iu for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Apr 2011 22:37:34 +0200 Original-Received: from localhost ([::1]:55148 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QE63i-0005La-2W for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Apr 2011 16:37:34 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:52283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QE63g-0005LU-1M for bug-gnu-emacs@gnu.org; Sun, 24 Apr 2011 16:37:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QE63f-0006Zx-77 for bug-gnu-emacs@gnu.org; Sun, 24 Apr 2011 16:37:32 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QE63e-0006Zt-V5 for bug-gnu-emacs@gnu.org; Sun, 24 Apr 2011 16:37:31 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QE5b8-0005jT-A9; Sun, 24 Apr 2011 16:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Apr 2011 20:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8396 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8396-submit@debbugs.gnu.org id=B8396.130367565821994 (code B ref 8396); Sun, 24 Apr 2011 20:08:02 +0000 Original-Received: (at 8396) by debbugs.gnu.org; 24 Apr 2011 20:07:38 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QE5ak-0005ig-0B for submit@debbugs.gnu.org; Sun, 24 Apr 2011 16:07:38 -0400 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QE5ah-0005iH-Dt for 8396@debbugs.gnu.org; Sun, 24 Apr 2011 16:07:36 -0400 Original-Received: from rcsinet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p3OK7SeI023342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 24 Apr 2011 20:07:29 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by rcsinet13.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id p3OK7R0v015648 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 24 Apr 2011 20:07:27 GMT Original-Received: from abhmt008.oracle.com (abhmt008.oracle.com [141.146.116.17]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p3OK7QUe004981; Sun, 24 Apr 2011 15:07:26 -0500 Original-Received: from dradamslap1 (/10.159.42.33) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 24 Apr 2011 13:07:26 -0700 X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6090 Thread-Index: AcwCuCZ/PSz/aviDS+WPES0qAsqhQAAAD9Yg In-Reply-To: <87y62zv3g6.fsf@stupidchicken.com> X-Source-IP: rcsinet13.oracle.com [148.87.113.125] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090209.4DB48301.005A:SCFMA4539811,ss=1,fgs=0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 24 Apr 2011 16:08:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:45971 Archived-At: > > Throughout apropos.el, we use `defcustom's instead of `defface's for > > customizing the faces used. Why? > > Bad historical design. I don't see a good way to revert this, though. Surely this is not the first time Emacs has transitioned from variables to faces. ;-) Here's one suggestion: Start using `defface's and their resulting faces. Declare the corresponding options obsolete. If deemed absolutely necessary, the code could, for now, use either the option value (if non-nil) or the face. Eventually, we would remove the options. Something like this, perhaps: (use-a-face (or the-face-option 'the-face)) E.g.: (defcustom apropos-symbol-face nil "DOC MENTIONING IT IS OBSOLETE and to use face `apropos-symbol-face' instead." :group 'apropos :type '(choice (const :tag "None" nil) face)) (define-button-type 'apropos-symbol 'face (or apropos-symbol-face 'apropos-symbol-face) 'help-echo "mouse-2, RET: Display more help on this symbol" 'follow-link t 'action #'apropos-symbol-button-display-help) Note the :type change for the option. The current :type of `face' is incorrect - in all of the apropos.el face options (another bug). The doc strings for these face options, and some of the code that uses them, expect that the value can be nil, meaning to use no face. This probably dates from ancient defvars, before defcustom. But the defcustom :type is `face' for each of them, which precludes using nil as the value. You cannot edit the value to `nil' and then use that, because `nil' is not a face. And if you use (setq apropos-symbol-face nil) then Customize shows a type mismatch. Note too this comment in the code of `apropos-print', which cries out for the fix this bug requests: ;; Can't use default, since user may have changed the variable! ;; Just say `no' to variables containing faces! And note the bugged code of `apropos-describe-plist', which in fact tests whether variable `apropos-symbol-face' is nil (which it cannot be without mismatching its :type). In sum, please consider biting the bullet and getting rid of these face options.