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.devel Subject: Re: [PATCH] Re: Other details about completion. Date: Thu, 07 Apr 2022 20:57:17 +0300 Organization: LINKOV.NET Message-ID: <86y20g93pe.fsf@mail.linkov.net> References: <20220405232013.5y5jnr4ykzqgxqla@Ergus> <86a6cyiqlt.fsf@mail.linkov.net> <20220406132108.evlofp5l3krsl5h7@Ergus> <86sfqqduon.fsf@mail.linkov.net> <20220406181339.iubahj6fviq3fyqv@Ergus> <86o81eawnv.fsf@mail.linkov.net> <91135A5B-17B9-4B1A-AFB9-40D2656313DE@aol.com> <86ee29pawb.fsf@mail.linkov.net> <20220407090845.rvjzos3pp6f77qrz@Ergus> <867d80c00z.fsf@mail.linkov.net> <20220407172201.qwggexthtersxi7x@Ergus> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2485"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: Philip Kaludercic , emacs-devel@gnu.org To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 07 20:09:15 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 1ncWZH-0000TH-43 for ged-emacs-devel@m.gmane-mx.org; Thu, 07 Apr 2022 20:09:15 +0200 Original-Received: from localhost ([::1]:48416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ncWZF-0006Np-JE for ged-emacs-devel@m.gmane-mx.org; Thu, 07 Apr 2022 14:09:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncWXf-000540-UZ for emacs-devel@gnu.org; Thu, 07 Apr 2022 14:07:35 -0400 Original-Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]:42249) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncWXd-0005M1-V7 for emacs-devel@gnu.org; Thu, 07 Apr 2022 14:07:35 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 374021BF203; Thu, 7 Apr 2022 18:07:27 +0000 (UTC) In-Reply-To: <20220407172201.qwggexthtersxi7x@Ergus> (Ergus's message of "Thu, 7 Apr 2022 19:22:01 +0200") Received-SPF: pass client-ip=2001:4b98:dc4:8::228; envelope-from=juri@linkov.net; helo=relay8-d.mail.gandi.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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:287897 Archived-At: >> So why do you think that switching to the Completions window >> is required to select a completion candidate? > > Basically because we don't need that exact behavior in all the details > as our use case is a bit different different (and simpler). we use > single commands most if the time. I mean, most of the completion we need > are for single commands/candidates/files because we can't do things > like: "M-x find-file /my/file/path" in a single line. (there are some > exceptions line shell-commands or so... but those are the exception, not > the rule) > > But also because emulating that from completions is straight forward > considering that Completions is read-only and any edit attempt (insert a > letter) will emit an error we can handle moving to the minibuffer and > executing there whatever we need. > > zsh adds an extra space before the letter so even if it does not leave > the command line completely there is a switch to a state where arrows > navigate, a letter inserts a space and C-g restores to the initial... So > there is a mode and context change. So inserting a letter from the Completions buffer is the only thing that you miss from zsh? But you also said above that this feature is not important because such cases are rare: "M-x find-file /my/file/path". In all other regards, currently it works exactly like in zsh: 'TAB TAB' selects the Completions window, and C-g cancels it. >> But in zsh and wrap to the top/bottom of the same column. > > Yes, I already implemented that and you didn't liked because it was a > bit long ;p... Now this is getting longer and longer.... Indeed, its logic looks complicated. But maybe we could implement simple rules like in zsh? Then ans in the Completions buffer could be bound to new commands. >> Also in zsh TAB moves vertically when columns are sorted vertically. >> Shouldn't TAB in Emacs move vertically too when 'completions-format' >> is 'vertical'? > > Actually yes... But implementation will be long and ugly... I don't > think it worth it... > > The ideal case may be to have some modes completions-vertical, > completions-horizontal and completions-one-column that will handle all > the pack together (bindings, order, formats)... but may break some of > the external packages. Otherwise we will end with a code full of if-else > and hard to maintain or extend... Looks like the right thing to do.