Skip to content

Commit

Permalink
Merge 22cd393 into 37c6b34
Browse files Browse the repository at this point in the history
  • Loading branch information
wyuenho committed Mar 15, 2021
2 parents 37c6b34 + 22cd393 commit f8ebc78
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions window-purpose-fixes.el
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ SYMBOL WHERE and FUNCTION have the same meaning as `advice-add'."
(purpose-fix-toggle-advice ,symbol ,where ,function)))
(add-hook 'purpose-fix-togglers-hook #',toggler-name))))

(defun purpose--fix-debug ()
"Integrates `debug' with Purpose."

(with-eval-after-load 'debug
(defun purpose--debug (fn &rest args)
"Ignore `pop-to-buffer' display actions given by `debug'."
(let ((pop-to-buffer-definition (symbol-function 'pop-to-buffer)))
(cl-letf (((symbol-function 'pop-to-buffer)
(lambda (buffer &optional _action _record)
(funcall pop-to-buffer-definition buffer))))
(apply fn args))))

(purpose-fix-install-advice-toggler #'debug :around #'purpose--debug)))

(defun purpose--fix-edebug ()
"Integrates Edebug with Purpose."

Expand Down Expand Up @@ -387,6 +401,7 @@ Don't call this function before `popwin' is loaded."
"Install fixes for integrating Purpose with other features.
EXCLUDE is a list of integrations to skip. Known members of EXCLUDE
are:
- 'debug : don't integrate with debug
- 'edebug : don't integrate with edebug
- 'compilation-next-error-function : don't integrate with
`compilation-next-error-function'.
Expand All @@ -401,6 +416,8 @@ are:
- 'which-key : don't integrate with which-key
- 'whitespace : don't integrate with whitespace"
(interactive)
(unless (member 'debug exclude)
(purpose--fix-debug))
(unless (member 'edebug exclude)
(purpose--fix-edebug))
(unless (member 'compilation-next-error-function exclude)
Expand Down

0 comments on commit f8ebc78

Please sign in to comment.