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#15909: 24.3.50; please fix `read-face-name' brain-dead PROMPT handling Date: Fri, 15 Nov 2013 14:12:31 -0800 (PST) Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1384553666 32368 80.91.229.3 (15 Nov 2013 22:14:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 15 Nov 2013 22:14:26 +0000 (UTC) To: 15909@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 15 23:14:30 2013 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 1VhRen-00029H-Gq for geb-bug-gnu-emacs@m.gmane.org; Fri, 15 Nov 2013 23:14:29 +0100 Original-Received: from localhost ([::1]:34049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhRek-0007JR-L0 for geb-bug-gnu-emacs@m.gmane.org; Fri, 15 Nov 2013 17:14:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhReX-0007IL-0h for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2013 17:14:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VhReM-0006V7-Ri for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2013 17:14:12 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhReM-0006V3-OW for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2013 17:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VhReM-0008Ub-8G for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2013 17:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Nov 2013 22:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15909 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.138455359032568 (code B ref -1); Fri, 15 Nov 2013 22:14:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Nov 2013 22:13:10 +0000 Original-Received: from localhost ([127.0.0.1]:56294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VhRdW-0008TD-3H for submit@debbugs.gnu.org; Fri, 15 Nov 2013 17:13:10 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36947) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VhRdT-0008Sm-5J for submit@debbugs.gnu.org; Fri, 15 Nov 2013 17:13:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VhRdD-0006Oh-NV for submit@debbugs.gnu.org; Fri, 15 Nov 2013 17:13:01 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:56077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhRdD-0006Od-KB for submit@debbugs.gnu.org; Fri, 15 Nov 2013 17:12:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhRd5-00076Z-0W for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2013 17:12:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VhRcw-0006LH-AM for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2013 17:12:42 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:42733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VhRcw-0006L2-3Y for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2013 17:12:34 -0500 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id rAFMCWLH002975 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 15 Nov 2013 22:12:33 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rAFMCVg0025312 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 15 Nov 2013 22:12:32 GMT Original-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rAFMCV8i025304 for ; Fri, 15 Nov 2013 22:12:31 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:80617 Archived-At: In Emacs 20, the PROMPT arg was just passed to `completing-read'. So you used ": " at the end. As usual in Emacs. Simple. Sure. No nonsense. In Emacs 22, `read-face-name' decided to become "smart": It required callers NOT to end the PROMPT with a space. Dumb. In Emacs 24, `read-face-name' decided to become even "smarter": It requires callers NOT to end the PROMPT with EITHER a space or a colon. It systematically adds ": " to PROMPT. Dumber. This is silly. It means that any 3rd-party code that passes a prompt to `read-face-name' has to fiddle with it to get the desired result for different Emacs versions. To what end? What good is accomplished by this silliness? Please add some code similar to the following to `read-face-name', so it DTRT. (when (save-match-data (string-match ": $" prompt)) (setq prompt (substring prompt 0 -2))) Feel free to make this code even smarter - make it accommodate prompts of all sorts, adding ": " or ":" or " " ONLY AS NEEDED, not systematically. After a decade or so of silliness, we should be able to get this right finally. If there were no silly history, the right approach would of course be to have callers include ": " in the PROMPT arg, as usual in Emacs. `read-face-name' (or some utility function it calls) could massage the prompt to fiddle with default values or whatever. It's not too late to make that the new interface. But we still need to fix the problem of callers that must work across Emacs versions. So please update the behavior (and the doc string) to expect PROMPT to have its own ": ", but still accommodate PROMPTs that do not have it by adding ": ", ":", or " " as needed. Yes, this is a mess. And a gratuitous one, to boot. In GNU Emacs 24.3.50.1 (i686-pc-mingw32) of 2013-11-12 on LEG570 Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --enable-checking 'CFLAGS=3D-O0 -g3' CPPFLAGS=3D-DGLYPH_DEBUG= =3D1'