From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: completing-read, empty collection, require match Date: Sat, 04 Dec 2021 10:03:23 -0500 Message-ID: References: <4BB55705-49C3-45E0-80CE-2F56E2BD9DE4@stanford.edu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37194"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: "emacs-devel@gnu.org" To: Qiantan Hong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 04 16:05:27 2021 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 1mtWbO-0009Ux-7l for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Dec 2021 16:05:26 +0100 Original-Received: from localhost ([::1]:37104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtWbN-0004pH-73 for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Dec 2021 10:05:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtWZm-0003PV-6s for emacs-devel@gnu.org; Sat, 04 Dec 2021 10:03:47 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:55953) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtWZj-0000LL-Sa for emacs-devel@gnu.org; Sat, 04 Dec 2021 10:03:45 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 25A041001AC; Sat, 4 Dec 2021 10:03:26 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id CAF2810000D; Sat, 4 Dec 2021 10:03:24 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1638630204; bh=OSPySxCaQ4F5J71dkuuDhKRhaG10/TEMT0clgKTq3XU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=GII+V+iIjgM2IoprpyOEzAh5TsrdOXcPMrPpdD2W3NFmCAn7nNur2LJcqfuQurvPU rQN+l8yvReO32EIZ6uXw7BaS6eTjYUQgF0coBLkAZicmhFrxwGiApYR8yP0lJzIAwA LQXJlub3Rt2a/eK1LeDAdeef9eXsNvAnlNt3TCxcEAvjwDkRYaUTc2IiIY8NFXGl3/ FzgGNw9KVTiX4cf97EIi3u5/KEMJ8vEEmmac2mWMYFoFJIeZ7ZsPv3XRcV3kQk7xn+ kJ6wg8NYGPo7wPSwxuPtVABsUt7+N0k1EIIvtxgU+Yi9Uh82cbSa64+bssunCYA/6Y SKgDNUBr7AGCw== Original-Received: from ceviche (modemcable034.207-20-96.mc.videotron.ca [96.20.207.34]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A45921205F7; Sat, 4 Dec 2021 10:03:24 -0500 (EST) In-Reply-To: <4BB55705-49C3-45E0-80CE-2F56E2BD9DE4@stanford.edu> (Qiantan Hong's message of "Sat, 4 Dec 2021 14:30:09 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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:280922 Archived-At: Qiantan Hong [2021-12-04 14:30:09] wrote: > (completing-read "test: " nil nil t) > will pop up a prompt in mini buffer, pretend asking you for something > and then inevitably fail. > > Is there some rationale behind the current behavior? > Failing immediately seems strictly more efficient. Yes, it would be more "efficient" in this case if `completing-read` catches the situation and signals an error, but I don't think such an optimization is worthwhile: the better optimization is to not make such a call at all. Stefan