Every time I open Magit status buffer I need to press ?
.
How can I make it so it opens automatically?
doing this didn't help
(add-hook 'magit-mode 'magit-dispatch-popup)
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityThere's no hook variable named magit-mode
. You were looking for magit-mode-hook
(mode hooks are always named MODENAME-hook
). That's not the solution here, though.
I can only imagine this very quickly going from "I have to press ? every time to get the help" to "I have to press q every time to dismiss the help", however you can do what you've asked for by defining some after-advice for magit-status
:
(defadvice magit-status (after my-magit-status-dispatch-popup)
(magit-dispatch-popup))
(ad-activate 'magit-status)
n.b. That won't trigger for anything other than calling magit-status
, so refreshing the status buffer (which calls magit-refresh
) won't do it (which I think is a good thing).
Edit: In more recent versions of Magit the above code causes a byte-compilation warning (see comments), but you could use the following variation instead:
(defadvice magit-status (after my-magit-status-dispatch)
(call-interactively 'magit-dispatch))
(ad-activate 'magit-status)
Warning (bytecomp): ‘magit-dispatch-popup’ is an obsolete function (as of Magit 3.0.0); use ‘magit-dispatch’ instead.
- When I use magit-dispatch
, it complains that is for interactive use only :/