【发布时间】:2013-05-16 14:50:33
【问题描述】:
Windows 7. Emacs 24.3.1。 Git 1.8.1.msysgit.1。我的等效 .emacs 文件中有以下内容:
(if (equal system-type 'windows-nt)
(progn (setq explicit-shell-file-name
"C:/Program Files (x86)/Git/bin/sh.exe")
(setq shell-file-name "bash")
(setq explicit-sh.exe-args '("--login" "-i"))
(setenv "SHELL" shell-file-name)
(add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m)))
这在我想做 M-x shell 时非常有用:我可以弹出一个 shell 并输入“ls”。
但是,M-x shell-command 失败了。当我尝试通过 shell-command 运行“ls”时(根据 Ch f shell-command,它应该在 *Shell Command Output* 缓冲区中打印其输出),我收到一条错误消息:
“搜索程序:权限被拒绝,bash”
Google 上有一些关于 call-process 的非常古老的建议,StackOverflow 上有很多关于让 shell 在 Emacs 中工作的问题。请注意 M-x shell 效果很好,而我想要使用的是 shell-command。
(原因:https://github.com/donkirkby/live-py-plugin#installing-the-emacs-mode)
【问题讨论】: