]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/vlf/vlf-occur.el
* packages/vlf: Version 1.5. Add hexl-mode integration and hook
[gnu-emacs-elpa] / packages / vlf / vlf-occur.el
index 3b7be8510c38da604e2dd897b7e4dc7bcedfb11a..cea885ed525177b1fb19305a8ffb88a4a65a00e9 100644 (file)
@@ -131,8 +131,11 @@ Prematurely ending indexing will still show what's found so far."
           (set (make-local-variable 'vlf-batch-size) batch-size)
           (vlf-mode 1)
           (goto-char (point-min))
+          (run-hook-with-args 'vlf-before-batch-functions 'occur)
           (vlf-with-undo-disabled
-           (vlf-build-occur regexp vlf-buffer))))
+           (vlf-build-occur regexp vlf-buffer))
+          (run-hook-with-args 'vlf-after-batch-functions 'occur)))
+    (run-hook-with-args 'vlf-before-batch-functions 'occur)
     (let ((start-pos vlf-start-pos)
           (end-pos vlf-end-pos)
           (pos (point)))
@@ -141,11 +144,13 @@ Prematurely ending indexing will still show what's found so far."
        (goto-char (point-min))
        (unwind-protect (vlf-build-occur regexp (current-buffer))
          (vlf-move-to-chunk start-pos end-pos)
-         (goto-char pos))))))
+         (goto-char pos))))
+    (run-hook-with-args 'vlf-after-batch-functions 'occur)))
 
 (defun vlf-build-occur (regexp vlf-buffer)
   "Build occur style index for REGEXP over VLF-BUFFER."
-  (let ((tramp-verbose (min 2 tramp-verbose))
+  (let ((tramp-verbose (if (boundp 'tramp-verbose)
+                           (min tramp-verbose 2)))
         (case-fold-search t)
         (line 1)
         (last-match-line 0)