From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Suggestions for improvements to the *Completions* buffer Date: Sat, 18 Dec 2021 20:31:14 +0800 Message-ID: <87ee6adrhp.fsf@yahoo.com> References: <87pmpurtl9.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="12334"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: Juri Linkov , emacs-devel@gnu.org To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 18 13:32:45 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 1myYtI-000327-II for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Dec 2021 13:32:44 +0100 Original-Received: from localhost ([::1]:60508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1myYtG-0002j1-Df for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Dec 2021 07:32:42 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myYs3-00022L-Ju for emacs-devel@gnu.org; Sat, 18 Dec 2021 07:31:27 -0500 Original-Received: from sonic304-21.consmr.mail.ne1.yahoo.com ([66.163.191.147]:36611) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1myYs1-0001JO-Ue for emacs-devel@gnu.org; Sat, 18 Dec 2021 07:31:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1639830684; bh=pzQX98xvgoaGfCsTNqZ9Lcxd33vY81Um7/G9eDd+Td0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=oCNzbeboGIUNyDFAeaPjwtTJL4g2huaGRfIo0nGj53pqU6nDPrMBNh1ygSVePbNdThRBAEkfVQv+FKwVAH2qoozFMUOkzGQAsXJ/zWmjD58RxF3LXw5PoQqdcsQN+FGSsh/xyOAKZG1TX3djnIfZvwc5G5WbtuZcfzuVLDQ+91bJhrBMcnDXixSOUQeoyCzK9F6u8v0z958eAigw7wHzGFEPt2KVr624JzmgrttbQyJ4JxtJwNf4Cly/9UlO3ORi3oglJcMT6FTUZHVk+wQiD8gie05n5QFmhQcQmQsY5RwLG8LylTwJKNdJK5KoIDxf5AUI1vdF+x+3L8IhBrmuLg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1639830684; bh=mic7DGIWZg7kMUg2SeQJLqVPG92fui7EiXrIwguqqoN=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=oN/vtjNYQZbeZQjhByLH3SmfmnLkZ2xkBmFrkiApWNg0o925QRqY1qXp2cPOrn32iNXzN1r0nRMWbIvQg7aIScpF4sjSF7KyvnDNIpa4hVD7bZrgyUEA20LZu11SdHcPSQqK1PA+FOA1FjOHMCNfhdTyAhhGmeHkM18wcZqjCQJH74PQEgxqKSGo2kTL5O/I9bCGb792KomIiqa3JMod0D8d1D14l3/fwUklT5+vHPKXfnGcFDJPQ118ho1jpGvt3tLla5h6tLdw2uXeTjz6QOCOvmyH3chr8WoE/X3aWhHnJelMEs6G24XjmxW3JIvMMLqKHvNMwcrAYMPHRyPWWw== X-YMail-OSG: 6_1QwBIVM1nX3sTHSoWefPX6jIXQfGrn1ZkHFwDhGz4os0NsTQlgcSMbyVMYV__ a9qdNFqBK.w5wa88sTS04ZyGzu9Q6xWs5uJCpvygW9vskon8_rEvQ6kcdB8B6yqiI1ay3D_3tL5p 3QLbkWnCn0aUjRDDMmSSpK.ysYzrR5V3blfxWg95vo3WvWDL3pUBVfm_reX5z00UaAALEaMYGG0p gBmrYrRO82yG0TWM6Hfe68KJw2nAn0Y_ZK7DGX9_5_Ge8EXUj46aZsZQBcWAVBuOGl_VTEnQRVZg w4fX806GSihdrMNxMy9ZBoKlf6HOcHowD63EhbOHLC3xGQfAGHiSMOEHcaS_NOlNgmmji8ZT5Vxw 0VbkCz1BGCvGex_PYLNYiTqT4VqAbSCgmxVgk9NHQTaGkvi7E5.Qc1PKGx9z005qi6hQD2z0LHmT pS8YZWDkhb3RyKlfYI.N_bAb6K_Gh9xi1QGFvdvHdu7Mn_RdHClPcBctKIQaFkuCU3_Ao7SAWbfY aHNbuI93ixU_uySAE7CAm.ZgZYwgYqSs4BY2WS6jNNxgHpkLuaiQMJZ7q_PF5k8SgptX7dCYqhGj s09kDWa48vR3A6w3WUbLczZ1vug_mqju025A8az4Tonk_QLXXhjIMtckNbVDFgWMxAbRIh8NVgyV qL6sdPsLuoafMrjrs24ybBuuKPSfF_INddM.Ry9Bv.mH5_qgiIc.z061.VP3cRR6RSxbykFFIJDl y0FRQoebGDDNW88EB8ABAIPqWGQMIi3xJmTODVZXfjvXG3MJOrTWPlj6d.A1UtcNcI0aNBi4G7JJ MP9hOuRLsk6qU19mDAnSLKTVB1Yy9w1ED9rXYk5QSv X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ne1.yahoo.com with HTTP; Sat, 18 Dec 2021 12:31:24 +0000 Original-Received: by kubenode503.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 72931611b8c8b96208fbdf20df29a3de; Sat, 18 Dec 2021 12:31:18 +0000 (UTC) In-Reply-To: <87pmpurtl9.fsf@posteo.net> (Philip Kaludercic's message of "Sat, 18 Dec 2021 12:22:10 +0000") X-Mailer: WebService/1.1.19498 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.191.147; envelope-from=luangruo@yahoo.com; helo=sonic304-21.consmr.mail.ne1.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.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:282288 Archived-At: Philip Kaludercic writes: > Here are the patches that would implement this behaviour. I have to use > it for a bit longer before I can say if it is preferable, but I guess if > something along these lines were to be applied, this could be an option. Could this part be made optional, at least for those of us with muscle memory? I actually expect the focus to return to the previous window (not necessarily the minibuffer) when I press `z' in a completion buffer. Thanks. > +(defun completion-quit () > + "Close the completion buffer and return to the minibuffer." > + (interactive) > + (quit-window) > + (switch-to-minibuffer)) > + > +(defun completion-kill-buffer () > + "Close the completion buffer and return to the minibuffer." > + (interactive) > + (let ((win (get-buffer-window "*Completions*"))) > + (when win (quit-window t win))) > + (switch-to-minibuffer)) > + > (defvar completion-list-mode-map > (let ((map (make-sparse-keymap))) > (set-keymap-parent map special-mode-map) > @@ -8984,10 +8997,12 @@ completion-list-mode-map > (define-key map [right] 'next-completion) > (define-key map [?\t] 'next-completion) > (define-key map [backtab] 'previous-completion) > - (define-key map "z" 'kill-current-buffer) > (define-key map "n" 'next-completion) > (define-key map "p" 'previous-completion) > (define-key map "\M-g\M-c" 'switch-to-minibuffer) > + (define-key map "z" #'completion-kill-buffer) > + (define-key map [remap keyboard-quit] #'delete-completion-window) > + (define-key map [remap quit-window] #'completion-quit) > map) > "Local map for completion list buffers.") > > -- > 2.30.2