emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/vlf 2dba838 140/310: In case original VLF buffer has be


From: Stefan Monnier
Subject: [elpa] externals/vlf 2dba838 140/310: In case original VLF buffer has been killed, try to find existing VLF
Date: Sat, 28 Nov 2020 00:33:03 -0500 (EST)

branch: externals/vlf
commit 2dba8380156dbaec82985fce76ed549489c1dfc6
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>

    In case original VLF buffer has been killed, try to find existing VLF
    buffer for the same file when visiting occur results.
---
 vlf.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/vlf.el b/vlf.el
index 84049d7..ea2248a 100644
--- a/vlf.el
+++ b/vlf.el
@@ -696,7 +696,13 @@ EVENT may hold details of the invocation."
                             pos-relative)))
           (or (buffer-live-p buffer)
               (let ((occur-buffer (current-buffer)))
-                (setq buffer (vlf file))
+                (or (catch 'found
+                      (dolist (buf (buffer-list))
+                        (set-buffer buf)
+                        (and vlf-mode (equal file buffer-file-name)
+                             (setq buffer buf)
+                             (throw 'found t))))
+                    (setq buffer (vlf file)))
                 (switch-to-buffer occur-buffer)))
           (pop-to-buffer buffer)
           (vlf-move-to-chunk chunk-start chunk-end)
@@ -708,7 +714,7 @@ Prematurely ending indexing will still show what's found so 
far."
   (interactive (list (read-regexp "List lines matching regexp"
                                   (if regexp-history
                                       (car regexp-history)))))
-  (if (buffer-modified-p) ;use temporary buffer not to interfere with 
modifications 
+  (if (buffer-modified-p) ;use temporary buffer not to interfere with 
modifications
       (let ((vlf-buffer (current-buffer))
             (file buffer-file-name)
             (batch-size vlf-batch-size))



reply via email to

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