From 9b1b75f947360eafd22b4fe092df0d78f75324aa Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 13 Mar 2019 19:20:37 -0400 Subject: [PATCH] Improve profiler popup integration Following profiler links will open in different window; also displays CPU/Memory reports side by side. --- modules/ui/popup/+hacks.el | 8 ++++++++ modules/ui/popup/config.el | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/ui/popup/+hacks.el b/modules/ui/popup/+hacks.el index deebf9b06..8b05cff9a 100644 --- a/modules/ui/popup/+hacks.el +++ b/modules/ui/popup/+hacks.el @@ -316,6 +316,14 @@ instead of switch-to-buffer-*." (set-popup-rule! "\\(^\\*Contents\\|'s annots\\*$\\)" :ignore t)) +;; `profiler' +(defun doom*profiler-report-find-entry-in-other-window (orig-fn function) + (cl-letf (((symbol-function 'find-function) + (symbol-function 'find-function-other-window))) + (funcall orig-fn function))) +(advice-add #'profiler-report-find-entry :around #'doom*profiler-report-find-entry-in-other-window) + + ;; `wgrep' (progn ;; close the popup after you're done with a wgrep buffer diff --git a/modules/ui/popup/config.el b/modules/ui/popup/config.el index 0f4ab07f7..f3f257ddb 100644 --- a/modules/ui/popup/config.el +++ b/modules/ui/popup/config.el @@ -159,7 +159,9 @@ prevent the popup(s) from messing up the UI (or vice versa)." ;; `Info-mode' ("^\\*info\\*$" :slot 2 :vslot 2 :size 0.45 :select t))) - '(("^\\*Backtrace" :vslot 99 :size 0.4 :quit nil))) + '(("^\\*Backtrace" :vslot 99 :size 0.4 :quit nil) + ("^\\*CPU-Profiler-Report " :side bottom :vslot 100 :slot 1 :height 0.4 :width 0.5 :quit nil) + ("^\\*Memory-Profiler-Report " :side bottom :vslot 100 :slot 2 :height 0.4 :width 0.5 :quit nil))) (add-hook 'doom-init-ui-hook #'+popup-mode :append)