[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vlf 42e581d 144/310: Add command to unconditionally ope
From: |
Stefan Monnier |
Subject: |
[elpa] externals/vlf 42e581d 144/310: Add command to unconditionally open fresh VLF buffer to visit occur |
Date: |
Sat, 28 Nov 2020 00:33:04 -0500 (EST) |
branch: externals/vlf
commit 42e581da611ee2e45f52a4ad4e3807220796b872
Author: Andrey Kotlarski <m00naticus@gmail.com>
Commit: Andrey Kotlarski <m00naticus@gmail.com>
Add command to unconditionally open fresh VLF buffer to visit occur
match.
---
vlf.el | 38 ++++++++++++++++++++++++--------------
1 file changed, 24 insertions(+), 14 deletions(-)
diff --git a/vlf.el b/vlf.el
index daad2e5..8159a59 100644
--- a/vlf.el
+++ b/vlf.el
@@ -645,6 +645,7 @@ Search is performed chunk by chunk in `vlf-batch-size'
memory."
(define-key map "n" 'vlf-occur-next-match)
(define-key map "p" 'vlf-occur-prev-match)
(define-key map "\C-m" 'vlf-occur-visit)
+ (define-key map "\M-\r" 'vlf-occur-visit-new-buffer)
(define-key map [mouse-1] 'vlf-occur-visit)
(define-key map "o" 'vlf-occur-show)
map)
@@ -684,10 +685,16 @@ EVENT may hold details of the invocation."
(vlf-occur-visit event)
(pop-to-buffer occur-buffer)))
+(defun vlf-occur-visit-new-buffer ()
+ "Visit `vlf-occur' link in new vlf buffer."
+ (interactive)
+ (let ((current-prefix-arg t))
+ (vlf-occur-visit)))
+
(defun vlf-occur-visit (&optional event)
"Visit current `vlf-occur' link in a vlf buffer.
-If original VLF buffer has been killed,
-open new VLF session each time.
+With prefix argument or if original VLF buffer has been killed,
+open new VLF session.
EVENT may hold details of the invocation."
(interactive (list last-nonmenu-event))
(when event
@@ -699,20 +706,23 @@ EVENT may hold details of the invocation."
(if file
(let ((chunk-start (get-char-property pos 'chunk-start))
(chunk-end (get-char-property pos 'chunk-end))
- (buffer (get-char-property pos 'buffer))
+ (vlf-buffer (get-char-property pos 'buffer))
+ (occur-buffer (current-buffer))
(match-pos (+ (get-char-property pos 'line-pos)
pos-relative)))
- (or (buffer-live-p buffer)
- (let ((occur-buffer (current-buffer)))
- (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)
+ (cond (current-prefix-arg
+ (setq vlf-buffer (vlf file))
+ (switch-to-buffer occur-buffer))
+ ((not (buffer-live-p vlf-buffer))
+ (or (catch 'found
+ (dolist (buf (buffer-list))
+ (set-buffer buf)
+ (and vlf-mode (equal file buffer-file-name)
+ (setq vlf-buffer buf)
+ (throw 'found t))))
+ (setq vlf-buffer (vlf file)))
+ (switch-to-buffer occur-buffer)))
+ (pop-to-buffer vlf-buffer)
(vlf-move-to-chunk chunk-start chunk-end)
(goto-char match-pos)))))
- [elpa] externals/vlf 705f9ce 064/310: Add issue section to the README., (continued)
- [elpa] externals/vlf 705f9ce 064/310: Add issue section to the README., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 9fad430 066/310: Fix positioning after save., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf e545769 128/310: Fix adjusting of end chunk bytes., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf ae2237d 135/310: Minor adjustments:, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf cb47e19 139/310: Use temporary buffer for occur in case of modifications., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 7a14109 137/310: Fix search for GNU Emacs 23 (no assert)., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 452b7eb 141/310: Ensure there are no modifications when executing searches., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf a42247c 150/310: Automatically scroll to adjacent batch when start or end of chunk is, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 959bbc7 155/310: Disable undo in cases of partial chunk move., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf a65f3a4 143/310: Check for unsaved changes before search query and don't enable undo if, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 42e581d 144/310: Add command to unconditionally open fresh VLF buffer to visit occur,
Stefan Monnier <=
- [elpa] externals/vlf 3e8098a 149/310: Rename vlf-discard-edit -> vlf-refresh., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf c0a85cd 159/310: Fix position when moving to overlapping chunk., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 2aea17a 163/310: Fix behaviour when size is missing (creating file) in, Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 88924f9 164/310: Fix vlf-write behaviour for newly created file., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 9c50487 165/310: Introduce list of major modes where VLF will not activate., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 152462a 166/310: Fix autoloads in last commit., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf e67895a 068/310: Optionally strip superfluous operations when inserting batches., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 6773248 104/310: Optimize a bit goto line., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 4134de0 177/310: Add intelligent recenter chunk around point functionality., Stefan Monnier, 2020/11/28
- [elpa] externals/vlf 9b22b74 134/310: Add gitignore., Stefan Monnier, 2020/11/28