Fix showing help
Now it exits after showing the help window because the user can't interact with it while the menu is working and on some cases the help buffer uses the same window as the menu, hidding it.
This commit is contained in:
parent
903e642bf6
commit
626af3b9c1
1 changed files with 7 additions and 8 deletions
15
magit.el
15
magit.el
|
@ -3592,14 +3592,12 @@ With a non numeric prefix ARG, show all entries"
|
||||||
(menu-items (magit-get-menu-options group))
|
(menu-items (magit-get-menu-options group))
|
||||||
(prompt (concat (if prefix-arg (format "(prefix: %s) " prefix-arg))
|
(prompt (concat (if prefix-arg (format "(prefix: %s) " prefix-arg))
|
||||||
"Command key (? for help): "))
|
"Command key (? for help): "))
|
||||||
(original-prompt "")
|
|
||||||
(display-help-p)
|
(display-help-p)
|
||||||
(chosen-fn nil))
|
(chosen-fn nil))
|
||||||
(save-window-excursion
|
(save-window-excursion
|
||||||
(delete-other-windows)
|
(delete-other-windows)
|
||||||
(switch-to-buffer-other-window " *Magit Commands*" t)
|
(switch-to-buffer-other-window " *Magit Commands*" t)
|
||||||
(setq menu-buf (current-buffer))
|
(setq menu-buf (current-buffer))
|
||||||
(setq original-prompt prompt)
|
|
||||||
(catch 'exit
|
(catch 'exit
|
||||||
(while t
|
(while t
|
||||||
(pop-to-buffer menu-buf)
|
(pop-to-buffer menu-buf)
|
||||||
|
@ -3629,17 +3627,18 @@ With a non numeric prefix ARG, show all entries"
|
||||||
(setcar (nthcdr 5 item)
|
(setcar (nthcdr 5 item)
|
||||||
(funcall (nth 4 item) (nth 2 item))))
|
(funcall (nth 4 item) (nth 2 item))))
|
||||||
(display-help-p
|
(display-help-p
|
||||||
(describe-function fn)
|
(setq chosen-fn fn)
|
||||||
(setq prompt original-prompt)
|
(throw 'exit 0))
|
||||||
(setq display-help-p nil))
|
|
||||||
(t
|
(t
|
||||||
(setq chosen-fn fn)
|
(setq chosen-fn fn)
|
||||||
(throw 'exit 0))))))
|
(throw 'exit 0))))))
|
||||||
(error "Invalid key: %c" c))))))
|
(error "Invalid key: %c" c))))))
|
||||||
(when chosen-fn
|
(when chosen-fn
|
||||||
(setq current-prefix-arg prefix-arg)
|
(if display-help-p
|
||||||
(let ((magit-custom-options (magit-menu-make-option-list menu-items)))
|
(describe-function chosen-fn)
|
||||||
(call-interactively chosen-fn)))))
|
(setq current-prefix-arg prefix-arg)
|
||||||
|
(let ((magit-custom-options (magit-menu-make-option-list menu-items)))
|
||||||
|
(call-interactively chosen-fn))))))
|
||||||
|
|
||||||
(defun magit-menu-make-option-list (menu-items)
|
(defun magit-menu-make-option-list (menu-items)
|
||||||
(let ((result '())
|
(let ((result '())
|
||||||
|
|
Loading…
Reference in a new issue