From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#35231: 26.1; Redefine `read-command' behavior for empty input and DEFAULT not a command name Date: Tue, 09 Jul 2019 17:39:52 +0200 Message-ID: <87ef2ztdx3.fsf@mouse.gnus.org> References: <85ddecd9-7a66-4fbc-8297-b4419e45db05@default> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="138921"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 35231@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 09 17:53:16 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hksQd-000YtN-8q for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Jul 2019 17:53:15 +0200 Original-Received: from localhost ([::1]:51220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hksER-00053i-7N for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Jul 2019 11:40:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48216) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hksDt-0004BI-3c for bug-gnu-emacs@gnu.org; Tue, 09 Jul 2019 11:40:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hksDr-0008JA-WF for bug-gnu-emacs@gnu.org; Tue, 09 Jul 2019 11:40:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53238) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hksDr-0008Iz-SI for bug-gnu-emacs@gnu.org; Tue, 09 Jul 2019 11:40:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hksDp-0002ca-Uj for bug-gnu-emacs@gnu.org; Tue, 09 Jul 2019 11:40:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Jul 2019 15:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35231 X-GNU-PR-Package: emacs Original-Received: via spool by 35231-submit@debbugs.gnu.org id=B35231.156268680010065 (code B ref 35231); Tue, 09 Jul 2019 15:40:01 +0000 Original-Received: (at 35231) by debbugs.gnu.org; 9 Jul 2019 15:40:00 +0000 Original-Received: from localhost ([127.0.0.1]:33826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hksDn-0002cF-EV for submit@debbugs.gnu.org; Tue, 09 Jul 2019 11:40:00 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:48200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hksDk-0002c4-RC for 35231@debbugs.gnu.org; Tue, 09 Jul 2019 11:39:57 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hksDh-0006gi-3w; Tue, 09 Jul 2019 17:39:55 +0200 In-Reply-To: <85ddecd9-7a66-4fbc-8297-b4419e45db05@default> (Drew Adams's message of "Thu, 11 Apr 2019 08:10:59 -0700 (PDT)") 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: 209.51.188.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:162497 Archived-At: Drew Adams writes: > This is a followup to bug #35222 (and thanks for fixing that doc bug). > > As discussed in #35222, the current C-code definition of `read-command' > seems not so desirable, when it comes to DEFAULT = nil or "". > > The behavior in that case is to return an uninterned symbol whose name > is empty, which has the read/print syntax `##'. > > This is _not_ a symbol whose function definition is `commandp'. There > is nothing about this symbol that qualifies for consideration as a > command. It seems wrong (a bug) for `read-command' to ever return a > symbol whose function definition is `commandp'. That is, indeed, pretty odd. The function isn't used a lot in Emacs: ./lisp/subr.el1088: (read-command (format "Set key %s to command: " ./lisp/edmacro.el118: (setq cmd (read-command "Name of keyboard macro to edit: ")) ./lisp/emulation/edt.el1130: (setq edt-function (read-command "Enter command name: ")) ./lisp/info.el4526: (read-command "Find documentation for command: "))) ./lisp/strokes.el448: (read-command "Command to map stroke to: "))) But some of them expect this behaviour: (setq cmd (read-command "Name of keyboard macro to edit: ")) (if (string-equal cmd "") (error "No command name given")) (setq edt-function (read-command "Enter command name: ")) (if (string-equal "" edt-function) (message "Key not defined") So changing the behaviour is probably not a good idea -- there may be out-of-tree usages. So I think we'll have to live with it, and I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no