From: Mattias EngdegÄrd Date: Thu, 19 Aug 2021 21:15:29 +0000 (+0200) Subject: Fix xref {prev,next}-error target buffer match highlighting extent X-Git-Tag: emacs-28.0.90~1422 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e1ed0c3af182b313f8f1a8f0d50fcda369aaf71c;p=emacs.git Fix xref {prev,next}-error target buffer match highlighting extent * lisp/progmodes/xref.el (xref--next-error-function): Bind `xref--current-item` during the call to `xref--show-location` so that `xref-pulse-momentarily` finds the match extent. --- diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index d3780d571fc..b6ad4854070 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -877,7 +877,8 @@ beginning of the line." ;; it gets reset to that window's point from time to time). (let ((win (get-buffer-window (current-buffer)))) (and win (set-window-point win (point)))) - (xref--show-location (xref-item-location xref) t)) + (let ((xref--current-item xref)) + (xref--show-location (xref-item-location xref) t))) (t (error "No %s xref" (if backward "previous" "next"))))))