diff options
author | Thierry Volpiatto <thievol@posteo.net> | 2021-10-23 08:44:36 +0200 |
---|---|---|
committer | Thierry Volpiatto <thievol@posteo.net> | 2021-10-23 08:44:36 +0200 |
commit | 86b40bccb4300880a89aed0b7d0189ec4cc74e46 (patch) | |
tree | c59f6540fef559b55a4365bd9a101aa222ec563b /helm-external.el | |
parent | a030335d3f5d108ef2c79e9bf0a4d2437c9cd026 (diff) |
Allow running helm-run-or-raise detached even with files
It is not used for now, but may be useful later.
Diffstat (limited to 'helm-external.el')
-rw-r--r-- | helm-external.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/helm-external.el b/helm-external.el index d8ee0a71..4c26a89c 100644 --- a/helm-external.el +++ b/helm-external.el @@ -86,9 +86,8 @@ contents. Else it calculates all external commands and sets "Run asynchronously EXE or jump to the application window. If EXE is already running just jump to his window if `helm-raise-command' is non-nil. -When FILE argument is provided run EXE with FILES. -When argument DETACHED is non nil, run EXE and detach it from Emacs, -this have no effect when FILES arg is specified." +When FILES argument is provided run EXE with FILES. +When argument DETACHED is non nil, detach process from Emacs." (let* ((proc-name (replace-regexp-in-string "(" "" (car (split-string exe)))) (fmt-file (lambda (file) @@ -98,6 +97,8 @@ this have no effect when FILES arg is specified." (expand-file-name file))))) (file-arg (and files (mapconcat fmt-file files " "))) process-connection-type proc) + (when (and files detached (not (string-match "%s &)\\'" exe))) + (setq exe (format "(%s &)" exe))) (when (member proc-name helm-external-commands-list) ;; Allow adding more files to the current process if it is ;; already running (i.e. Don't just raise it without sending |