From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: feature/completions-highlight-modifications e3c5b99 3/6: Add completions-highlight-mode initial implementation. Date: Mon, 16 Nov 2020 08:39:19 +0100 Message-ID: <20201116073919.vtntfpjq4inmco3f@Ergus> References: <20201115023629.19537.77471@vcs0.savannah.gnu.org> <20201115023631.C78AB20A27@vcs0.savannah.gnu.org> <20201115224943.o5r7lkkblmyt2ox4@Ergus> <20201116033719.63dryvqm4ozfer2r@Ergus> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3598"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 16 08:40:59 2020 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 1keZ8F-0000pM-I7 for ged-emacs-devel@m.gmane-mx.org; Mon, 16 Nov 2020 08:40:59 +0100 Original-Received: from localhost ([::1]:49528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1keZ8E-0007Z3-GN for ged-emacs-devel@m.gmane-mx.org; Mon, 16 Nov 2020 02:40:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1keZ6z-00071q-QD for emacs-devel@gnu.org; Mon, 16 Nov 2020 02:39:42 -0500 Original-Received: from sonic304-56.consmr.mail.bf2.yahoo.com ([74.6.128.31]:44811) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1keZ6w-0000p8-Ls for emacs-devel@gnu.org; Mon, 16 Nov 2020 02:39:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1605512374; bh=oDNxaEsaiHpB1uCAhegKpXXimzNJKd5waWIX4NhMfyQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=s4k77MKkeMoTHDPaWgxiKLGbfwdngNxA70TSnXbp7mJxjeEAkDcz3ABPrslljlfCvE3jS7XJHm6IzbcAtKiJVYww+HWXCmlKnXCMH0sMHOBIPno/cfo18r/Stvbu5jPFSOU2K3pCO6N7qN7m7iT7aT9XhuNVoBEhMqWidzYCaKfaDKe6Tk3Nr8ap5RpgDswEkWOnLNJNNIuTWKUCX6ku6Q+CGNw9C0zOUrOE+gXH+a4IRx24p3vDeo8CXPnpIR7yAjeM4pSTBw969fCWLhBYbIoEdqQRE7Gf0OCpjuWqg1LDIOkWN54L/kou3PEywmIcl0R2najKzWyC3npOlFoOLA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1605512374; bh=HLFacVTcjGJI2jTx1e7llJ01exiFHDl66Mq+0OgeNrG=; h=Date:From:To:Subject:From:Subject; b=DKDJlgfW6Bq/gH9tl43iKH+KueTci9m2V0juFWOeJqQu6JXkbF9yl7mA3BPcsbmy2Eca8MRPquNWf6CsE2dpmi1hC//JfSjOQUYmRF4lamOUmkBVEI7gMtrNEkOC6EhnpfBcK08TNXuGgBJZcHBEkdksNnUVzYCKhQ8Q3/KfbLeGoyT3wQ2zBg3UQNtf+iF/TmiKfaqVUJkaq20Eu4Coh8bNaTWhAfQPCmUtvlaGlz2lyUElwz5npLaLPQc3Sf99CYiQtYtFG8U1fvTqUmI9o/d7dwvkO1FUTetSd8mBsTi/zSseVEjvICCc6dbAaM72WynroSCEkjcVV8oN95CZIg== X-YMail-OSG: uQwHOZ4VM1mb_MzGNHOrhnO8YCP0loawOtAO70RoUqtv4Fwl9dXpgRZfAZ21dQL oMxK8eA59YtpdoyNhVUwSxKBqlwS243GjSnIO5viyJfYWcU.5qAH3LKC6Cz32aUfLadW75v_.ysA nhxkk2qUjuV1qD9SrpvOSDZ04snychiM5v9KD5deRfpl43_A8bLcKfwtfBtTvCQ.v9ADRPUj7Szh X0tA1z.ERwYFBlOfvNNdfPobSXDDfw7y4kkFGEr0Z6aDJO5BfwVL3ea46nEwlRNkjU8OnrkbKM2u MOc7bGMRxKxfpH1U0AXuEEqj7Xs5aUHOeI602IjQRvIDfq31G1LuYohpU22wGmGleuAG6B8A6BvV i3Z86wnir7HDUaM2bL4_xmL3_4wvHbq8DRZbZkaLt8uKSWKSau01AGoQsk.4fFeDAS2piO.v9et7 L4HoGUq6328UdmUvHn3OzX9GFITWDxWt2zqtTbw8qwgRIJxeE4weuWrgj22Ra2OIG016G6sTEys5 7h3NkR.6k3D0CemhOq_VxqGknkkm1ZRgwDlDffb.S8o_zFSEmsI0dInX7Pm2IDoCnqy1gc21gTuL cNk_9Pk7QFL7_DQGyNAxsDngj9I.yvHCedylFRa0JgTBplJgJB4HNHicfDO3l71zR9eeRU5iTf57 .D79B2SODfjyv6NINUt0UEAyydwmO77_rzr1nhiQhi1LZSB4O11LKBRU7Ezdj4PnQ9RbqyC7OrnV kRQ64EQ3wFuWHUFBZEWcXLB3pEavEQPN7rhluq5hhoihEQPkb3HJTQDGOxbcmoco2R5FVhYTnrnM NsAzcDJFNyPkAb6zCQcZ5xINKZYlJqExD8Y.Arajzy Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.bf2.yahoo.com with HTTP; Mon, 16 Nov 2020 07:39:34 +0000 Original-Received: by smtp405.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 8df272efbda20937a2983c5922632435; Mon, 16 Nov 2020 07:39:31 +0000 (UTC) Content-Disposition: inline In-Reply-To: X-Mailer: WebService/1.1.16944 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Apache-HttpAsyncClient/4.1.4 (Java/11.0.8) Received-SPF: pass client-ip=74.6.128.31; envelope-from=spacibba@aol.com; helo=sonic304-56.consmr.mail.bf2.yahoo.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/16 02:39:34 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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.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:259221 Archived-At: On Sun, Nov 15, 2020 at 10:56:54PM -0500, Stefan Monnier wrote: >>>> How can I make that emacs find the file automatically? It needs to be >>>> added in cus-.el right? >>>What do you mean by "find the file automatically"? >> Now I have to load the file with -l to be allowed to use the command. > >Oh, then you want to put a `;;;###autoload` cookie just above the entry >point(s). > >> 3) If completion-cycle-threshold is a number then candidates are shown, >> but when start cycling, the order is independent from the one in >> *Completions* (this behavior IMO is even worst). Also, there is not >> feedback between the current candidate and the visible completions list. > >Yes, that's the case I find similar. The differences I can see are: >- In your code you get to see the other candidates (with > `completion-cycle-threshold` the *Completions* is not necessarily > shown). >- In your code, you get to see your selection highlighted in *Completions*. >- In your code, you have to hit TAB an extra time, whereas with > `completion-cycle-threshold` you start cycling as soon as there are > few enough candidates. >- In your code the threshold depends on the size of *Completions* (and > the size of the completions themselves?) rather than being a fixed limit. >- The order of completions is different. > >I think it might be a good idea to try and bring those two closer to >each other. E.g. when cycling, make sure the *Completions* buffer, if >shown, displays the choices in the order in which they are cycled, and >highlight the chosen one. > Yes, I tried that, but the resulting code was ugly because the candidate in completion-cycle-threshold is taken from completion--do-completion directly and totally unrelated with the *Completions* buffer content. Changing that would require some changes of completion--cycle-threshold / completion--do-completion in minibuffer.el... I am not a proficient lisper to do that :(. I don't want to break the universe there. >I think the key [pun unintended] difference between the two is the extra >TAB which lets you interpret it as a request to enter a special mode >with special bindings to move between the different >displayed candidates. > This was intentional because I didn't want to change any default behavior, so I overloaded the tab just when where unused (*Completions* is shown and all completions are visible). The use of the selection/scroll with tab is another effort to not change any default behavior; because tab scrolls *Completions* when they are too long. So my code was injected with minimal modification because initially I wanted to discuss to enable this mode by default in the future (yes, a man can dream ;p). I find the current behavior intuitive (and removing the extra tab will make it even simpler) but I prefer to sacrifice that detail if that increases the probabilities to enable it by default. Almost only new users use the *Completion* instead of helm, ivy, icomplete or ido; I want to improve that first impression. This is something that could be managed with a custom if you prefer. So requiring the extra tab or not is easy to implement. Limit the candidates by number may be a bit more tricky and I am not sure it worth the effort. Simple is better than complicated. But if you think it worth the effort I could try... > > Stefan > > Ergus