Skip to content

Commit

Permalink
Fix display of magit-popup's help windows
Browse files Browse the repository at this point in the history
  • Loading branch information
bmag committed Sep 20, 2017
1 parent 00ddafc commit 44d31e3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cask
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
;; (depends-on "popwin")
;; (depends-on "guide-key")
;; (depends-on "which-key")
;; (depends-on "magit") ;; for magit-popup.el
)
31 changes: 30 additions & 1 deletion window-purpose-fixes.el
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,33 @@ Don't call this function before `popwin' is loaded."



;;; Let magit-popup use its own way of opening a help window (see https://github.com/syl20bnr/spacemacs/issues/9570)
(defun purpose--fix-magit-popup ()
"Let magit-popup display help windows the way it wants."
(eval-after-load 'magit-popup
'(progn
(define-purpose-compatible-advice 'magit-popup-describe-function
:around purpose--fix-magit-popup-help
(&rest args)
"Make Purpose inactive during `magit-popup-describe-function'."
;; new style advice
((without-purpose (apply oldfun args)))
;; old style advice
((without-purpose ad-do-it)))
(define-purpose-compatible-advice 'magit-popup-manpage
:around purpose--fix-magit-popup-help
(&rest args)
"Make Purpose inactive during `magit-popup-manpage'."
;; new style advice
((without-purpose (apply oldfun args)))
;; old style advice
((without-purpose ad-do-it)))
(purpose-advice-add 'magit-popup-describe-function
:around 'purpose--fix-magit-popup-help)
(purpose-advice-add 'magit-popup-manpage
:around 'purpose--fix-magit-popup-help)
)))

;;; install fixes

(defun purpose-fix-install (&rest exclude)
Expand Down Expand Up @@ -252,7 +279,9 @@ are:
(unless (member 'guide-key exclude)
(purpose--fix-guide-key))
(unless (member 'which-key exclude)
(purpose--fix-which-key)))
(purpose--fix-which-key))
(unless (member 'magit-popup exclude)
(purpose--fix-magit-popup)))

(provide 'window-purpose-fixes)
;;; window-purpose-fixes.el ends here

0 comments on commit 44d31e3

Please sign in to comment.