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:
oscar 2010-05-16 20:18:31 +02:00
parent 903e642bf6
commit 626af3b9c1

View file

@ -3592,14 +3592,12 @@ With a non numeric prefix ARG, show all entries"
(menu-items (magit-get-menu-options group))
(prompt (concat (if prefix-arg (format "(prefix: %s) " prefix-arg))
"Command key (? for help): "))
(original-prompt "")
(display-help-p)
(chosen-fn nil))
(save-window-excursion
(delete-other-windows)
(switch-to-buffer-other-window " *Magit Commands*" t)
(setq menu-buf (current-buffer))
(setq original-prompt prompt)
(catch 'exit
(while t
(pop-to-buffer menu-buf)
@ -3629,17 +3627,18 @@ With a non numeric prefix ARG, show all entries"
(setcar (nthcdr 5 item)
(funcall (nth 4 item) (nth 2 item))))
(display-help-p
(describe-function fn)
(setq prompt original-prompt)
(setq display-help-p nil))
(setq chosen-fn fn)
(throw 'exit 0))
(t
(setq chosen-fn fn)
(throw 'exit 0))))))
(error "Invalid key: %c" c))))))
(when chosen-fn
(setq current-prefix-arg prefix-arg)
(let ((magit-custom-options (magit-menu-make-option-list menu-items)))
(call-interactively chosen-fn)))))
(if display-help-p
(describe-function 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)
(let ((result '())