シェル スクリプトを実行するための簡単な defun を次に示します。
(defun bk-konsoles ()
"Calls: bk-konsoles.bash"
(interactive)
(shell-command (concat (expand-file-name "~/its/plts/goodies/bk-konsoles.bash ")
(if (buffer-file-name)
(file-name-directory (buffer-file-name)))
" &")
nil nil))
アンパサンドなしでプログラムを開始すると、スクリプトが開始されますが、プログラムを閉じるまでemacsがブロックされます。アンパサンドを付けないと、エラーが発生します。
/home/boris/its/plts/goodies/bk-konsoles.bash /home/boris/scl/geekgeek/: exited abnormally with code 1.
編集:
だから今私は使用しています:
(defun bk-konsoles ()
"Calls: bk-konsoles.bash"
(interactive)
(shell-command (concat (expand-file-name "~/its/plts/goodies/bk-konsoles.bash ")
(if (buffer-file-name)
(file-name-directory (buffer-file-name)))
" & disown")
nil nil)
(kill-buffer "*Shell Command Output*"))
編集2:
いいえ - 動作しません:
(defun bk-konsoles ()
"Calls: bk-konsoles.bash"
(interactive)
(let ((curDir default-directory))
;; (shell-command (concat "nohup " (expand-file-name "~/its/plts/goodies/bk-konsoles.bash ") curDir) nil nil)
(shell-command (concat (expand-file-name "~/its/plts/goodies/bk-konsoles.bash ")
curDir "& disown") nil nil)
(kill-buffer "*Shell Command Output*")))
emacs をビジー状態に保ちます -disown
または のいずれかでnohup
。
これが役立つかもしれない場合に私が実行しているスクリプトです: bk-konsoles.bash