diff --git a/fuzzy-finder.el b/fuzzy-finder.el index dfa9bf3..c88c733 100644 --- a/fuzzy-finder.el +++ b/fuzzy-finder.el @@ -137,11 +137,10 @@ This function sets current buffer to BUF, and returns created window." (switch-to-buffer buf) new-window)) -(cl-defun fuzzy-finder--after-term-handle-exit (_ msg) +(cl-defun fuzzy-finder--after-term-handle-exit (&rest _) "Call the action function when fuzzy-finder program terminated normally. -Should be hooked to `term-handle-exit'. -Use MSG to check if fuzzy-finder process exited with code 0." +Should be hooked to `term-handle-exit'." (unless fuzzy-finder--output-file (cl-return-from fuzzy-finder--after-term-handle-exit)) @@ -156,7 +155,7 @@ Use MSG to check if fuzzy-finder process exited with code 0." (lines (split-string text output-delimiter t))) (delete-file output-file) (set-window-configuration fuzzy-finder--window-configuration) - (when (string= "finished\n" msg) + (when lines (with-current-buffer buf (funcall action lines))))) (advice-add #'term-handle-exit