]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/xref.el (xref-after-update-hook): New defcustom (bug#46992).
authorJuri Linkov <juri@linkov.net>
Mon, 8 Mar 2021 17:48:28 +0000 (19:48 +0200)
committerJuri Linkov <juri@linkov.net>
Mon, 8 Mar 2021 17:48:28 +0000 (19:48 +0200)
(xref--insert-xrefs): Use run-hooks on it.

lisp/progmodes/xref.el

index af46365325b6f1ba27121b1d082bf7e13b81480b..c066d9dc024bdee543fe74f61b6350698531fda4 100644 (file)
@@ -411,6 +411,12 @@ elements is negated: these commands will NOT prompt."
   "Functions called after returning to a pre-jump location."
   :type 'hook)
 
+(defcustom xref-after-update-hook nil
+  "Functions called after the xref buffer is updated."
+  :type 'hook
+  :version "28.1"
+  :package-version '(xref . "1.0.4"))
+
 (defvar xref--marker-ring (make-ring xref-marker-ring-length)
   "Ring of markers to implement the marker stack.")
 
@@ -927,7 +933,8 @@ GROUP is a string for decoration purposes and XREF is an
                          prefix summary)
                         (setq prev-line line
                               prev-group group))))
-           (insert "\n")))
+           (insert "\n"))
+  (run-hooks 'xref-after-update-hook))
 
 (defun xref--analyze (xrefs)
   "Find common filenames in XREFS.