emacsorphanage / quickrun

Run command quickly. This packages is inspired quickrun.vim
GNU General Public License v3.0
480 stars 43 forks source link

Why not remove the temp file when finished ? #84

Open Yevgnen opened 7 years ago

Yevgnen commented 7 years ago

Every time I run quickrun, the temp file is left there. Is there any specified reason for keeping these files ? quickrun.el

syohex commented 7 years ago

Could you show me how to reproduce this issue ? quickrun.el removes temporary file after command is finished. If some unexpected error occurs then temporary file is left.

Yevgnen commented 7 years ago

Thanks for your reply. Looking in the code, the file is removed only when has error.

fu123456 commented 4 years ago

I also do. How to remove temporary file? When I run the file, it outputs files like qr_*. These termporary files are very noisy to me.

jcs090218 commented 4 years ago

Looking in the code, the file is removed only when has error.

I think this is the issue. Mark it with bug label.

shishimaru commented 1 year ago

I was also confused about this issue and found it was derived from quickrun-timeout-seconds.

I set nil to turn off the timeout, but the codes to delete the temporal files weren't reached. If you want to run the subprocess for a long time, I recommend setting a large number with the variable without setting nil.

zw963 commented 8 months ago

Consider this issue never fix since 2016, i use my own solution, create a hidden folder on current work directory, then put temp there.

Following code not work, because the command never run again.

(setq quickrun-option-default-directory ".quickrun/")
(defun quickrun--create-option-default-directory ()
  (unless (file-directory-p quickrun-option-default-directory)
    (make-directory quickrun-option-default-directory)))
(advice-add 'quickrun :before #'quickrun--create-option-default-directory)

;; Then other code
(require 'quickrun)
;; ...

so, i hack following fun let output tmp file hidden.

(require 'quickrun)

(defun quickrun--temp-name (src)
  "Not documented."
  (let* ((extension (file-name-extension src))
         (suffix (or (and extension (concat "." extension)) ""))
         (dir (quickrun--default-directory)))
    (expand-file-name (concat dir (make-temp-name ".qr_") suffix))))