Windows 7. Emacs 24.3.1. Git 1.8.1.msysgit.1. I have the following in my equivalent .emacs file:
(if (equal system-type \'windows-nt)
(progn (setq explicit-s
Using GitBash you can use the lein script instead of the lein.bat script. Put the lein script into a directory called bin
in your user account on windows. GitBash should have that bin
directory on its executable PATH
, so you can run lein
anywhere.
With this approach you do not need any configuration in Emacs Lisp.
See my full answer
Try setting both variables to point to the same executable and make sure the path is in 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")
I know this is an older question, but I found it while I was searching for help on the same issue, so here's the solution I use for my particular use case, in case it helps someone in the future.
I sync up my .emacs.d
between all computers I use emacs on, which includes both Linux & Windows machines. I inserted this into my init.el
file to automatically deal with this issue appropriately in a Windows environment:
;; 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))
Please note that the variable git-shell-path
will need to be defined based on where you have git
installed on your system. I install it in %USERPROFILE%\LocalAppInfo\apps\Git
on the one Windows machine where I use it.