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 并输入“ls”。
然而,M-x shell 命令正在失败。当我尝试通过 shell 命令运行“ls”时(根据命令,它应该在 *Shell Command Output* 缓冲区中打印其输出)C-h f shell 命令),我收到一条错误消息:
“搜索程序:权限被拒绝,bash”
谷歌上有一些非常古老的建议调用过程StackOverflow 上有很多关于让 shell 在 Emacs 中工作的问题。请注意M-x外壳效果很好,我想要工作的是 shell 命令。
(原因:https://github.com/donkirkby/live-py-plugin#installing-the-emacs-mode https://github.com/donkirkby/live-py-plugin#installing-the-emacs-mode)
尝试将两个变量设置为指向同一个可执行文件并确保路径位于exec-path
:
(setq explicit-shell-file-name
"C:/Program Files (x86)/Git/bin/bash.exe")
(setq shell-file-name explicit-shell-file-name)
(add-to-list 'exec-path "C:/Program Files (x86)/Git/bin")
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)