From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: mail--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#50811: 28.0.50; Misleading Docstring for read-string function Date: Sun, 26 Sep 2021 08:28:05 +0000 Message-ID: <_54OEp0LYzdxgXLLnOGpPKIfp0dH3AVBE0pzUGBTFZW_r1v5IQw7Vf4Ij-ugCTXUw-UVAneeffL-Kt1PV2XuwrSeFXFllKCypAD2pZ1cQZs=@codrut.pro> Reply-To: =?UTF-8?Q?Codru=C8=9B?= Constantin =?UTF-8?Q?Gu=C8=99oi?= Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35497"; mail-complaints-to="usenet@ciao.gmane.io" To: 50811@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 26 10:29:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mUPX2-000914-W8 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Sep 2021 10:29:09 +0200 Original-Received: from localhost ([::1]:46606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUPX1-0002Ek-J9 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Sep 2021 04:29:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUPWw-0002EX-9c for bug-gnu-emacs@gnu.org; Sun, 26 Sep 2021 04:29:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52398) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUPWw-0005Qv-1w for bug-gnu-emacs@gnu.org; Sun, 26 Sep 2021 04:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mUPWv-0001jo-Vz for bug-gnu-emacs@gnu.org; Sun, 26 Sep 2021 04:29:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Codru=C8=9B?= Constantin =?UTF-8?Q?Gu=C8=99oi?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Sep 2021 08:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50811 X-GNU-PR-Package: emacs X-Debbugs-Original-To: "bug-gnu-emacs@gnu.org" Original-Received: via spool by submit@debbugs.gnu.org id=B.16326448966623 (code B ref -1); Sun, 26 Sep 2021 08:29:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Sep 2021 08:28:16 +0000 Original-Received: from localhost ([127.0.0.1]:35711 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUPWC-0001ik-BW for submit@debbugs.gnu.org; Sun, 26 Sep 2021 04:28:16 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:50004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mUPWA-0001id-OM for submit@debbugs.gnu.org; Sun, 26 Sep 2021 04:28:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUPWA-00028d-GY for bug-gnu-emacs@gnu.org; Sun, 26 Sep 2021 04:28:14 -0400 Original-Received: from mail1.protonmail.ch ([185.70.40.18]:49121) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUPW7-0004hT-Ih for bug-gnu-emacs@gnu.org; Sun, 26 Sep 2021 04:28:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codrut.pro; s=protonmail2; t=1632644886; bh=/vGSPv5NCqHlJxF4qsr61as+6j/LZY8u3PBpGvA1hnM=; h=Date:To:From:Reply-To:Subject:From; b=QJu6VKqdJayb8OBeDNH2ILgKnQ0dSjf8rjLkXpeGfD77+bEZi5QxmWLGfNJHfTKhP MNJ2nqwnezj1QQI/d/dO7T5Zuua4yQemqrYoUW1my7TeCMpGxcfcr2scil2hK34fbf OyhDY9icOycq9VKsv0vVBNGcPD2dc2pouOlktT3dRlHylJ/T16lDj+kWHyvdwIrgz5 YBgRW71wsB/3XKE7QuRZOvKttfDakjs/mOB5QhFwZl2HDlBcG0uLrVyVUqBC980Ouk qRGQLCSMhO6KFG/H2agufdQtVvfWfSgvDrkPwG+ToscNrdiWzr8ngf4mmK/3XQhxny eIA9e02YjaYYA== Received-SPF: pass client-ip=185.70.40.18; envelope-from=mail@codrut.pro; helo=mail1.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_PDS_PRO_TLD=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" X-ACL-Warn: , =?UTF-8?Q?Codru=C8=9B?= Constantin =?UTF-8?Q?Gu=C8=99oi?= Xref: news.gmane.io gmane.emacs.bugs:215574 Archived-At: While trying to solve and issue in an emacs pacage: https://github.com/Alex= ander-Miller/cfrs/pull/6 I encountered the following docstring entry for th= e read-string function: ``` If non-nil, second arg INITIAL-INPUT is a string to insert before reading. This argument has been superseded by DEFAULT-VALUE and should normally be= nil in new code. It behaves as INITIAL-CONTENTS in `read-from-minibuffer' (w= hich see). ``` This is misleading since INITIAL-INPUT behaves differently from DEFAULT-VAL= UE: ``` ;; No pre-completed value, returns "" when empty. (read-string "PROMPT ") ;; Pre-completed with "A", returns "" when empty. (read-string "PROMPT " "A") ;; Pre-completed with "A", returns "B" when empty. (read-string "PROMPT " "A" nil "B") ;; No pre-completed value, returns "B" when empty. (read-string "PROMPT " nil nil "B") ``` Not sure what should be done here, either remove that note, since both argu= ments do a different job, or change the code to pass around DEFAULT-VALUE i= nstead of INITIAL-INPUT internally when INITIAL-INPUT is nil, as the docstr= ing suggests. But the latter feels weird to me as getting rid of INITIAL-IN= PUT would be a breaking change so it's probably never going to be removed f= rom the arguments list. Also I am not sure what the initial intention of su= perseding INITIAL-INPUT was. Let me know what you think works best and I can submit patches. Cheers, Codru=C8=9B www.codrut.pro