From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: feature/completions-highlight-modifications e3c5b99 3/6: Add completions-highlight-mode initial implementation. Date: Sun, 22 Nov 2020 22:03:05 +0200 Organization: LINKOV.NET Message-ID: <87a6v9426m.fsf@mail.linkov.net> 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> <20201122132833.g44h66g7d4fgnm3s@Ergus> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30526"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Stefan Monnier , Drew Adams , emacs-devel@gnu.org To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 22 21:16:12 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 1kgvmM-0007nc-W6 for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Nov 2020 21:16:10 +0100 Original-Received: from localhost ([::1]:48352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kgvmL-00061T-SP for ged-emacs-devel@m.gmane-mx.org; Sun, 22 Nov 2020 15:16:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgvl3-0004rn-Jr for emacs-devel@gnu.org; Sun, 22 Nov 2020 15:14:49 -0500 Original-Received: from relay10.mail.gandi.net ([217.70.178.230]:55475) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgvl1-0007W5-7O for emacs-devel@gnu.org; Sun, 22 Nov 2020 15:14:49 -0500 Original-Received: from mail.gandi.net (m91-129-97-46.cust.tele2.ee [91.129.97.46]) (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 50B09240005; Sun, 22 Nov 2020 20:14:40 +0000 (UTC) In-Reply-To: <20201122132833.g44h66g7d4fgnm3s@Ergus> (Ergus's message of "Sun, 22 Nov 2020 14:28:33 +0100") Received-SPF: pass client-ip=217.70.178.230; envelope-from=juri@linkov.net; helo=relay10.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, 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:259650 Archived-At: > 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). I see no problem in treating q and z as self-inserting characters in this special mode. > And rebind > C-g: to kill-current-buffer. (I don't really know the difference between > all them) Or maybe better to bind C-g to abort-recursive-edit. > The hook for self-insert is trivial. But it won't cover commands like > delete-backward-char, backward-kill-word and so on. So it seems more keys need to be bound in the completions buffer to redirect their effect to the minibuffer. > 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? There keybindings could be added by a new mode enabled in the completions buffer.