From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#56380: 29.0.50; completing-read: INITIAL-INPUT arg Date: Tue, 5 Jul 2022 14:50:07 +0000 Message-ID: References: <878rp9840g.fsf@web.de> <87v8sb4ww7.fsf@gnus.org> <86edyzg1vt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38718"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Michael Heerdegen , Stefan Monnier , "56380@debbugs.gnu.org" <56380@debbugs.gnu.org> To: Arash Esbati , Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 05 16:51:34 2022 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 1o8jtl-0009si-Im for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Jul 2022 16:51:33 +0200 Original-Received: from localhost ([::1]:47532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8jtk-0005am-Et for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Jul 2022 10:51:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8jtG-0005aM-Ru for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2022 10:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57323) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o8jtG-0007iA-JJ for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2022 10:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o8jtG-0007N9-Eb for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2022 10:51: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: Tue, 05 Jul 2022 14:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56380 X-GNU-PR-Package: emacs Original-Received: via spool by 56380-submit@debbugs.gnu.org id=B56380.165703261828266 (code B ref 56380); Tue, 05 Jul 2022 14:51:02 +0000 Original-Received: (at 56380) by debbugs.gnu.org; 5 Jul 2022 14:50:18 +0000 Original-Received: from localhost ([127.0.0.1]:51220 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8jsX-0007Lp-PH for submit@debbugs.gnu.org; Tue, 05 Jul 2022 10:50:18 -0400 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:6514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8jsT-0007Ld-4i for 56380@debbugs.gnu.org; Tue, 05 Jul 2022 10:50:16 -0400 Original-Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 265CmYrp003152; Tue, 5 Jul 2022 14:50:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=RlarGvKqvAnG0T/cDb+HW4VwY90z7+3mCBk79gflSPI=; b=zuh5eO8wp7mR5Rgvf1WYDR/8ZskdVwvDheHX/VpudOgxvKcaKkDM9AuuyAQ+K5ubA02p rM/1fYJ9bsJodnXLKFE7WX4ZpOQmVHlNXwd4cTYU3PLwwnH4EfL4mE4aUcRBLshBdJfq OuLvjx78ROGZz5PktrOIIRHQwQbrUUlETfLnEngb3kUzydqoTtTbMNqK5T19OIpHK0CP Iq6EA8+Zx3MFq4LuDirxQoaChbOvQvS6qymkv2MLaXB+FM57rMziiIKnZcXOndViNUxw OMRcypzF26GsZwNAMZPq+HzM4ZdxEOIQ/d2U5imwVBJZ+Cdsp5CaBBkqKQrrw0xsxbGg Wg== Original-Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3h2dwap64r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 05 Jul 2022 14:50:10 +0000 Original-Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 265EfFxJ040374; Tue, 5 Jul 2022 14:50:09 GMT Original-Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2170.outbound.protection.outlook.com [104.47.55.170]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3h2cf8gaw6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 05 Jul 2022 14:50:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cI13TGM4pkjx+1pLb4joFLY6KzC5B7rhufI4f7LJvuXY1sM6mhFUCBUUNgTKeoVUCZFo1KpeyPpC0KwvzCNAL2VSwjB4dyAyeLU0RwyYMuN/SfEqvaU6imD3hmcngTUbzdmL5GtsgblOrJBE1sEBUPQ3MVBbuSeSePUwGFa6wGLD2lEmDrc5fR8xGc6yG6XQEomup1btbTFHkSUf09nkrYauTt7j5m4H17B1w4+VTwZseknmIwjN3dFszqX7zs4L6SoJvOfyNIZEoym94SJEO9c1r+Q4zVR24kT11W+Pc//DXRzVDrDE6SVRIzpMFAY0c5/DLheSAOVXPTIXuRBN8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RlarGvKqvAnG0T/cDb+HW4VwY90z7+3mCBk79gflSPI=; b=lJDWvmpoL+VCXLF4PUZqxD1ZI9dH8KJf6u818bSIbo8vPUQ0R4yHm8UzZ1zEVmy2nUIcNZS1aJtxeJrOLvswjB8qG7tRrb2elQKMw9HlnyF+42r82A6wDrZdLnS2nXam0WoHdB/zz+XUhqrtkvJbQll0yd6sLM3FsOegj+4lXRB/qKtOzutXVyuQ8uDHymmIRzXIrZLyCyLGOy/Ia4f9AXOEuAjCXgPFuI9hf/NxEJufPul7l8kCT0DfuvX+Hs063/JLG4acB0D98bPy+Bp+OnTAJN9KzRBZu5s2gNQ4fj1UVzXuF5Gl7F3Ut3wXxUSOk7Y2vd1JMm8DCsewYl10mQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RlarGvKqvAnG0T/cDb+HW4VwY90z7+3mCBk79gflSPI=; b=I2XPkTYDog7YYb0se6ViLMokLymnF+4tIg7KycoY57FCws1yWJO+v5iRSYSqHtv/9eTVYbmChxvJ7m597E7CAI7NUPFxpHVwOo9D1ziw5Yx+Bu6PuQPmh3IFp3zJRHZywIRhWEAKINNlu4LGVwj8EDOQsYI1ZSCBxdwbFR008VM= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by BN6PR10MB1779.namprd10.prod.outlook.com (2603:10b6:405:c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.21; Tue, 5 Jul 2022 14:50:07 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::581b:ae2f:16b9:80fb]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::581b:ae2f:16b9:80fb%7]) with mapi id 15.20.5395.022; Tue, 5 Jul 2022 14:50:07 +0000 Thread-Topic: [External] : Re: bug#56380: 29.0.50; completing-read: INITIAL-INPUT arg Thread-Index: AQHYkG3P7/rTkB+zaUakdocT70WD+61v0gzQ In-Reply-To: <86edyzg1vt.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7d666848-dd7b-4d01-b062-08da5e95a733 x-ms-traffictypediagnostic: BN6PR10MB1779:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PR2gfxf3AhCRHcAtduL46Ose+E/T5SZkXsb1I73EMPZvbhvtp1HGr4O8muKbWVGWZYVn2qNQeGkw0nGnXpyZh7IiSciCcFAJ6cL2xmF+CjIm6TFoGHvkHhfON2k/fYj+vTodgy1vGSq5c1dt2eF5oxf2pqLdGBZUeOzWceewvBx9ktO49zw8ZmD+QZzzTfOMGwTp4z1o70nU4T2rtRIGKgvjmUzdS3e7V7mxyq+vaF2GpKUp1e4wD9xNLJECz/20k5jRaBGF7QPRgoO9EdTezKG2nw9qibhTOt7q9TIfJswhu7/0+ccd1H7n+g8RJr0Yjhgo63R7cvwIrdkPBahAud+aU9n/oH+v87vmnW3SRp6iPCJuKcpSqGrcMDiGlUUQM6oKj+B5FpMpdhKc/NP4Irxw9Z/ZYRpSWPmN5ZAEmAMOMVcBs3p+v5Z1Ba3DJ5okTNGBJ3rqKHOKd4mI7LnOHEVzOLTDOeQvkomnJ0sXVkXAFbqDUYWqTjeEnVOFoESJft5sPbtZWlWvfi8b4PXRkHgQv1fJrqHi7/YO/d3MTO1Q+pykMnw1z3YAcsYZdu07kZU4gcfZ/Tp3W1xlUytrvHVrrA7SFU44dF2cHYsVIH1UgnJP66yVvOsoCqUh6gaFaI1hc9P0UDnpnMq+AWWJ2uy7BbxlzNFGO3yVbVmYKUEp7jXltCcxDlMErRgPFP+GIUeKrhTglS9AL8u9eGRcorHm8vUDEQ6xrHSBQSnxrzFL3yAX307ER6iN4SPzq J3jM8fMQLWzpN4CbF9nnW/e1RRx6JpJYFh1ofZLRcfGy+Z5TCLr8d+94WMf96DsIZWj x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(366004)(136003)(396003)(346002)(376002)(39860400002)(122000001)(38100700002)(110136005)(54906003)(44832011)(316002)(71200400001)(38070700005)(4326008)(5660300002)(8676002)(8936002)(66556008)(66476007)(64756008)(66946007)(9686003)(66446008)(76116006)(186003)(2906002)(26005)(41300700001)(6506007)(478600001)(86362001)(7696005)(55016003)(52536014)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: ZJHwnxNQ97CzUZfvjr+s53SJla9g7KspfBulnKFbyEiQ7VKRGoFlQlD29o6kUf2q5EuHFvqLtCPWPMym4eJgBu/CzPTymU8p9CefA15ocNWmZjMN9up0wYeWbOdijNb8yVZjtTTgWjNXEkQz7FUwbg0DiGegcmQ59AJjD6Xov5dqtA5IMtT4xsQ1t2L1NMtvc7E7MJGqDJNZ/DxxitpGadTatblmsaMjNMzdMM2/3H8/Rv0X4JaMS+vgUhO7WuSxQd+k4p2HhKB/FlRZxcCq8IpfQr4RPzli+Ly4DR1Kp2kWeOA4MLDe4MXHiPt6Qxr7CQ/JbDq66jt0s0iu9sRZafAMpjo+iBg7Dm46xVYuybox3OK4gpTZ7BRaDyrO/PUrsxLR3le+qDg52hYn3zakBeCOwiryUfv+f3wqQTlHui/hdDEEQU7Lfg/lggHPzWqHH1u4bI7+jRYtlAR8+lBDxw7QK+aIKQAd6v3GjSMMpyJ59zxhdOR/KmWcO7mFcSxsZlOnfMJpRI3rH4vu5QhxCDkn3lnPpPG7CDtD12yCNTpctWH+kMZuYjU55SvaDrN2uj3vE6eKoqy6vukoAC5twOBPU2vHYnL8BHdMFOkdXCEM2W6NgP5gFj9aLrQjukGA/ctpfEFSiNLQj3xHHaUA4XRTKH5hIsNAW+KOr7C6IJ5u/56QUbhLZudA+/f9jrKeyKXolIHrj+KEHuPzs2vf/yGQgwA/Jr6AdDbRFi0XfqHlCPWtdDgDt3rntb JUjFCD3Hy1/JhwU9VGkyXyaPQuKyCoF6fpwdtVfTmEZ8DaKOZJBkmg3JkavVRiM8apEJDgZVDEovwKZUD+xUNnAXT2MMXwyuPY X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d666848-dd7b-4d01-b062-08da5e95a733 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2022 14:50:07.4198 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: nP74jvf3ZUr5Vb01QfwXeI1P6eHhpbVhNyIP/GPt0gaabwfJyri9Ov2qhnU/B+UkPPmjEigMR+4zTIEgbLxlEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR10MB1779 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517, 18.0.883 definitions=2022-07-05_11:2022-06-28, 2022-07-05 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 spamscore=0 malwarescore=0 phishscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2207050063 X-Proofpoint-ORIG-GUID: Y-caWLgDTZlAPrMgGcKgBNCNBCiMjtV1 X-Proofpoint-GUID: Y-caWLgDTZlAPrMgGcKgBNCNBCiMjtV1 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" Xref: news.gmane.io gmane.emacs.bugs:236124 Archived-At: > >> The docstring of `completing-read' says the argument INITIAL-INPUT > >> is deprecated - yet there are over 30 nontrivial uses in Emacs' > >> own Elisp sources. So, although we currently don't want that this > >> argument is used just to insert a default input, it's sometimes > >> not possible to avoid using it. > > > >> + for POSITION.) Don't use this argument to insert a default value > >> + -- use DEF for that. You can use INITIAL-INPUT, for example, to > >> + insert a prefix common to all completion candidates. See > >> + `minibuffer-with-setup-hook' for a general method to prepare the > >> + minibuffer. > > > > It's an improvement on the original text, but this makes it sound like > > inserting a common prefix is something callers are expected to do No, it doesn't. Or rather, why do you think so? > > (But instead it's a super rare special case that virtually nobody > > would actually do in practice.) No, it isn't. Or rather, why do you think so? > > So I'd rather just remove that sentence about what you can > > use INITIAL-INPUT for. Uh, the point of the bug report is to document better what INITIAL-INPUT does, in such a way that users can understand what it's for. > Or say that it should be used in rare cases like a common prefix or a > cons cell for the history argument. The docstring would be then more > in line with the reference manual (the common prefix part has be to be > added to the reference manual, but that is doable.) I disagree that you should be claiming that its use is or should be rare. Just leave it alone, please. I disagree that it's only about a common prefix. And I disagree that, even for just that particular use case, the case is only about a common _prefix_. And I disagree that it's even about _any_ common bit of literal text. What that use case is about is text that _can be useful as initial input_. That's all. Text that users can edit easily, to put to use in the current _completion context_ (which includes use it by completing it). With _prefix_ completion, yes, insertion of a prefix is useful. But even then, the most useful position of point isn't necessarily _after_ that prefix. With other kinds of completion, other "common" text can be appropriate - a common substring, for example. It's not that the text to be inserted is necessarily, literally "common" to all or many of the candidates. It can be that its _completion_, in the current context, is common to some or all candidates. And even that's not necessary. It's only about some usefulness of having the particular text inserted. In general, that means usefulness in _editing_ it, in the broadest sense -- doing with it -- to some advantage. The uses of `completing-read' are many - it contains multitudes. The text suggested is fine. It doesn't go into all of this. It just says "for example", and the example of common-prefix insertion is sufficient. But if you can't see why/when/how what it does can be useful then just say what the INIT arg _does_. And make clear that it's _not_ about INIT being a substitute for DEF. The two are different and independent, though they can also cooperate -- be used together to advantage. Please don't spread a prejudice that INIT is only for some bizarre, "rare" use. Plenty of optional args in Emacs are _truly_ used only rarely, but their doc rightfully doesn't try to steer users away from using them. There's nothing bad or dangerous about using an INIT arg with `completing-read'. It's high time for Emacs to relax and get over it.