From a8f644c194ffce4a1de44f099ba985cc02100f93 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Thu, 3 Oct 2024 22:03:09 +0300 Subject: [PATCH] xref-location-marker: Use find-file-noselect to ensure uptodateness * lisp/progmodes/xref.el (xref-location-marker): Always call 'find-file-noselect' rather than 'get-file-buffer' to go through the visited-file-modtime verification every time. (cherry picked from commit a9e36fc3bf811853e152e7ff427a39272cff1a80) --- lisp/progmodes/xref.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index a049c98e5ce..c0891598605 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -150,9 +150,8 @@ Line numbers start from 1 and columns from 0." (cl-defmethod xref-location-marker ((l xref-file-location)) (pcase-let (((cl-struct xref-file-location file line column) l)) (with-current-buffer - (or (get-file-buffer file) - (let ((find-file-suppress-same-file-warnings t)) - (find-file-noselect file))) + (let ((find-file-suppress-same-file-warnings t)) + (find-file-noselect file)) (save-restriction (widen) (save-excursion -- 2.39.2