From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#16483: 24.3.50; `read-face-name' is a mess now (regression) Date: Fri, 29 Apr 2016 17:37:00 +0200 Message-ID: <871t5o2zqb.fsf@gnus.org> References: <55d774e6-27f4-4e9f-a3e5-4aa1e43f0a0e@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1461944326 17136 80.91.229.3 (29 Apr 2016 15:38:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Apr 2016 15:38:46 +0000 (UTC) Cc: 16483@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 29 17:38:35 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1awAUz-00057G-Lh for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Apr 2016 17:38:33 +0200 Original-Received: from localhost ([::1]:55268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awAUv-0008KK-Pk for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Apr 2016 11:38:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awAUk-000865-8f for bug-gnu-emacs@gnu.org; Fri, 29 Apr 2016 11:38:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awAUX-0006qH-UE for bug-gnu-emacs@gnu.org; Fri, 29 Apr 2016 11:38:12 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awAUX-0006pE-Qh for bug-gnu-emacs@gnu.org; Fri, 29 Apr 2016 11:38:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1awAUU-00070X-D9 for bug-gnu-emacs@gnu.org; Fri, 29 Apr 2016 11:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Apr 2016 15:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16483 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16483-submit@debbugs.gnu.org id=B16483.146194422526843 (code B ref 16483); Fri, 29 Apr 2016 15:38:02 +0000 Original-Received: (at 16483) by debbugs.gnu.org; 29 Apr 2016 15:37:05 +0000 Original-Received: from localhost ([127.0.0.1]:55503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awATZ-0006ys-IJ for submit@debbugs.gnu.org; Fri, 29 Apr 2016 11:37:05 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:57636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awATY-0006yl-6x for 16483@debbugs.gnu.org; Fri, 29 Apr 2016 11:37:04 -0400 Original-Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1awATU-0002bJ-PD; Fri, 29 Apr 2016 17:37:03 +0200 In-Reply-To: <55d774e6-27f4-4e9f-a3e5-4aa1e43f0a0e@default> (Drew Adams's message of "Fri, 17 Jan 2014 15:54:11 -0800 (PST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:117196 Archived-At: Drew Adams writes: > The doc string is a mess now. Quite unclear, and incorrect in more than > one way. And so is the code a mess. > > 1. The doc string no longer says what the behavior is if DEFAULT is nil. > In Emacs 24.3, it said this for that case: > > If DEFAULT is nil, the list of default face names is taken from > the `read-face-name' property of the text at point, or, if that > is nil, from the `face' property of the text at point. > > What happens now? No information about that. See below for my guess. > Please tell users of the function what its behavior is. As far as I can see, if DEFAULT is nil, there is no list of default face names? > 2. The doc string says that DEFAULT is returned if the user enters the > empty string. That is clearly wrong, at least when DEFAULT is a list of > faces or face names. DEFAULT is not returned in such cases. The most > that can be said in general is that DEFAULT _determines_ what is > returned for empty input - not that DEFAULT _is_ what is returned. I've now made the doc string more correct, if more difficult to parse. > 5. The code is wrong, at least in this regard: If DEFAULT is a list of > strings (face names), and if MULTIPLE is nil, both of which are OK per > the doc string, then you get this: > > Debugger entered--Lisp error: (wrong-type-argument symbolp "font-lock-comme= > nt-face") > * symbol-name("font-lock-comment-face") I've fixed that now. > 8. What happened to the useful defaulting of previous Emacs versions? > Yes, I know why you made the change, but now any existing code that uses > `read-face-name' is broken if it depends on `r-f-n' to provide such > defaulting. Too bad. > > Please consider: There is more Elisp code in the world than just what is > distributed by Emacs Dev. `read-face-name' has been and continues to be > a poster child of how not to evolve code. It has morphed in incompatible > ways from version to version. The right way to do what you wanted to do > for Emacs 24.4 would have been to go ahead and define `face-at-point', > but to *use* it in `read-face-name', so that that function continues to > provide the expected defaulting when DEFAULT is nil: > > (unless default (setq default (face-at-point))) > > I somehow doubt that that part of the regression will be fixed, but > perhaps some of the other points above have a chance of being addressed. Yes, that's outside the scope of read-face-name, I think. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no