화요일, 9월 05, 2006

Emacs: how to use bash from Windows

Add the below elisp to .emacs file.
Original scripts came from 'http://www.khngai.com/emacs/cygwin.php'.
You can download cygwin-mount.el file from 'http://www.khngai.com/emacs/cygwin-mount.el'.

One more TIP. During my cscope setup from Windows Emacs, I found it did not work properly if I did not set bash as my shell from Emacs. I can't sure what is the cause of it.

(setenv "PATH" (concat "d:/cygwin/bin;" (getenv "PATH")))
(setq exec-path (cons "d:/cygwin/bin/" exec-path))
(require 'cygwin-mount)
(cygwin-mount-activate)

(add-hook 'comint-output-filter-functions
'shell-strip-ctrl-m nil t)
(add-hook 'comint-output-filter-functions
'comint-watch-for-password-prompt nil t)
(setq explicit-shell-file-name "bash.exe")
;; For subprocesses invoked via the shell
;; (e.g., "shell -c command")
(setq shell-file-name explicit-shell-file-name)
(setq default-process-coding-system '(undecided-dos . undecided-unix))

댓글 없음: