1
0
mirror of https://github.com/m00natic/vlfi.git synced 2025-01-19 04:20:47 +00:00

Execute vlf-after-batch-functions hook even on user quit command before

end of search.  Update buffer name after unsuccessful goto line.
This commit is contained in:
Andrey Kotlarski 2014-02-15 02:32:43 +02:00
parent 859c1e4c45
commit b235cf907c

View File

@ -120,14 +120,14 @@ BATCH-STEP is amount of overlap between successive chunks."
count to-find) count to-find)
(vlf-goto-match match-chunk-start match-chunk-end (vlf-goto-match match-chunk-start match-chunk-end
match-start-pos match-end-pos match-start-pos match-end-pos
count to-find))))) count to-find))
(run-hook-with-args 'vlf-after-batch-functions 'search)) (run-hook-with-args 'vlf-after-batch-functions 'search)))))
(defun vlf-goto-match (match-chunk-start match-chunk-end (defun vlf-goto-match (match-chunk-start match-chunk-end
match-pos-start match-pos-start
match-pos-end match-pos-end
count to-find) count to-find)
"Move to MATCH-CHUNK-START MATCH-CHUNK-END surrounding \ "Move to MATCH-CHUNK-START MATCH-CHUNK-END surrounding\
MATCH-POS-START and MATCH-POS-END. MATCH-POS-START and MATCH-POS-END.
According to COUNT and left TO-FIND, show if search has been According to COUNT and left TO-FIND, show if search has been
successful. Return nil if nothing found." successful. Return nil if nothing found."
@ -248,6 +248,7 @@ Search is performed chunk by chunk in `vlf-batch-size' memory."
(unless success (unless success
(vlf-with-undo-disabled (vlf-with-undo-disabled
(vlf-move-to-chunk-2 start-pos end-pos)) (vlf-move-to-chunk-2 start-pos end-pos))
(vlf-update-buffer-name)
(goto-char pos) (goto-char pos)
(message "Unable to find line")) (message "Unable to find line"))
(run-hook-with-args 'vlf-after-batch-functions 'goto-line)))) (run-hook-with-args 'vlf-after-batch-functions 'goto-line))))