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 04:37:19 +0100 Message-ID: <20201116033719.63dryvqm4ozfer2r@Ergus> References: <20201115023629.19537.77471@vcs0.savannah.gnu.org> <20201115023631.C78AB20A27@vcs0.savannah.gnu.org> <20201115224943.o5r7lkkblmyt2ox4@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="11908"; 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 04:39:08 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 1keVMB-00030Q-E3 for ged-emacs-devel@m.gmane-mx.org; Mon, 16 Nov 2020 04:39:07 +0100 Original-Received: from localhost ([::1]:36074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1keVMA-0004Ag-EO for ged-emacs-devel@m.gmane-mx.org; Sun, 15 Nov 2020 22:39:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1keVKt-0003eu-Pb for emacs-devel@gnu.org; Sun, 15 Nov 2020 22:37:47 -0500 Original-Received: from sonic311-15.consmr.mail.bf2.yahoo.com ([74.6.131.125]:45418) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1keVKo-0008Fk-G1 for emacs-devel@gnu.org; Sun, 15 Nov 2020 22:37:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1605497857; bh=1q9Af14YeQjY7NrKzW3Q9KPGVkrTy4DcPz84YVhxbrk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=U3M+aMyxubGLggisr+Oxdd/lNf9Gke8+XMoARCJu62M7GFsXZ9MLHzcEmBpSufr3EXCjyKvZRNnICkf7JgR881REBuZBOCG8V2peV2fyPudhI0ffbtq6IfZaCRxX+fiBLPEO0baJ7+rrXjal6fonoB7zmMgbnThzdkbFbmZ0UPmiKOIirbul2SUunOlik2GByOkpZuSiXNpbIizOvD1MmBU4+oR/iAfxsSuxYrJwvrwKhLXV+m2d6U1he2GEiPtjzVpNXu31hiru6aNKQYh0j3XkvZWDNObFCdBeHU60mrFvgkBicaJMkXepiJKY79yKOtHaZpTeE+E1KngbJTYtYQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1605497857; bh=RtZbkQG4kBkCZQNT7XCNkfpsgw4VpoGfgnruXx3n6rH=; h=Date:From:To:Subject:From:Subject; b=O4bJyKO1Vl2OdypS3eK+eKKj/3UKXUl0aLNUQhUtX/zPdSdJ1RDtspfKqTMQegAA+CdcA+YsUGJuiciUy9jxOgjw/Si+dNjVgS74AHnVAJNefft2Hd0p4G8FZGJ0sabpvJKEE6K9yp2Xbhs0aU10g2UocIAUn+We5+uCxXMwefbmgmDjr0oUmkI5JZOsSqOG1gJgtBW/yYxdyr/6QDZDDoqQB+xI8Wkvd06GahifdOOJ9SFmPuhrDR12BNBsVmdabEqfXKRn3l4akZOtunO6S9xOdHiHIjEYUmtMEkIWBdmUJaYGsy5UREcAGD4EnWw2x0DYii57Ns5WQoO0U5bxVw== X-YMail-OSG: BlIyxiIVM1lRsF2N4.V7uvJdAvJH8.QJwC0Wci_8foPMabqbyoOW36TNS36DeMa Pj.jp3kL.uJhAzoD8fj18Du4U9p6y_wHF0WJIutGCJCwwfNqVDglzxT2Q_iJ_g5vX6VM6JrzaCrL DLU3qX64AxRNcIY5XttYwzPbWaIyIL.FiRxCBBSkwc5p_uLDRfhkC2_3PJFiQUycSscr5luPPOmR l9Bhv6jxk9j8OPiFGJ2bM7UvPsaL6jG51dn1otQUZzE09M4N4w_XByyS2P_tL4seCNjXXUt_AwMH 2SNktP2gOMZMA9zwBnVfwrMDRVAmcU62zA8PntcVDGv8eMX2ZH8ERuq.RMJUpDfo_Mk2fneRw2iz Wd2rv4X2_ktCRPP9UdiLADuqYYxo5Vv4rTWMJHs5Rhr6oyoKappNridLJAf4voyHUkcqfXDpkd4y wKBgqS0AxXu7Xq.DzegrBjWKgPvFINMYOQbL1Zh_0dZSCCT9nF7iMlwlPLJ_ke_p8IrKIqQXRQx8 aufXYBmFSkWLMCgLjxyVnxzb6YWCT.J.FFF9usT0rO3Lw9gmIa9t2st7lputDAdvTk0rLazyzeeR 3ccfwcUbkZm0qsK9s1gqeQa564Jlml7l4Mb5nmxYXORgTqtVX8wfzjD_6eFM.lyfysfSCunIiz2e 4CA1NCbYityz.Bw8AvHAH5IjisZkowi8.Kg3cmJnU72rUgPmRCeSsW41iiv99aaxut3IVJvvA2rP fOs_g3bFOOfXdGzK7qnAFETGKCTnVepH324WA0AMDoQ7X.88uVYGTJNukCk0oasbhkN40i5o1D86 4hAgC7Tjdgo6WskK43byJ9byRJrOyUqieXRs.ffHrC Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.bf2.yahoo.com with HTTP; Mon, 16 Nov 2020 03:37:37 +0000 Original-Received: by smtp411.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 68c5a7741878dc50453000cd364de4af; Mon, 16 Nov 2020 03:37:32 +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.131.125; envelope-from=spacibba@aol.com; helo=sonic311-15.consmr.mail.bf2.yahoo.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/15 22:37:37 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:259214 Archived-At: Hi Stefan: On Sun, Nov 15, 2020 at 06:32:08PM -0500, Stefan Monnier wrote: >>> Please write a description that can be understood by someone who doesn't >>> know Zsh (or Helm or Ivy or ...). >> Done! > >Much better, thanks. > >> Maybe it needs some comments in the manual/NEWS too? If so, where? > >I haven't looked at it enough to know, yet, sorry. > >> Please check if it needs anything else to be merged into master. I am >> reusing the highlight face... but maybe the package needs its own face >> for the overlay? > >Sorry haven't looked at the code yet. > :( >> 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. >BTW, this new feature reminds me of completion-cycle-threshold. > More or less is the same basic functionality for tabs, but with a lot of steroids. 1) When completion-cycle-threshold is nil (the default completion) tab functionality ends when the *Completions* is visible. After that tab does nothing else unless there are too many candidates and the list needs to be scrolled. 2) On the other hand when completion-cycle-threshold is t the completions buffer is never shown. So the completion system behaves more like vim (ugh), the next completion is not easily predictable. And, of course, the user can't know how many tabs will need to reach what he wants. 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. ----------------- This mode shows the completions buffer (like when completion-cycle-threshold is nil), but then cycles there (like when completion-cycle-threshold is non-nil). But over a visible list of candidates and highlighting the current one. Once cycling started it is easy to know what will be the next candidate or how many tabs (or arrows) are needed to get to a candidate. It is also possible to go to the candidate down, up, or the previous one (left) if you accidentally passed it. Another advantage is that the cursor (point) stays in the same mini-buffer place after completion, so, in case the list is too long and you want to reduce it (or a wrong letter was inserted); you only need to type another letter(backspace) and tab again (like in bash or zsh or the default completion engine to get a new list). Finally the mode only changes the default completion behavior once the completions are visible and another tab is pressed (Where by default Tab did nothing before). Hope this helps. > > Stefan > BTW: 1) completion-cycle-threshold t: is somehow equivalent to bash: bind "TAB:menu-complete" bind "set show-all-if-ambiguous on" 2) completion-cycle-threshold nil: is somehow similar to default bash completion. (tab shows the list and wait more letters) 3) This mode mimics zle from zsh. It is impossible to have this behavior in bash because readline can't give this. zsh team needed to create zle to have it. There are known limitations like that some users will like the candidates bellow the prompt and not over or have everything in the same window, or C-g should hide completions instead of exiting the mini-buffer... But adding them may be too invasive or collide with the default behavior and may add some worthless complexity. Best, Ergus.