From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#35222: 26.1; `read-command' documentation Date: Wed, 10 Apr 2019 16:32:47 -0700 (PDT) Message-ID: References: <54098355-6406-459c-9a3a-b7c5b4fe286b@default> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="261014"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 35222@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 11 01:33:14 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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hEMiP-0015mv-Lb for geb-bug-gnu-emacs@m.gmane.org; Thu, 11 Apr 2019 01:33:13 +0200 Original-Received: from localhost ([127.0.0.1]:39163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEMiO-0006BV-ET for geb-bug-gnu-emacs@m.gmane.org; Wed, 10 Apr 2019 19:33:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEMiF-0006BQ-Vg for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2019 19:33:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hEMiE-0007XX-Un for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2019 19:33:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40122) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hEMiE-0007XC-II for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2019 19:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hEMiE-0006bk-BL for bug-gnu-emacs@gnu.org; Wed, 10 Apr 2019 19:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Apr 2019 23:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35222 X-GNU-PR-Package: emacs Original-Received: via spool by 35222-submit@debbugs.gnu.org id=B35222.155493918025391 (code B ref 35222); Wed, 10 Apr 2019 23:33:02 +0000 Original-Received: (at 35222) by debbugs.gnu.org; 10 Apr 2019 23:33:00 +0000 Original-Received: from localhost ([127.0.0.1]:53666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hEMiC-0006bT-6K for submit@debbugs.gnu.org; Wed, 10 Apr 2019 19:33:00 -0400 Original-Received: from aserp2130.oracle.com ([141.146.126.79]:38712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hEMiA-0006bF-H8 for 35222@debbugs.gnu.org; Wed, 10 Apr 2019 19:32:59 -0400 Original-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3ANU6Jm155035; Wed, 10 Apr 2019 23:32:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=6/TzvzWfHWZMXoL9eMMKxypu8v2VR+5UAQ+TS1WTEEg=; b=28JJhpRQOgGR9PeelJAz7oDxOXKXrEnFy+1hspbHUSjTBsc5mJszxF4TvuLbyKmE2K+W 5C/+1JlL6JJUhIw00Fr5ON7EW4AI7SYI1vJhmreKV5roCUg9b5MD0xnwfp3JeAU284AN kQtBQ3fh/GtEb3B3Z9UWaGy9oimgcP+VDiVAje1S5yVlPEiKr1d0HSnzrjnTzsNFlJIc ErM8uDd3cvaDAsTElN5Umz6bcHzqeEHFdkUYh7k/UWGQbT5hSuWts1QqL4y5TSPDjBsl pn1FyqSX7fGxWSq74Qa8b3WMYA721Umtx+zTQM/InvsMODBmyjPZ879pchP5gJjcJERG OA== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2130.oracle.com with ESMTP id 2rphmep1ts-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Apr 2019 23:32:51 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3ANVxn1130546; Wed, 10 Apr 2019 23:32:50 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 2rpkek64hg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Apr 2019 23:32:50 +0000 Original-Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x3ANWmWx027194; Wed, 10 Apr 2019 23:32:49 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4834.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9223 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904100153 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9223 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904100153 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:157472 Archived-At: > > 1. The doc string does not say what happens if DEFAULT is not provided > > (so `nil') and the user enters empty input. And what happens is not > > obvious. Please add that information to the doc string. >=20 > Um, can we declare the current behaviour a bug, and instead return nil > in this case? That matches the current doc string (i.e., return > DEFAULT-VALUE), and avoids the whole mess with the empty string symbol > which is weird and pretty useless as far as I can tell. Good question. That was in fact my first reaction. I wrote the bug report that way, then reconsidered. I agree that the behavior is weird, and I'm not sure what users, in what use cases, it could help. IOW, why? But the behavior has apparently always been thus. (Prior to Emacs 24 there was no such read/print syntax for uninterned symbols, so it was arguably even weirder. If you used the result as a variable value and did `C-h v' it would show you nothing!) I ended up figuring that someone wanted this for some good reason that I couldn't think of, and that since it is documented this way (always returns a symbol) and it is of long date we should just leave it and make sure the doc string also helps. But it sure is a gotcha. Why the default DEFAULT behavior would be something so unexpected is a good question. Hysterical accident? Intentional design? Anyone know or have an idea what good this is? All I could think of is that code using it can be sure to get a symbol. But it sure isn't sure to get a command... I don't have the C sources, but a priori (e.g. if I were writing `read-command' from scratch in Lisp) it seems like it should _require_ a commandp symbol, i.e., use `completing-read' with non-nil REQUIRE arg. Someone is sure to enlighten us. When that happens, and if the decision is to continue the behavior, hopefully people will agree even more strongly with the need to provide clear doc about this odd default case.