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.help Subject: RE: [External] : Re: completing-read depricated initial-input Date: Thu, 23 Jun 2022 16:30:01 +0000 Message-ID: References: <86r13hubaw.fsf_-_@gnu.org> <86letphfke.fsf_-_@gnu.org> <86mte3lsj2.fsf_-_@gnu.org> <871qvfoce1.fsf@web.de> <865ykrzigy.fsf@gnu.org> <87tu8bmnzf.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="1861"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Christopher Dimech , "eliz@gnu.org" , "monnier@iro.umontreal.ca" , Help Gnu Emacs , "carlmarcos@tutanota.com" To: Michael Heerdegen , Arash Esbati Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 23 18:31:54 2022 Return-path: Envelope-to: geh-help-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 1o4PkI-0000EZ-34 for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 23 Jun 2022 18:31:54 +0200 Original-Received: from localhost ([::1]:50660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4PkG-0005mp-Se for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 23 Jun 2022 12:31:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4Pie-0005mR-FS for help-gnu-emacs@gnu.org; Thu, 23 Jun 2022 12:30:12 -0400 Original-Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:44046) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4Pic-0002T7-Io; Thu, 23 Jun 2022 12:30:12 -0400 Original-Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25NDstBx009474; Thu, 23 Jun 2022 16:30:05 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=IGXsIt7LHJ8gf+c55vQ8XnJrdJ8pmlZQ/9B9qULCkio=; b=aeWPAUXgDviKxk1xcQs/KytyYSIP6aZTYDQdNB5dLWFp0507NjayrFr3i+Y9eyf11pjv bqxKSMiEnr0PO0++cwEdoe39rKPcmMoiB+vtFzGUJ60P5YsF3+DokDb4biXiDKRbAkBk LEHzHredf9UCN25H0tzTM8luu9F5SkSTc+q5f0P9N3HS3V5C2txDKnOxChArhYpfay/X YV13+ctGEq4p4fYJKhAdcOmHZv6M7vaNwDWp5wLi6c5swhoh5u9sUBPxRaDrPjRDCL/L sj9hCGO4ls38uu7eQa5/5eIN6aigRuWm9Tuqx85fjZhU/GtkunruwOCWHOEIzUC/DV+f Lg== 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 3gs5g23rgn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Jun 2022 16:30:05 +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 25NGKgB5013879; Thu, 23 Jun 2022 16:30:03 GMT Original-Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2109.outbound.protection.outlook.com [104.47.58.109]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gtg3xjpy3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Jun 2022 16:30:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lt/mXQv6Cxx9zEYlIj+nSxhJcJbUhGPU8yLX9SHazaUOTGjoxmNE7Yng2pHBZYhAi0FuOqradkPSdUVWzc5AcoHV/mgZ7HD1phPvawGWT9/eiBmj3PWqliBZKAkdx6lWbEhC/9aF+XVNAKk83ocZCnqdGc5ANHsvSjZQJ91YmbIepad9Kw4x2FOaiHeBzE9AJgxjZXH2J/tMIh5ZEacVWph/GctVwnSaeJuz24UdFiBh9CglZdgnfzSvPNc7idMnh9mQU3wivHTJkdowH+FOZ92HJbhV5XkgNCgy8SRvooeaRU9gt6LCTmCseZuKWoDmjP8Kgfu17vMP+Z5gC3QdgQ== 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=IGXsIt7LHJ8gf+c55vQ8XnJrdJ8pmlZQ/9B9qULCkio=; b=LXRXeOFII+DC4TTtnQ5emzr0kxNU1zb8+xD9b1S6s8hwWjAzaAvsxARvXKvGf1ulvXZtJJ/8gRrwD9bJdf5IUfw2JidVpW3dH1SMh4RlGIxj71FUAx+dsldfHvv4BJgcSA/g/U3LFxRtwXciekfl154SwcUFKIwlt7PTcV6C5MCM9fK39D9CAVSRgZKqmw7m+qyd+XC9i+ycPTtFJ6mG3rTMBakz90Q5kBvIFECLKXCYL6UnMdsSKbV2pUWJYslQA54SoBZ99ghMSzeGUO+H7kY2OEYcd1nWufLhNEo6SbmzmKUqVflVUAnVob5Hq3POgDqQijb/YPYW7/GfPVQx+Q== 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=IGXsIt7LHJ8gf+c55vQ8XnJrdJ8pmlZQ/9B9qULCkio=; b=zV+W8GJ8Wf3Ap+HzmJ/mWchOrL14T2IGi985ggHq89gylCig1gTHt5G9VnCkqufdti66B3DVmrz154TrzyppdmDWeO+gWxg2qjkuh/qVteEdJi0Tt8WOrwL3aDlnbfUHmzS/N8M9DYILrx2Ps34iElL1zMJZh3EglptBnq9DhGQ= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by DM5PR1001MB2411.namprd10.prod.outlook.com (2603:10b6:4:30::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.18; Thu, 23 Jun 2022 16:30:01 +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.016; Thu, 23 Jun 2022 16:30:01 +0000 Thread-Topic: [External] : Re: completing-read depricated initial-input Thread-Index: AQHYhxDN4Q4j1GWVskSQhIfdOkqZia1dIbxA In-Reply-To: <87tu8bmnzf.fsf@web.de> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0a234659-ece7-4b33-ecb0-08da55359f19 x-ms-traffictypediagnostic: DM5PR1001MB2411:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: snM+Tikpu8l+nHqn2PGPp7nUYx7ICF6nqwnchZ7YbEbX5ezpq6yGEJ20snwurgSBODkorGQR7EsfMbijpt+oUCt/PiuGJ0C2eTfX84KI83ecEccyUkfwhwZPd/+iPTCFc7OSLBUqJ5qKYjfp5rZJc75AoKaG2zWM9pe7y4XzzB1aZ28fdH1FqyxCoYXoY6J9mCp7hBOc0d7bOb2F6Y+VD8qQY6E4iySklMmB8XjeBZo/cAHIG6W2nTzTbSErHU5z2RXdT7XH7hGcsgpVQYrhkL+QTW/Ijgt+Ism0XKpwn2u+ngFiqumUsjjspJo1ZyXPwlmpSo5oEuOtMRiUPG3J8hIi3I7+kaI03RXSLzo0vfGad2xxla6tYlJSKgkpffBj2fPsbLDMlgZsqBpKR6/wTlokypq24MScuzOj5ClFl9EAt4iddVnRDD/X8lI1YGolmIaFv55wxanqot91l2BKe5BC6SHyahriFW//oqcNPRa5JPLGz0Zh4BeXZeke+9EW3NH2dbWdsmPigiu9qJT3xcW44hlOcn9dqoaDVMrspGHNkbC79AmeQQRev1XL1mcljvCNqq3+FnArrZliqqEBDece8C7tbAbhw8+vqcEpiHBbVMyqrAwD+uQHbcdC00Cc7SMCBqNNlZ8kCyoMWEoTNI+BJAnD0UfcLTaO1BsBbPyjVMPjCRE5oz9WKvvVEIddI6+0oO+j4ILB/vR2+CGG9rhFwvIWOCYAdFw76cLaDr0Jp9r+tX/sbC/X/if9N V/NV2dRs3tfxwPmc2rFKz/+efFsxrJK5B9blkPMns8nLrc= 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)(346002)(376002)(366004)(39860400002)(396003)(136003)(66946007)(4326008)(8676002)(71200400001)(38070700005)(186003)(66556008)(66476007)(316002)(38100700002)(54906003)(122000001)(76116006)(478600001)(86362001)(41300700001)(66446008)(64756008)(52536014)(110136005)(8936002)(26005)(55016003)(2906002)(33656002)(5660300002)(44832011)(6506007)(9686003)(7696005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?255py1q4PQFTH6xYUF8bOVpJzUQSwRbib4pI4DvG441I4C8sKuFJnqXnKuCG?= =?us-ascii?Q?gc3qip6HwVjTSNXGh+nFc+aNc/+Dw0ebRObDZnmSKnbLMigZ8680j9dDaxEr?= =?us-ascii?Q?Z3hJRO0jUuKqYg7rIE1kOlTpigHJzua+SS0AY3Wu+Yeu/LAjEl/TtFCoOvDg?= =?us-ascii?Q?qO7ES019jA9CVRREr7ibXHlOAqki4y7837a1J/rNOVf9Cspe3hW8Fye3niau?= =?us-ascii?Q?8/VeeRtW9j+G+aQO6vCEdTMb31dP1MZQbNsy3C4IcTAM5Rn3sxFH7lFrzJme?= =?us-ascii?Q?d7iPkMMfWB9WB628nOooHkhFUG+mZo2KKNQWWcomG2sAyDfx5Mwjp4oGk4Gr?= =?us-ascii?Q?Ry+zO0HOgB+87AWbqRgM5RJO0xUkhDFj6GoZFs2OCkE2YxPpC+AxPUjrqlq0?= =?us-ascii?Q?SHMl60Tf/znQsUjm00xQrh1IP8xvgLLCCbVzNxVPvYPY2vdshQfoM91s/6qX?= =?us-ascii?Q?8r+JGGiNb0tdH2hMvHDxNIUY+7hp+onfS9exFdOUMV68ZxrgBCTT/rssvmd8?= =?us-ascii?Q?5opcnhYY0irDX8+WVaGRkwImpAGuJuXK1uHgEGUY7JqeDpCij+wdjI8Pc5/4?= =?us-ascii?Q?v/rbsCSqgcSjgf/wNPF0pk6+bvcjsuJqquhMFpQaup+YTpry9DEjkOFEyTro?= =?us-ascii?Q?co 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: 0a234659-ece7-4b33-ecb0-08da55359f19 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jun 2022 16:30:01.6938 (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: 5wmg8GXOL0amZAwWgh0s9u9av3btNGmSsmx4f66tF9MdUROgoaXPEwBvfo1b7M+ZhVwaz0EsOVTbFaGRZ59StQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2411 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517, 18.0.883 definitions=2022-06-23_06:2022-06-23, 2022-06-23 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=912 malwarescore=0 adultscore=0 phishscore=0 bulkscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206230064 X-Proofpoint-GUID: 1cwko5ERC5ffYW7gpE9uc4y4Qs_g-UtT X-Proofpoint-ORIG-GUID: 1cwko5ERC5ffYW7gpE9uc4y4Qs_g-UtT Received-SPF: pass client-ip=205.220.177.32; envelope-from=drew.adams@oracle.com; helo=mx0b-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: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:138029 Archived-At: > > (let ((list '("iffalse" "iftrue" "else" "fi"))) > > (completing-read "Macro: " > > (mapcar (lambda (x) (concat "\\" x)) list) > > nil nil "\\")) >=20 > A convincing example, in my opinion. Yes, it's a typical use case for non-nil INIT arg: inserting a prefix. And it's also essentially the case for non-nil `insert-default-directory' for `read-file-name'. (Try setting `insert-default-directory' to nil, and see if you like it. Now imagine if Emacs hard-coded the behavior as nil and decided to tell users that inserting `default-directory' is deprecated...) This case can arise if you use `try-completion' to obtain such a common prefix, and then you use `completing-read' to get the completion the user wants. Another example: (completing-read "Color: " (defined-colors) nil nil (buffer-substring-no-properties (widget-field-start widget) (point))) ___ Another typical use case is when the HIST arg is a cons, so you can insert a particular history element and position the cursor after it. This case is what the doc string of `completing-read' (misguidedly) says is the _only_ use case: (This is the only case in which you should use INITIAL-INPUT instead of DEF.) (Our docs shouldn't use "should", BTW. ;-)) And it's not even necessarily a case of "instead of DEF". Using INIT here doesn't exclude also using a DEF value.