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

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

[elpa] externals/vlf 70719b0 089/310: Add vlfi-occur-show command for sh


From: Stefan Monnier
Subject: [elpa] externals/vlf 70719b0 089/310: Add vlfi-occur-show command for showing match but still staying in
Date: Sat, 28 Nov 2020 00:32:53 -0500 (EST)

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

    Add vlfi-occur-show command for showing match but still staying in
    occur buffer.
---
 vlfi.el | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/vlfi.el b/vlfi.el
index 8a2a9a2..9b1c11b 100644
--- a/vlfi.el
+++ b/vlfi.el
@@ -528,6 +528,7 @@ Search is performed chunk by chunk in `vlfi-batch-size' 
memory."
     (define-key map "p" 'vlfi-occur-prev-match)
     (define-key map "\C-m" 'vlfi-occur-visit)
     (define-key map [mouse-1] 'vlfi-occur-visit)
+    (define-key map "o" 'vlfi-occur-show)
     map)
   "Keymap for command `vlfi-occur-mode'.")
 
@@ -552,6 +553,19 @@ Search is performed chunk by chunk in `vlfi-batch-size' 
memory."
     (goto-char (or (previous-single-property-change (point) 'face)
                    (point-max)))))
 
+(defun vlfi-occur-show (&optional event)
+  "Visit current `vlfi-occur' link in a vlfi buffer but stay in the \
+occur buffer.  If original VLFI buffer has been killed,
+open new VLFI session each time.
+EVENT may hold details of the invocation."
+  (interactive (list last-nonmenu-event))
+  (let ((occur-buffer (if event
+                          (window-buffer (posn-window
+                                          (event-end event)))
+                        (current-buffer))))
+    (vlfi-occur-visit event)
+    (pop-to-buffer occur-buffer)))
+
 (defun vlfi-occur-visit (&optional event)
   "Visit current `vlfi-occur' link in a vlfi buffer.
 The same for mouse EVENT."



reply via email to

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