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: Sun, 22 Nov 2020 14:28:33 +0100 Message-ID: <20201122132833.g44h66g7d4fgnm3s@Ergus> References: <92f3cbd7-29a0-461a-a023-562bc6020ea8@default> <87v9e5herj.fsf@mail.linkov.net> <20201116102729.ywubtda6cqdzc45z@Ergus> <87d00acuh3.fsf@mail.linkov.net> <20201119032519.lpa53ixezgpdppze@Ergus> <87d009kfmf.fsf@mail.linkov.net> <20201119105052.kfichqojkhfwwsiz@Ergus> <87k0ugfirt.fsf@mail.linkov.net> <20201120145248.wmbv2zgbvs7bg25i@Ergus> <871rgmwt6e.fsf@mail.linkov.net> 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="21389"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , Drew Adams , emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 22 14:30:01 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 1kgpRI-0005Rg-5F for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Nov 2020 14:30:00 +0100 Original-Received: from localhost ([::1]:41672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kgpRH-0005jb-3E for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Nov 2020 08:29:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgpQM-0005JW-L2 for emacs-devel@gnu.org; Sun, 22 Nov 2020 08:29:03 -0500 Original-Received: from sonic309-13.consmr.mail.bf2.yahoo.com ([74.6.129.123]:32940) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kgpQE-000553-4o for emacs-devel@gnu.org; Sun, 22 Nov 2020 08:29:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1606051729; bh=hyN8ZTB9ITjwpHoenJ7JpMU3RiJcVM5LgyzZb/3G/1o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=rhA1rmYBxUdXfvcOb5kt2oBZH64WsNBlRFqnYPVOtm+lGZmjuIVSE09OdfYotM+bBwvTH+bpn7Xj3AHltrjiDcD0cMcAt7N0R5fUsslXI05/pY7gLrJBA5jFTn7TrEsH+hrbDD6PARh+T+S4gWTh8wROvjecN+7VR84odUuHZxrMmMk0Z1ouDCVeKP78wzWx5YkjHTVG0C3pizJsN4+ZTe2TbKt0WtbtaAyfzCiDvqgEmGBScx/AcSL6Oz8eqfnZTvq9L3a+NO6rkxWerJylPAVxx+uAsyE2B3kt2JVUlpwfKeJkPHOwX9L8BVuTsWafIV02tg2ivKI4oDf7OWjCXA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1606051729; bh=LlXiIt/pKXabDdzQh+lTrAVLHBKl6ZnnaLUpJaQ3z5S=; h=Date:From:To:Subject:From:Subject; b=pU5AoIZL7fV650kGahloT0qxQ/IbzUVYCCebLzNc1I/behsaVJBFuj3G4Qwq1k6mAv6By6sV/nqXCJfiBd9hvDdWiZ1xdT/0bX00HuEuvMMGrQI6ZSc0gQDD+6bIO+/kqEKDKcWJzW8n2F7+LZNNLz23PSv3spYY0H90hh6InjU7BpYo4utcST79/XAATm8nLDK8t+mpv2ib5Vb3CqCWmsikCE9WC2cMbzusNKKxoyzQV2JdK8/q6CqiMwI990K8Pun/Tr/jMFnh4mM7ZBDfqO0zFBx9cA2WvWdcnbTAxRS7O6ngzGixjAnXgzXsJA7CbsBA94DozFL5l/k45iS4CQ== X-YMail-OSG: SN1uOkkVM1l4Jk21Gc4JL12oFqWfOSDf5A.Yh6rpY770A47otgWPvymE72zdye8 5BgJs8_xCzFOMAHzxJZ7EtY9X5ZCuAQBrXXRgIRP6KM1_LY8EhgJ9a6aaKtu1uOth0qgzsZBX1uZ QnCQqKCz6MOKIuJykd9vWNhIuqCRN9DlrXbcRX3LsJRSm6HD_ZXUcXQyR3o2LXdr6chAuGZn5.99 NvjaJL6.24f2zKJS1q2qFLqDT8Glp.W5F9n3fxom617_VVl7if08Ia6KnR7B4opkM..vWqwFNyZX m.h6xqSVTAvG.T701H17E4vDRZV5QTcBE7AgLraX0_bu5awFVDj2r966Il3zWAp7zOD1502h95af 8gAa6myYJypZpzLPe27Ewznc4G_smzf7McUcfCd5SjkDmNwgKx5unIbWrWutkhlenUkWEsxypbJj n8R786xpnf0g.b9vqO3rT4AV1011bJSbF1ANO4q769H.UgJbArTvaG666QHVB8xFOFPninHXbdux czGuEW8Q_vbrDxTcJEr6_Jj9HpT2QXaP0qy8qtWahgLM17k2vLh_Wd3kcSOZk9V8fW9PGssRy3jp HAUZPMrW3Nxi5K9XZ.JyuxkfgAckAMZXBRZC_ZHjpOpkNb8VOSmXCXZn3D9ffs4yLJjjVWxDH.jF xDuxlmFV81JmmVQLSGQDfUX1FTT1NWDliIJyiatyotNsv2uoe6IAP5XZRWqZvQIliAs0.5Sgy7IH QzBl2K03G9VVnWYTUmyV2YcBYa2sxNGveghk_FTLouQnXVETkIBFTXwNbd1eWxMuBIc82u9lE9oN shvVOv8dMQbS6MBq.esKE6hsZBSRffUG6Rskim51EV Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.bf2.yahoo.com with HTTP; Sun, 22 Nov 2020 13:28:49 +0000 Original-Received: by smtp407.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 6b7197bf0a86b0e510571247daffffac; Sun, 22 Nov 2020 13:28:47 +0000 (UTC) Content-Disposition: inline In-Reply-To: <871rgmwt6e.fsf@mail.linkov.net> X-Mailer: WebService/1.1.17111 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.129.123; envelope-from=spacibba@aol.com; helo=sonic309-13.consmr.mail.bf2.yahoo.com 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:259609 Archived-At: On Sat, Nov 21, 2020 at 09:30:17PM +0200, Juri Linkov wrote: >>>> Maybe we should look more how zsh behaves... and try to mimic that as >>>> much as possible. Because it is already pretty consisten >>> >>>Does zsh use arrow keys to navigate in completions? >>>How then it's possible to get previous/next history item (up/down arrows), >>>and move the cursor in the command line (left/right arrows)? >> >> Similar to what we are doing. >> >> 1) When NO completions shown: previous/next history and so on. >> 2) When completions are shown: navigate completions. >> >> Completions are only shown after a "tab request" 1->2 (unlike >> incomplete) > >Trying to mimic the 'zsh' behavior is a good thing. Using >'zsh' as a reference, what do you think about naming the package >'zcomplete'. > Ok >> If you type any letter completions disappear, inserts a space and then >> the letter, so >> >> backspace just hides completions (deletes the inserted space), so goes >> from 2->1 easily (unlike *Completions*). > >If you want to emulate the 'zsh' behavior, then much simpler approach >would be to allow TAB to pop-up the completions buffer, i.e. to display >and switch to it. Then all motion keys will be available by default. >To display the cursor in the minibuffer is still possible by using >'(cursor-in-echo-area t)'. RET will insert the completion under point >to the minibuffer. Any self-inserting key could switch back >to the minibuffer and insert its character. > The real issue with that is not setting, but reseting. Because completions-list-map uses: 1. \e\e\e delete-completion-window 2. q quit-window 3. z kill-current-buffer to exit. In principle quit-window-hook works for 2. But for 1 we need an advise and rebind q and 3 is bind to z. so I am not clear what's the best approach or the consequences of changing them. But my proposal will be then make: q and z: self-insert (as they will call quit-window in the hook any way). And rebind C-g: to kill-current-buffer. (I don't really know the difference between all them) The hook for self-insert is trivial. But it won't cover commands like delete-backward-char, backward-kill-word and so on. The trick there may be to throw the read-only error and call 1, 2 or 3... to go to the minibuffer when any command tries to modify "Completions* and try to execute there. But I don't know if it is possible to do that for a whole buffer or a map in a clean way and locally to a window/buffer only. Is it?