Set shell under Windows to Cygwin/MSYS sh.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Mon, 26 Apr 2010 17:05:42 +0300
changeset 388 c7a4c56c60ec
parent 387 7340a863ae23
child 389 b11171df86df
Set shell under Windows to Cygwin/MSYS sh.
.emacs-my
--- a/.emacs-my	Mon Apr 26 17:04:33 2010 +0300
+++ b/.emacs-my	Mon Apr 26 17:05:42 2010 +0300
@@ -635,15 +635,20 @@
   commands. If nil, 'sh' will be used." )
 
 (when (eq window-system 'w32)           ; may require Cygwin or MSYS
-  (setenv "ESHELL" "bash")
-  (when my-use-windows-shell
-    ;; Restore shell name if user set SHELL env var for Cygwin/MSYS.
-    (setq shell-file-name (concat exec-directory "cmdproxy.exe"))
-    ;; Here is workaround: when explicit-shell-file-name is "bash" and shell-file-name is "cmdproxy.exe"
-    ;; find-dired incorrect quote args (in shell-quote-argument (w32-shell-name) return "bash", but
-    ;; shell-command used shell-file-name which value "cmdproxy.exe"). So I put additional space in pattern to
-    ;; prevent quoting.
-    (setq find-ls-option '("-exec ls -ld {}  ;" . "-ld"))
+  (if my-use-windows-shell
+      (prog
+       ;; Restore shell name if user set SHELL env var for Cygwin/MSYS.
+       (setq shell-file-name (concat exec-directory "cmdproxy.exe"))
+       ;; Here is workaround: when explicit-shell-file-name is "bash" and shell-file-name is "cmdproxy.exe"
+       ;; find-dired incorrect quote args (in shell-quote-argument (w32-shell-name) return "bash", but
+       ;; shell-command used shell-file-name which value "cmdproxy.exe"). So I put additional space in pattern to
+       ;; prevent quoting.
+       (setq find-ls-option '("-exec ls -ld {}  ;" . "-ld"))
+       )
+    (prog
+     ;; Use shell from Cygwin/MinGW.
+     (setq shell-file-name "sh")
+     )
     )
   ;; (setq explicit-shell-file-name "bash")
   (setq explicit-bash-args '("-i"))