GNU bug report logs -
#46992
xref-after-update-hook
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Sun, 7 Mar 2021 18:52:02 UTC
Severity: wishlist
Tags: fixed, patch
Fixed in version 28.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Version: 28.0.50
Severity: wishlist
Tags: patch
As suggested in https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00161.html
here is a patch that adds such hook:
[xref-after-update-hook.patch (text/x-diff, inline)]
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 18fdd963fb..ba4e48faf8 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -415,6 +415,10 @@ xref-after-return-hook
"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)
+
(defvar xref--marker-ring (make-ring xref-marker-ring-length)
"Ring of markers to implement the marker stack.")
@@ -919,7 +933,8 @@ xref--insert-xrefs
"RET or mouse-1: follow reference"))
prefix new-summary)
(setq prev-line-key line-key)))
- (insert "\n"))))
+ (insert "\n")))
+ (run-hooks 'xref-after-update-hook))
(defun xref--analyze (xrefs)
"Find common filenames in XREFS.
This bug report was last modified 4 years and 134 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.