From 04c43bb0477682a839187f2df816342d95bf6f21 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Mon, 8 Mar 2021 19:48:28 +0200 Subject: [PATCH] * lisp/progmodes/xref.el (xref-after-update-hook): New defcustom (bug#46992). (xref--insert-xrefs): Use run-hooks on it. --- lisp/progmodes/xref.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index af46365325b..c066d9dc024 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -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. -- 2.39.2