Windows, Emacs, Git Bash 和贝壳队

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 壳牌团队

失败。 当我想要跑步时 "ls" 通过shell命令 /这应该在缓冲区中打印自己的结论 *Shell Command Output*, 根据

C-h f 壳牌团队

/, 我收到一条错误消息:

"Searching for program: permission denied, bash"

在 Google 有几个非常古老的建议

挑战过程

还有很多问题 StackOverflow 关于如何制作 shell 工作 Emacs. 请注意

M-x shell

完美的工作,以及我想工作的,是一个壳牌团队。

/原因:
https://github.com/donkirkby/l ... -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"/

江南孤鹜

赞同来自:

我知道这是一个较旧的问题,但是当我在寻找同一问题的帮助时发现它,所以这是我为我的特定使用情况使用的解决方案,以防它将有助于某人。

我同步我自己
.emacs.d

在我使用的所有计算机之间 emacs, 包括两辆汽车 Linux & Windows. 我将它插入我的文件中
init.el

, 在媒体中自动解决此问题 Windows:


;; Set Windows-specific preferences if running in a Windows environment.
/defun udf-windows-setup // /interactive/
;; The variable `git-shell-path' contains the path to the `Git\bin'
;; file on my system. I install this in
;; `%USERPROFILE%\LocalAppInfo\apps\Git\bin'.
/setq git-shell-path
/concat /getenv "USERPROFILE"/ "\\LocalAppInfo\\apps\\Git\\bin"//
/setq git-shell-executable
/concat git-shell-path "\\bash.exe"//
/add-to-list 'exec-path git-shell-path/
/setenv "PATH"
/concat git-shell-path ";"
/getenv "PATH"///
/message "Windows preferences set."//

/if /eq system-type 'windows-nt/
/udf-windows-setup//


请注意变量
git-shell-path

必须根据安装系统中的位置确定
git

. 我把它放进了
%USERPROFILE%\LocalAppInfo\apps\Git

一辆车 Windows, 我使用它的地方。

奔跑吧少年

赞同来自:

使用 GitBash, 您可以使用脚本 lein 而不是情景 lein.bat. 放置脚本 lein 在目录中命名
bin

在您的用户帐户中 windows. GitBash 必须有这个目录
bin

在其可执行文件中
PATH

, 所以你可以跑
lein

任何地方。

使用此方法,您不需要任何配置 Emacs Lisp.

https://coderoad.ru/39761234/

要回复问题请先登录注册