]> git.eshelyaron.com Git - emacs.git/commitdiff
Use the elisp xref backend in profiler buffers
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 30 Jul 2019 10:04:21 +0000 (12:04 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 30 Jul 2019 10:04:21 +0000 (12:04 +0200)
* lisp/profiler.el (profiler--xref-backend): New function (bug#23455).
(profiler-report-mode): Use it to use the elisp xref handler when
hitting `M-.' in profiler buffers.

lisp/profiler.el

index ee11ff68c5650b7137740692d175bd841ea7f969..92495e2de885dbe48d72a7d057df2f0b4ad0af97 100644 (file)
@@ -615,9 +615,12 @@ return it."
       (profiler-report-render-calltree))
     buffer))
 
+(defun profiler--xref-backend () 'elisp)
+
 (define-derived-mode profiler-report-mode special-mode "Profiler-Report"
   "Profiler Report Mode."
   (add-to-invisibility-spec '(profiler . t))
+  (add-hook 'xref-backend-functions #'profiler--xref-backend nil t)
   (setq buffer-read-only t
        buffer-undo-list t
        truncate-lines t))