diff options
Diffstat (limited to '.emacs.d')
-rw-r--r-- | .emacs.d/init.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 6d27d71..6405bf1 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -270,11 +270,16 @@ the only window in the frame." ;;; Processes (defun launch-program (command) + "Launch program in the background (or foreground if COMMAND ends with semicolon)." (interactive (list (read-shell-command "Launch program: "))) - (make-process :name command - :buffer "*launch-program*" - :filter #'launch-program-filter - :command (list shell-file-name shell-command-switch command)) + (let ((name command)) + (when (not (string= ";" (substring command -1 nil))) + (setq name (concat command "&")) + (setq command (concat "which " (car (split-string command)) ">/dev/null&&" command "&"))) + (make-process :name name + :buffer "*launch-program*" + :filter #'launch-program-filter + :command (list shell-file-name shell-command-switch command))) (switch-to-buffer "*launch-program*") (bury-buffer "*launch-program*")) (defun launch-program-filter (proc string) |