emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 5efa2ddf62d: Correctly check buffer mtime when displaying xref ma


From: Dmitry Gutov
Subject: master 5efa2ddf62d: Correctly check buffer mtime when displaying xref matches
Date: Wed, 27 Mar 2024 23:24:20 -0400 (EDT)

branch: master
commit 5efa2ddf62d4876fb62f23b571f4cc0af5885639
Author: Spencer Baugh <sbaugh@janestreet.com>
Commit: Dmitry Gutov <dmitry@gutov.dev>

    Correctly check buffer mtime when displaying xref matches
    
    This was just a typo: we were checking the modification time of
    current-buffer instead of checking the modification time of the
    passed-in buffer.
    
    This caused matches to not be shown if they weren't present in
    the current in-Emacs state of the buffer.
    
    This was easily reproduced by writing a string to a file outside
    Emacs, then searching for that string with
    e.g. project-find-regexp.  The string would seemingly not be
    found, although in reality it was found, just not displayed.
    
    * lisp/progmodes/xref.el (xref--find-file-buffer):
    Check buf, not current-buffer (bug#70008).
---
 lisp/progmodes/xref.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 717b837a2e5..755c3db04fd 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -2176,7 +2176,7 @@ Such as the current syntax table and the applied syntax 
properties."
                  (or
                   (buffer-modified-p buf)
                   (unless xref--hits-remote-id
-                    (not (verify-visited-file-modtime (current-buffer))))))
+                    (not (verify-visited-file-modtime buf)))))
         ;; We can't use buffers whose contents diverge from disk (bug#54025).
         (setq buf nil))
       (setq xref--last-file-buffer (cons file buf))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]