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.devel Subject: RE: [External] : Doc of deprecated INITIAL-INPUT arg of completing-read Date: Mon, 27 Jun 2022 16:33:34 +0000 Message-ID: References: <87v8smt9lp.fsf@web.de> 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="11209"; mail-complaints-to="usenet@ciao.gmane.io" To: Michael Heerdegen , Emacs Development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 27 18:41:59 2022 Return-path: Envelope-to: ged-emacs-devel@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 1o5roE-0002dn-ML for ged-emacs-devel@m.gmane-mx.org; Mon, 27 Jun 2022 18:41:58 +0200 Original-Received: from localhost ([::1]:54684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5roD-00056d-4c for ged-emacs-devel@m.gmane-mx.org; Mon, 27 Jun 2022 12:41:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5rgH-0002Kz-1t for emacs-devel@gnu.org; Mon, 27 Jun 2022 12:33:52 -0400 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:20806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5rgD-0004m2-DE for emacs-devel@gnu.org; Mon, 27 Jun 2022 12:33:44 -0400 Original-Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25RGDmU7013041; Mon, 27 Jun 2022 16:33:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=t5h/LdSvoapFWGVJMIkEGKfmlHOoP2wbgEXNrLWMqxg=; b=aOVYCdq+49p3TLL1fjdGYSwUSwFaRxZHc/xho1W3uGIuTRNxFU9xh2CCRj8YeemHVfZN 1bQiexsliHgm6TA5SdILJdczSjpUONcwXhxMpeGazVvIbU6TdF/OfMOarNNbadkeAZ2R VuPqXc4b+BD3sfv/LWQWno30cV1HO3OEXmTzJQ2e9NmPuVYAw9Zln3+Xr4R6fUsD7svh n5lOH8UbL+Q1kwjW/0hofasKFxYbdl6Q71cuHMaFb2PhHCuREWbhnX8Dql9sgsfkWSdf +pPFTxW9lBTFlSeAoNMsVKlKTK2JUza52Kdxd/4+LHAE+yLYN6YgPDacFgTY4kZvYZXV oA== Original-Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gwtwu3sb8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Jun 2022 16:33:37 +0000 Original-Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 25RGKr4P027508; Mon, 27 Jun 2022 16:33:36 GMT Original-Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2173.outbound.protection.outlook.com [104.47.56.173]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gwrt1ryfh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Jun 2022 16:33:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WVmPP3aaVatg/Cp+99dq8P/T8K4TwS7tvcbrGggzl7IpF+6qJxccK1GcJeNGPAdrx8X3+IuZG1rRiC+LZ+o67QSybggIc7Sv2dv0mxf6j1ikHrbtLkzFwe7UleG1x6JmVpHQgkMMlMTjlCnqpsVNiNXDa2zl68kNPIf49fFe92nJvG6Vvxshao6s3Qc8cpLUsFXmattWP9s015LABeUchzAci8gZQ5WFVJd/Vihf/qX58iHHzIxt1iU7M0SFMW1iEo9CK/7M/2ATqG4PUQ6wvy5JvwTwuO4kxkmJnMHL7h6kA+6Ko+5nid6YqLYrsthNY1deSUQs1M6jIuXnm2EiBw== 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=t5h/LdSvoapFWGVJMIkEGKfmlHOoP2wbgEXNrLWMqxg=; b=YdgwrzFPgeGuCy35MgHosB3EnJex/dw9+Rdd9Bt8kBihPbNd1sTjF1ybuuOBiwtors5DZbl6bKIH04m2/mQRHWIOh9P24gXwWN1eGb8j4Ox65L3aLyvFDTLAEAwG9zYRcHJw1SBmS23FRNkBN6djdLoC1looxqQOwgYYTSSjo8akB/UAPGGDudQs1c5TtlMi3LbnWsCIR14iKW4yP0LBh6/DUHxWWmxtFVzBEsjdPMXKSgH7myO6HbKW/Iz57d09AcdvhcyiNfvDlkKa5I8B5JBxp23kKJQl1wD6yeouuj9wlHonuQUSiUzYxjG9UKXwP6K4uJje28laahZT+DYPEw== 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=t5h/LdSvoapFWGVJMIkEGKfmlHOoP2wbgEXNrLWMqxg=; b=WbgspeXxGYRbOVaGQF1K5LgAIh8onFZuZV8skNcJGPYulgL6zhCVE+6RQ4GHV4iWypc7cPGIwWNWEByIoQl8L5bjSFaXqyiuXlhxlfSd+cJGt+kfjxyAsaqqPmUlY03HkKOM/mvfFnIZ3Aha1w3f2kAc6mFRez1OErAp95lUcOg= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by DM5PR1001MB2138.namprd10.prod.outlook.com (2603:10b6:4:36::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.18; Mon, 27 Jun 2022 16:33:34 +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%6]) with mapi id 15.20.5373.018; Mon, 27 Jun 2022 16:33:34 +0000 Thread-Topic: [External] : Doc of deprecated INITIAL-INPUT arg of completing-read Thread-Index: AQHYijnNg+l5ho91RECHr5pMSHCwY61jYd7A In-Reply-To: <87v8smt9lp.fsf@web.de> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5b3627ab-7600-4f5f-f958-08da585ac763 x-ms-traffictypediagnostic: DM5PR1001MB2138:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MDp303tTr1vDPifsZC5DjWGUhVUNGrJ4CuX+kltC3r5pTjhOHGRrAxL1QC2QC67PuK97792GS9w2zeOsSb29XR50D3t9dYB5owkI174lHrtpncvDkWBG/q0cNNBbBs6QDYyJNVJ6aLXqF/r2+T78TKJ0S5elnkupSmktRdFSTBer/2FLf4vtu8fqVCYG1DKB8/3Lr26Y3rDLouCUlAAc/aT25YZeujsUsRKLBwS333dCi3wN8ZFvo8IH7L1gDQ5OGSpvTU8mLF0amyhVm1QOQjvFPRr928kGpbAAdeuYO3rcLrlEMrLLdCJDb8WlYlPSFlqr3fM5jtlIO7S8KzdG/lZlGJJa23r4NyYyuy9oA4Xp9q+endJLtdElqQ6gI0ESwkSUVwhr30k7vjbNoiRWyQDrpr9eH363RIxJGdlBl9spwJSZ8S2iqvPZvKYfv8WTKyO90vpRBSltw+H1P8H/qi+IPhS1QG2W++CBP2GwD+geg4CumlBNobGmWnz/OtNTb5W38JaUtVipvQGxv/mVLoMD4NJL8LpOKHzKVboBH8HzlAuuDfCZMhKbal9xbLkJXbxCTJ3gfsppnb5v6w9uEHSlfdTqPs9Bf4RYj4L8upUc55R35/q8NypBJsXQrRACWSAPerxuVm0oeTq/G2LibXYSPEJtTd1PU/vtYzvf80LPzzkCTBUMOgo3YRMuKV7vxz4lSMsQnLHfBUXDOg40JS/ohViugf+GPTLntwgqrjg/cNzNogl9053++ds0L ONoskdng/L20Pi7dn0myEVHlbz7i40xzgxsf6T1vZui5Mw= 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)(136003)(376002)(39860400002)(396003)(366004)(346002)(6506007)(76116006)(41300700001)(86362001)(122000001)(33656002)(7696005)(478600001)(38100700002)(66476007)(83380400001)(66446008)(64756008)(9686003)(38070700005)(66556008)(26005)(66946007)(8676002)(110136005)(44832011)(5660300002)(2906002)(8936002)(71200400001)(316002)(52536014)(55016003)(186003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UystXgTubvPZ1mTr7W/TIwupUygRF+Qg1tgJbpSKYgWOrn0/twOkPZHaapxP?= =?us-ascii?Q?lnj808Rz2t+ZKUvH7a6LYodtlesKK4RPQ4CAKqFaYJGoyWT8qNJAU6On8Lrw?= =?us-ascii?Q?UrweApGYdobqg3wdX0aQohQv56jcS82a1lS5cfOP3lnlj8pV7m++thPpwruv?= =?us-ascii?Q?7fPV7k2wzgBlOlvv9GAvjawpDDw9t/+tnELdN7ZGDnQReo7/dH+jZgBxNnZD?= =?us-ascii?Q?2ndKIkxsxS75spM+hgaJiqTPrei9nW1xsCL58a7yuArRvlJ3fJqFZqDe12V2?= =?us-ascii?Q?uD2bV/i+mjjeHdprjyKqjbxkC7XZe5yJ3W6vA0Up3KCyKjsWxJerV9uYXvgG?= =?us-ascii?Q?YA1FcdG7oAdr+pvXZT9cS1oDtkxl/nQATiQAUzyY1A92xTf3Tf4qvEbopKUE?= =?us-ascii?Q?D+jBPGwYtERrMTySAJ3s7yP18NWbNco3+9zO27JeLU37JIS86wYtmbQnZcXk?= =?us-ascii?Q?3lpiOPEbd8X2ijoGVN6zWNnycMuZLfPRYg+A/Bbc/+tHyYOPf7Vdn0BtKFFY?= =?us-ascii?Q?+9gQ1SVgjsgN+YcLCIFIripwZQ0FB4QFyQqzqWdvnTudxHvVuwHDLNsMh3cR?= =?us-ascii?Q?S/weQMStkTMetVn27/agzHVJSjeOgq7psBQdFqrELorHlRt6wSZSdOi3NDXH?= =?us-ascii?Q?7J 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: 5b3627ab-7600-4f5f-f958-08da585ac763 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jun 2022 16:33:34.1709 (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: muPJ3g4jaJhOdcXoFK+92dQYItrlHt3YuCLvwPrs1JSOul4bTTkyWqbuTgv0riXQ5rhpJz6HW4/C1gPgbTGYNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2138 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517, 18.0.883 definitions=2022-06-27_06:2022-06-24, 2022-06-27 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206270069 X-Proofpoint-ORIG-GUID: oOjB-QRG1mozYTWM_LgoJAF2WnGcRvrE X-Proofpoint-GUID: oOjB-QRG1mozYTWM_LgoJAF2WnGcRvrE Received-SPF: pass client-ip=205.220.165.32; envelope-from=drew.adams@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:291666 Archived-At: > there was a long discussion in emacs-help about the INITIAL-INPUT > argument of `completing-read'. Among other things people complained > about the argument being deprecated. >=20 > I agree that it's not good to use it in nearly all cases, but there ARE > a few cases where it hardly can be avoided - we have over 30 uses in > Emacs itself. So I want to suggest to change the docstring to warn > strongly about the usage of that argument, but stop saying it would be > deprecated. >=20 > This is to make the current state of the code more consistent - I don't > plan to work on changes that had been suggested in that discussion. >=20 > So would this patch be ok to install for now? FWIW, for my part I disagree that any "warning" is warranted. There's nothing dangerous to warn about. I disagree with this (as I also disagree with the deprecation): Using this argument is strongly discouraged--it is ^^^^^^^^^^^^^^^^^^^^ normally best to pass nil for INITIAL-INPUT and ^^^^^^^^^^^^^ supply the default value DEF except in few special ^^^^^^^^^^^^^^^^^^^^^ cases like inserting a prefix common to all completions or an initial part of a file name. There's zero reason to discourage its use in any blanket way, let alone "strongly" discourage. INIT and DEF are different in behavior, and thus in use cases. Telling users to use one of them _instead of_ the other is misguided, IMO. All that's needed is to make clear that INIT isn't intended as a _substitute_ for a default value - and vice versa. That's really the point (IMO). The use cases of INIT are different from those of DEF. That's what should be made clear. Then leave it up to coders to use each as they see fit. ___ But the confusion over their different uses is related to a missing feature, IMO, which is the ability for users to automatically insert the DEF value (not INIT) into the minibuffer, as an alternative to using `M-n' to insert it. Neither alternative is absolutely "better" than the other - this is naturally a user preference. The mistakes made in deciding to deprecate (or discourage) INIT-INPUT are two: (1) confusing it with a default value - DEF is no substitute for INIT, and (2) thinking that it's never a good UI to insert default values (DEF) in the minibuffer. #1 should be fixed by removing the deprecation and explaining the difference between the two (not by warning not to use INIT). #2 should be fixed by letting _users_ decide which DEF-inserting behavior they prefer: (1) automatic or (2) manual (`M-n'). The choice of whether DEF should be inserted in the minibuffer should be up to users. It's not for Emacs to decide for all and always which UI behavior (auto or `M-n') is better for everyone. If a user often wants to use (edit or choose) the default value then s?he might well want it to be inserted in the minibuffer. If a user rarely uses the default value then s?he might want to insert it only manually, with `M-n'. That's really what it comes down to: having to delete DEF manually, if you don't want it, or having to insert it manually, if you do. (This is somewhat akin to the choice of whether to use `delete-selection-mode'.) In the help-gnu-emacs discussion you cited, I detailed what I would propose for #2 - I won't repeat details here. I'll just say that users should have some way to choose whether DEF is to be automatically inserted in the minibuffer. (I also said there that they should have a way to choose whether it's inserted in the prompt. With my proposal, when DEF's auto-inserted in the minibuffer it's not inserted in the prompt, but users can also choose to never insert it in the prompt.) In any case, a missing insert-DEF-in-minibuffer behavior is 100% _independent_ of INIT-INPUT, which, yes, shouldn't be deprecated.