[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Suggestions for improvements to the *Completions* buffer
From: |
Po Lu |
Subject: |
Re: Suggestions for improvements to the *Completions* buffer |
Date: |
Sat, 18 Dec 2021 20:31:14 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) |
Philip Kaludercic <philipk@posteo.net> 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
- Re: Suggestions for improvements to the *Completions* buffer, (continued)
Re: Suggestions for improvements to the *Completions* buffer, Philip Kaludercic, 2021/12/13
- Re: Suggestions for improvements to the *Completions* buffer, Juri Linkov, 2021/12/14
- Re: Suggestions for improvements to the *Completions* buffer, Philip Kaludercic, 2021/12/17
- Re: Suggestions for improvements to the *Completions* buffer, Philip Kaludercic, 2021/12/17
- Re: Suggestions for improvements to the *Completions* buffer, Philip Kaludercic, 2021/12/18
- Re: Suggestions for improvements to the *Completions* buffer,
Po Lu <=
- Re: Suggestions for improvements to the *Completions* buffer, Philip Kaludercic, 2021/12/18
- Re: Suggestions for improvements to the *Completions* buffer, Po Lu, 2021/12/19
Re: Suggestions for improvements to the *Completions* buffer, Juri Linkov, 2021/12/18
Re: Suggestions for improvements to the *Completions* buffer, Philip Kaludercic, 2021/12/19
Re: Suggestions for improvements to the *Completions* buffer, Juri Linkov, 2021/12/19
Re: Suggestions for improvements to the *Completions* buffer, Philip Kaludercic, 2021/12/19
Re: Suggestions for improvements to the *Completions* buffer, Philip Kaludercic, 2021/12/20
Re: Suggestions for improvements to the *Completions* buffer, Juri Linkov, 2021/12/21
Re: Suggestions for improvements to the *Completions* buffer, Philip Kaludercic, 2021/12/21
Re: Suggestions for improvements to the *Completions* buffer, Daniel Semyonov, 2021/12/22