Created
March 1, 2012 14:10
-
-
Save hara-y-u/1950055 to your computer and use it in GitHub Desktop.
同期的にシェルコマンドを実行して出力を返す elisp 関数
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun exec-shell-command-sync (command &rest args) | |
(let (ret | |
(process | |
(apply 'start-process-shell-command "exec" nil command args))) | |
(set-process-filter | |
process | |
'(lambda (process output) | |
(setq ret (cons output ret)) | |
)) | |
(while (not (equalp (process-status process) 'exit)) | |
(sleep-for 0 10)) | |
(car ret))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment