From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Stepping Back: A Wealth Of Completion systems Re: [ELPA] New package: vertico Date: Sat, 10 Apr 2021 04:56:52 +0300 Message-ID: <5d5d0152-bb07-1bdd-6370-9498d4e4b867@yandex.ru> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2574"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 Cc: Eli Zaretskii , philipk@posteo.net, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 10 03:57:52 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 1lV2si-0000Zk-5D for ged-emacs-devel@m.gmane-mx.org; Sat, 10 Apr 2021 03:57:52 +0200 Original-Received: from localhost ([::1]:60938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lV2sh-0003b9-7P for ged-emacs-devel@m.gmane-mx.org; Fri, 09 Apr 2021 21:57:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lV2rr-00039n-6C for emacs-devel@gnu.org; Fri, 09 Apr 2021 21:56:59 -0400 Original-Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:34494) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lV2rp-0000uX-9R; Fri, 09 Apr 2021 21:56:58 -0400 Original-Received: by mail-wr1-x42f.google.com with SMTP id b9so7304999wrs.1; Fri, 09 Apr 2021 18:56:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=eDfIqsWjtyqlKAfiwhsyH0mSz4xeye8wEDgHkvsXZUU=; b=jsD7Pnmcub+WhGx9XvSaqkv1Q3UtDD1CZbnE4fC7uRywMJWDMFgmUQycFz7KmmT5fX 0k0GwJc+mVKxFgnuE763APS011SjMZv2tTqN8cyLqew6t31LfeZYkt59B2Q/KdgEi3Qm pBqc/Ii2va0wDdblkUq7fOVqGG9V3LsuY6QWSACgHMIReiI3PUd00eHh6avh/bbD2iED O6i1tImK6CYIE+egw1mP9M4xRtsDjP5I2nDDr1seYhd3fZl7xRiiHRCQrpp2GVvKH5LU sbQcuLbJnxSrKZluYyAO0LEQ/x9WmNr9Cq0LA6Br2FI/Jj76ZQrn0fZO2OR5rnOfjYXU I+jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eDfIqsWjtyqlKAfiwhsyH0mSz4xeye8wEDgHkvsXZUU=; b=VjC/rEtWWv4KFxHzXPVaQNdRt2jbDPx8pO/9+Zu1KvGLucDVCml/lEuYHaZSBh8tm0 UisaMrVWEzZXYwnmpydzqu0f6TqEU6dgRPvvENH4Z/Z+eHrs9GiZsVAeLNeekarKheIR tgiKmmfXi2NVeBZQu6kreZfEv64P4i6OsxOHqpcnMTkxhcC5HybW+lRNy2m7q2nzgctC pfcWZutCkv2iW4H7WKr1Ddm46JvuNG7USfUz9q6S+aRsn8Ca+GEf0f3B0sAeo+8q9CkD yXigbe0jKH3lsFoiTckWPvq4Y6Q/vPCDxR6Uux7M/P5HLQnyTahBmKEYwSs0MDrSSivB Sdww== X-Gm-Message-State: AOAM532tbjcQURvikPaoWb8yXNeUAjaJuOmwNbvXq2sq/Ip39sbZS2NB dXXqpj8pUqtrUZO/gtwd0/FxpctiDl8= X-Google-Smtp-Source: ABdhPJwnK3g6X+F9DJ2yYvsmYJ2r1BO98DhlEw1f4Q8Rf1TBBGCLs9ZAP0hP4XWhPHO2MT8Mv1CqbA== X-Received: by 2002:adf:efd2:: with SMTP id i18mr21104819wrp.308.1618019814882; Fri, 09 Apr 2021 18:56:54 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id p27sm5921486wmi.12.2021.04.09.18.56.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Apr 2021 18:56:54 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=raaahh@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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:267763 Archived-At: On 10.04.2021 02:48, Stefan Monnier wrote: >> 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 it would be desirable to change the default UI just enough so > that a code like Xref can make `completing-read` display the > completions eagerly. The *Completions* window, you mean? It would still miss the ability to quickly accept one of them with RET. > One thing we can already do is to make Xref use a completion category > with an entry in `completion-category-defaults` which specifies a value > of t for `completion-cycle-threshold`. This way a simple TAB should > select the first entry. The result is... interesting. Not my first choice of the UI, but it does improve on the issue I mentioned above (while missing the ability to look at all options at once, which is particularly useful for the function is question). Does anybody feel like it's an improvement enough to make xref-show-definitions-completing-read a viable default? Here's the patch to try (though we might want to replace t with a number like 4): diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 5f594679ca..0ba55916c9 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -957,7 +957,8 @@ completion-category-defaults ;; A new style that combines substring and pcm might be better, ;; e.g. one that does not anchor to bos. (project-file (styles . (substring))) - (xref-location (styles . (substring))) + (xref-location . ((styles . (substring)) + (cycle . t))) (info-menu (styles . (basic substring)))) "Default settings for specific completion categories. Each entry has the shape (CATEGORY . ALIST) where ALIST is