From fd244507c5ea1e7e425f09585fcf15cc90598e9b Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Mon, 24 Dec 2018 05:11:02 +0200 Subject: [PATCH] xref-goto-xref: Highlight the exact symbol after the jump * lisp/progmodes/xref.el (xref-goto-xref): Bind 'xref--current-item' to highlight the exact symbol after the jump and not the whole line. --- lisp/progmodes/xref.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index a0a704f133d..c71802c9188 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -551,9 +551,10 @@ SELECT is `quit', also quit the *xref* window." Non-interactively, non-nil QUIT means to first quit the *xref* buffer." (interactive) - (let ((buffer (current-buffer)) - (xref (or (xref--item-at-point) - (user-error "No reference at point")))) + (let* ((buffer (current-buffer)) + (xref (or (xref--item-at-point) + (user-error "No reference at point"))) + (xref--current-item xref)) (xref--show-location (xref-item-location xref) (if quit 'quit t)) (next-error-found buffer (current-buffer)))) -- 2.39.5