From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Stepping Back: A Wealth Of Completion systems Re: [ELPA] New package: vertico Date: Sat, 10 Apr 2021 10:09:54 +0300 Message-ID: <83blam7gzh.fsf@gnu.org> References: <9c9af088-580f-9fb1-4d79-237a74ce605c@inventati.org> <874kgkxxs0.fsf@posteo.net> <78741fe6-2612-d7c9-2bc4-0b68ea7fa51a@yandex.ru> <76a4d0e2-117b-165d-d56e-5bc2f504b50c@yandex.ru> <87blapln0r.fsf@posteo.net> <37bd2e96-ce04-eb6d-24da-fdd7ea427e61@yandex.ru> <87im4wx2ct.fsf@posteo.net> <83ft0080hi.fsf@gnu.org> <16784f40-b959-9a84-65d4-93b71d1bebec@yandex.ru> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31502"; mail-complaints-to="usenet@ciao.gmane.io" Cc: philipk@posteo.net, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 10 09:11:16 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 1lV7lz-00085s-K4 for ged-emacs-devel@m.gmane-mx.org; Sat, 10 Apr 2021 09:11:15 +0200 Original-Received: from localhost ([::1]:41338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lV7ly-0008BW-IS for ged-emacs-devel@m.gmane-mx.org; Sat, 10 Apr 2021 03:11:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lV7lE-0007c3-Ms for emacs-devel@gnu.org; Sat, 10 Apr 2021 03:10:28 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40681) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lV7lE-0002Di-Ac; Sat, 10 Apr 2021 03:10:28 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4686 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lV7kv-0000GN-4K; Sat, 10 Apr 2021 03:10:11 -0400 In-Reply-To: <16784f40-b959-9a84-65d4-93b71d1bebec@yandex.ru> (message from Dmitry Gutov on Sat, 10 Apr 2021 02:12:51 +0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:267772 Archived-At: > Cc: philipk@posteo.net, emacs-devel@gnu.org > From: Dmitry Gutov > Date: Sat, 10 Apr 2021 02:12:51 +0300 > > > I don't think I understand how xref-show-definitions-completing-read > > is different from, say, read-file-name. Can you explain? > > We've touched on this previously in the poll/discussion about the default: > > https://lists.gnu.org/archive/html/emacs-devel/2021-01/msg00029.html > > The values which xref-show-definitions-completing-read asks you to > choose from are relatively complex, and hard to type out. > > Further, there's often only 2-3 values to choose from (in the Elisp's > case, at least), so choosing the first one should be a frequent enough > occasion. > > With a selection-based menu you look at all options and make a choice: > often just press RET; maybe press TAB, or C-n, or a few times > before that. > > With completing-read, you have to press TAB first, to see the choices, > and then type some of your choice's contents, keeping in mind perhaps > its distinguishing characteristics. That's simply more effort than the > other approach. > > File name completion is different because you're not as likely to simply > choose the first option, there can be a *lot* of files in the dir, and > typing an average file name is much easier. > > Mind you, I generally prefer completion UIs that show the options before > you start typing, but xref-show-definitions-completing-read makes a > really strong case for it. Which is unfortunate, because otherwise it's > my #1 choice for xref-show-definitions-function's default value, and > changing Emacs's completion UI is not in the cards in any near future. > > So I would only be happy if you disagree with this assessment. I think our interpretation of "completion vs selection" are different, at least to some extent. For me, completion is for when you (almost) know what you want to type, and type enough of it to have a single TAB more or less do the rest of the job. IOW, it's a typing-saving tool. Selection is for when you don't know what to type, and need the full list to choose from. IOW, it's a discovery tool. With that in mind, completion for symbols in invoking M-. and completion for file names in invoking some file-related command have the same traits, at least for me. Where selection is needed, we pop up the XREF buffer at the end. This default operation makes sense to me. By contrast, using xref-show-definitions-completing-read, I'm asked to choose twice: first in a "normal" completion context, then again in a strange way (it says "Choose" without showing me anything to choose from, and I need to type TAB to see a *Completions* buffer). I guess to each their own, but the latter method strikes me as weird and inconvenient. IMO, its place is in Company-style "completion" when writing code -- there one would like to see the list of pertinents alternatives to select from without typing anything, not when the user invokes a command and needs help in typing as few characters as possible.