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: Suggestions for improvements to the *Completions* buffer Date: Tue, 14 Dec 2021 23:13:07 +0200 Organization: LINKOV.NET Message-ID: <865yrr300t.fsf@mail.linkov.net> References: <87a6h9g0c0.fsf@posteo.net> <87zgp45gri.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3283"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 14 22:14:41 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 1mxF8D-0000jM-HR for ged-emacs-devel@m.gmane-mx.org; Tue, 14 Dec 2021 22:14:41 +0100 Original-Received: from localhost ([::1]:38316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxF8B-0003kx-K3 for ged-emacs-devel@m.gmane-mx.org; Tue, 14 Dec 2021 16:14:39 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxF7B-00028Z-6i for emacs-devel@gnu.org; Tue, 14 Dec 2021 16:13:37 -0500 Original-Received: from relay10.mail.gandi.net ([217.70.178.230]:33183) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxF79-0001aS-H8 for emacs-devel@gnu.org; Tue, 14 Dec 2021 16:13:36 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id DF608240005; Tue, 14 Dec 2021 21:13:32 +0000 (UTC) In-Reply-To: <87zgp45gri.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 13 Dec 2021 21:36:33 +0000") 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.29 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:281947 Archived-At: >> - (define-key map "z" 'kill-current-buffer) >> (define-key map "\M-g\M-c" 'switch-to-minibuffer) >> + (define-key map "z" #'completion-kill-buffer) >> + (define-key map [remap keyboard-quit] #'completion-quit) >> + (define-key map [remap quit-window] #'switch-to-minibuffer) > > It seems that remapping quit-window to switch-to-minibuffer creates > issues when the completion buffer is not invoked by the minibuffer, but > e.g. by complete-symbol. Binding it to completion-quit (defined above) > instead, might actually be more natural, as "q"/quit-window is expected > to close a window. Good point, so `q' should not be rebound from its standard command `quit-window'. Like you noticed, currently `quit-window' fails to select the minibuffer window, but this is a bug, so this regression was reported in bug#52491. Then "z" could be bound to a variant of `quit-window' that calls it with the argument KILL non-nil. Like currently `ESC ESC ESC' can close the completion window by the special command `delete-completion-window', then the same command could be bound to `[remap keyboard-quit]' as well. > The question is whether or not there is a need for a separate > switch-to-minibuffer binding (besides M-g M-c)? Is keeping the > completions buffer active while returning to the minibuffer a real need? Good question. If four key bindings (q, z, C-g, ESC ESC ESC) all will close the completions (first two using quit-window, and last two using delete-completion-window), then maybe we should have an easy-to-type keybinding that will switch to the minibuffer without closing the completions window? There is an easy-to-type keys and M-v to switch to the completions window, but no an easy-to-type key to switch back. It seems wrong for `q' to switch to the minibuffer without closing the window because `quit-window' implies that window should quit. But what key to use instead, I have no idea.