From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: Re: RE: [External] : completing-read depricated initial-input Date: Thu, 23 Jun 2022 20:25:20 +0200 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=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24322"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Michael Heerdegen , Arash Esbati , "eliz@gnu.org" , "monnier@iro.umontreal.ca" , Help Gnu Emacs , "carlmarcos@tutanota.com" To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 23 20:26:34 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 1o4RXF-00066L-K8 for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 23 Jun 2022 20:26:33 +0200 Original-Received: from localhost ([::1]:56798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4RXD-0006MD-Rx for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 23 Jun 2022 14:26:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4RWI-0006Lz-30 for help-gnu-emacs@gnu.org; Thu, 23 Jun 2022 14:25:34 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:33181) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4RWF-0002xj-FB; Thu, 23 Jun 2022 14:25:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1656008720; bh=fTG9BpOz5YdsRkEnOK4icIfhlHKmU3jl6aNY78Qr94k=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=dI+YFtho17ao2+eHKC4DngTkXEGsamNdyVPYm5C9W6weBhu6Oo+axO3CkVNRmNa6x OHsvvCSBghipKH1xehLKjRDvl7ipodQ2LgKv4H4aIBgCpj8bs7ELapSDxxjcFRAPfg 3llOzxOLALfCza91r31ygsGnBaMg3naNrIiIdiJ8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [92.251.127.164] ([92.251.127.164]) by web-mail.gmx.net (3c-app-mailcom-bs07.server.lan [172.19.170.175]) (via HTTP); Thu, 23 Jun 2022 20:25:20 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:nUQb2WCCFiU5Y7D368uGEGIcq8Qj46qI6FEjSZg5lMSgZEtByqvGWgiT26+DvuqSVjWXR a5uuFi6hwx+9tnWtp8RG0YhfdWdt5ShAGYsF6erW6NSKa5Vt8bqmXMnYgpwL4HrvLybWOSoT4p7y vuy1wrtcKffLFWpqnuuw4MdYft5+Z7hQIkKzNcYLu0sqdmTLc3nyVYQ9Kz6J6zVHcQg8MiWyti66 w7uJyUQz7PHaFDB6UqfQYhySsXnj2K0z9boEepOAaS1kFSNQqV53CQQn90kfi546UhiEievtx46L Lw= X-UI-Out-Filterresults: notjunk:1;V03:K0:OnaCJxBc3IU=:X21k3pv+CKxg7h6P2qg+0s HVEy8ClE/hnqlWFpbU/8B9Kx/FSS5wiOgjFdzsT34LDzivLoS3zfNFQqdWHOnL6G7mBQMJma5 VeN5BKoMRk0nSy9sgqI6bOn42pJsD1+0Vd7uML8e9FKvSyA8LwlUs4x+6j+jYnpTQhVXsPdzv fQtAcBxgViTdMkmjLG0HjEjsLhM/QTyFEA90gzIr4wQUwitbdz+O18ByB9amWMGIqDbmpJfPp kMgN/wK83ZE5GXU3EabJL0DsNI+5q7IjmOObfvTh+79DJj7wnPJN4ouDk070Uvw69i+B561hN KnEMT35w09pMr5Agb53Y99wN7ODzrcF1nYkuMGstSQTPf37xcLDe5Z1LpZjZvnTNSBJjRWvO3 2EiJWx+AqIVP1xDi2simcfnfcGgAfggnU6KzJe/qFJ/QRR+bJjiVJiLqPvFlkVrPkQaEzaBIx j/GlPPBP1dPD+TAAagBuwRXmI2TFnDqoP28LuEX/pCVv0BgNC0NlRBmMldWDaRag88u9yNwIv z4nhDgdsfjCPtX5pA4Q9kEwv5mxpLKSGvqCe2zXFs+o3aInrZQGVELWF9ZTPdB8SPwPV6WSHo B6/GY6ADI8RK4vU66N3GcOfoI2aVBVeZ795ivr7aO7byuOSIhP+e39w2SUKkQo0TxW5hCXI6R TcnF19QqiDkcc/8wqqOLHf+gibTnRVl+HSR+XbM/R518rqB4DrAXjaldRORwbOE7xdIOq7hJp 4K7ceZQDlcheNejy5uNn16qWSot9kMdkfQ7w6P6xe9b1PD8rJqME8LGQa1m4sk3E7VvB6CBR Received-SPF: pass client-ip=212.227.17.21; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, 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:138032 Archived-At: > Sent: Friday, June 24, 2022 at 4:30 AM > From: "Drew Adams" > To: "Michael Heerdegen" , "Arash Esbati" > Cc: "Christopher Dimech" , "eliz@gnu.org" = , "monnier@iro.umontreal.ca" , "Help Gnu Emacs" = , "carlmarcos@tutanota.com" > Subject: RE: [External] : Re: completing-read depricated initial-input > > > > (let ((list '("iffalse" "iftrue" "else" "fi"))) > > > (completing-read "Macro: " > > > (mapcar (lambda (x) (concat "\\" x)) list) > > > nil nil "\\")) > > > > 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. Correct, there are use cases for init and def to be different, and for who do not want init, nil is specified. But I do agree with the recommendation of not using initial-value, is not based on the existence of any coherent problem to elisp package success. Looking at in, the discouragement is deeply rooted around the use cases seen in many packages. And ignore the truly great ones that might use initial-value it future.