31.15. Running Shell Commands from Emacs Emacs has commands for passing single command lines to inferior shell processes; it can also run a shell interactively with input and output to an Emacs buffer named *shell* or run a shell inside a terminal emulator window. There is a shell implemented entirely in Emacs, documented in a separate manual. . M-! cmd RETRun the shell command line cmd and displa
昨日作ったLispで困っていたのが、実行した外部コマンドの出力を変数に入れる部分です。 結局*perldoc*というバッファを経由したのですが、shell-command-to-stringというfunctionがあることが通りすがりさんの改良版を見ていて気づきました。 M-x describe-functionとM-x describe-key, M-x describe-bindings以外に、こんな関数ないかなぁとかって調べる方法を確立できていないのが問題だなぁ。 通りすがりさん提供版はモジュールが存在しないばあいのエラー処理や、モジュール文字列の範囲判定などが改善されているようです。 (put ’perl-module-thing ’end-op (lambda () (re-search-forward ”??=[a-zA-Z][a-zA-Z0-9_:]*” nil t))) (
exec-path という変数がsub-processを立ち上げる場合の検索パスらしい。ので、start-processはexec-passを使って プログラムを探す。start-processはシェルを介さないので、エイリアスは使えない。たとえば、僕の必殺エイリアス(!?) alias e 'env LC_ALL=C XMODIFIERS=@im=none xemacs -geometry 140x90+800+0 &' があっても start-process には理解してもらえない。 (start-process "hoge" "result" "e") ;; ミニバッファに Searching Program ... そんなんありません的メッセージがでる。 逆に start-process-shell-command はエイリアスが利用できる。start-process を star
#contents * 文字列 ** リファレンス - [[GNU Emacs Lispリファレンスマニュアル: 文字列と文字>http://www.bookshelf.jp/texi/elisp-manual/21-2-8/jp/elisp_5.html#SEC71]] - [[Strings and Characters - GNU Emacs Lisp Reference Manual>http://www.gnu.org/software/emacs/manual/html_node/elisp/Strings-and-Characters.html#Strings-and-Characters]] - [[Formatting Strings - GNU Emacs Lisp Reference Manual>http://www.gnu.org/software/emacs/m
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く