From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH Date: Fri, 25 Aug 2023 09:59:56 +0300 Organization: LINKOV.NET Message-ID: <86r0nrvc7n.fsf@mail.linkov.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32460"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: Gregory Heytings , 65459@debbugs.gnu.org, Stefan Monnier To: Heime Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 25 09:20:14 2023 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 1qZR77-0008HJ-Jv for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Aug 2023 09:20:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZR6v-0000un-Cr; Fri, 25 Aug 2023 03:20:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZR6s-0000uB-Mf for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2023 03:19:58 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZR6s-00031r-Ab for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2023 03:19:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZR6w-0004nt-4o for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2023 03:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Aug 2023 07:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65459 X-GNU-PR-Package: emacs Original-Received: via spool by 65459-submit@debbugs.gnu.org id=B65459.169294799418448 (code B ref 65459); Fri, 25 Aug 2023 07:20:02 +0000 Original-Received: (at 65459) by debbugs.gnu.org; 25 Aug 2023 07:19:54 +0000 Original-Received: from localhost ([127.0.0.1]:39117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZR6o-0004nT-91 for submit@debbugs.gnu.org; Fri, 25 Aug 2023 03:19:54 -0400 Original-Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]:59475) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZR6m-0004nD-9x for 65459@debbugs.gnu.org; Fri, 25 Aug 2023 03:19:53 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id AE389E0006; Fri, 25 Aug 2023 07:19:38 +0000 (UTC) In-Reply-To: (Heime via's message of "Thu, 24 Aug 2023 13:19:55 +0000") X-GND-Sasl: juri@linkov.net 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268404 Archived-At: >> Heime, can you try that and tell us if it solves your problem? > > The behaviour is as it should be. Although we should keep 'start' to correspond to > collection index which customarily starts from value 0. > > Although I can use the function provided, I rather have all this incorporated in > 'completing-read'. Because 'completing-read' would benefit from it. Particularly > now that its use is being extended. This taking into account that my use case > is more aligned with its original operation, except that certain aspects which I have > shown to be important were not recognised at the time. After some focused attention, > Stefan concurred how I have been making sense, particularly after seeing how `completing-read` > actually behaves during the form of cycling I discussed at some length. Why couldn't you explicitly provide a list of default values without the initial value? This solves your problem: (let ((cseq '("alpha" "beta" "gamma" "delta" "epsilon" "zeta" "eta"))) (completing-read "Grapheme: " cseq nil t "alpha" nil (cdr cseq))) PS: Currently this can't be done automatically because 'completing-read-default' doesn't set a buffer-local 'minibuffer-initial-input' from its argument 'initial-input'.