Steve Purcell <[email protected]> writes:
> From 1ea9b22246df14347cde5e9aa8da1e0d46f45b1e Mon Sep 17 00:00:00 2001
> From: Steve Purcell <[email protected]>
> Date: Fri, 12 Mar 2010 14:30:00 +0000
> Subject: [PATCH] Bind "q" to kill-this-buffer in *magit-process*
>
> If one configures the process buffer to pop up after a short delay,
> then it's nice to be able to banish it easily too, and "q" is the
> standard choice.
>
> The binding is only set if there's no local mode already, to be safe.
Wouldn't be better to use bury-buffer ? Like that their is no risk of
destroying the buffer before git has ended its processing.
> ---
> magit.el | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/magit.el b/magit.el
> index 79329aa..2104ec8 100644
> --- a/magit.el
> +++ b/magit.el
> @@ -1018,6 +1018,7 @@ Many Magit faces inherit from this one by default."
> (magit-set-mode-line-process
> (magit-process-indicator-from-command cmd-and-args))
> (setq magit-process-client-buffer (current-buffer))
> + (or (current-local-map) (local-set-key (kbd "q") 'kill-this-buffer))
you're not modifying the local-map of the *magit-process* buffer but the
one where the call is made.
This line should be after the (set-buffer buf)...
Also, it's seem that I my configuration, there is no current-local-map
for *magit-process*
it's seem that here, (current-local-map) return nil in *magit-process*
because it is in Fundamental mode. Maybe we should create a (small)
magit-process-mode for this, or use something that already exist, as:
diff --git a/magit.el b/magit.el
index b41d6fe..7592888 100644
--- a/magit.el
+++ b/magit.el
@@ -1082,6 +1082,12 @@ Many Magit faces inherit from this one by default."
(setq magit-process-client-buffer (current-buffer))
(save-excursion
(set-buffer buf)
+ (view-mode 1)
+ (set (make-local-variable 'view-no-disable-on-exit) t)
+ (setq view-exit-action
+ (lambda (buffer)
+ (with-current-buffer buffer
+ (bury-buffer))))
(setq buffer-read-only t)
(let ((inhibit-read-only t))
(setq default-directory dir)
(I did not test it yet...)
(shamelessly stolen from help-mode)
--
Rémi Vanicat