1
0
mirror of https://github.com/m00natic/vlfi.git synced 2024-10-05 18:30:51 +01:00

Add vlfi-occur-show command for showing match but still staying in

occur buffer.
This commit is contained in:
Andrey Kotlarski 2013-04-17 11:53:49 +03:00
parent 54927afb8f
commit 70719b0917

14
vlfi.el
View File

@ -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."