Skip to content

Instantly share code, notes, and snippets.

@ongaeshi
Created January 14, 2011 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ongaeshi/779364 to your computer and use it in GitHub Desktop.
Save ongaeshi/779364 to your computer and use it in GitHub Desktop.
Meadowでterm-modeにチャレンジの足跡
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; shell
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; パスの設定
;; より下に記述した物が PATH の先頭に追加されます
(dolist (dir (list
"/sbin"
"/usr/sbin"
"/bin"
"/usr/bin"
"/opt/local/bin"
"/sw/bin"
"/usr/local/bin"
(expand-file-name "~/bin")
(expand-file-name "~/.emacs.d/bin")
))
;; PATH と exec-path に同じ物を追加します
(when (and (file-exists-p dir) (not (member dir exec-path)))
(setenv "PATH" (concat dir ":" (getenv "PATH")))
(setq exec-path (append (list dir) exec-path))))
;; もしコマンドプロンプトを利用するなら sjis にする
(setq file-name-coding-system 'sjis)
(setq locale-coding-system 'sjis)
;; shell の存在を確認
(defun skt:shell ()
(or ;;(executable-find "zsh")
;;(executable-find "bash")
(executable-find "f_zsh") ;; Emacs + Cygwin を利用する人は Zsh の代りにこれにしてください
(executable-find "f_bash") ;; Emacs + Cygwin を利用する人は Bash の代りにこれにしてください
(executable-find "cmdproxy")
(error "can't find 'shell' command in PATH!!")))
;; Shell 名の設定
(setq shell-file-name (skt:shell))
(setenv "SHELL" shell-file-name)
(setq explicit-shell-file-name shell-file-name)
----------------------------------
1. .emacsにshellの設定を追加
gistに付属した .emacs を参考
----------------------------------
2. c:/app/Meadow3/lisp/term.elc を削除し、term.elを修正
gistに付属した term.el.diff を参考
http://2bangai.net/read/5b52f62df8d2a265b0f673487ced2dc3ed74eb1cc7006fc1d95e5032a5606ae5/801
----------------------------------
3. パスの通った場所(c:/cygwin/bin等)に、fakecygpty.exeをリネームしたf_bashと、f_shを用意する
gcc -o fakecygpty.exe fakecygpty.c
cp fakecygpty.exe f_bash.exe
cp fakecygpty.exe f_sh.exe
----------------------------------
4. 実行したら
apply: Spawning child process: no such file or directory
は無くなったものの、今度は
error in process filter: cd-absolute: c:/c/app/Meadow3/bin
/: no such directory
error in process filter: c:/c/app/Meadow3/bin
/: no such directory
-----------------------------------
とかいわれる、うーん。
diff -c "c:/app/Meadow3/lisp/term.el" "c:/app/Meadow3/lisp/term.el.org"
*** c:/app/Meadow3/lisp/term.el 2011-01-14 17:29:37.354875000 +0900
--- c:/app/Meadow3/lisp/term.el.org 2011-01-14 16:39:27.245500000 +0900
***************
*** 1439,1447 ****
;; do the decoding by hand on the parts that are made of chars.
(coding-system-for-read 'binary))
(apply 'start-process name buffer
! ; "/bin/sh" "-c"
! "f_sh" "-c"
! ; "cmd"
(format "stty -nl echo rows %d columns %d sane 2>/dev/null;\
if [ $1 = .. ]; then shift; fi; exec \"$@\""
term-height term-width)
--- 1439,1445 ----
;; do the decoding by hand on the parts that are made of chars.
(coding-system-for-read 'binary))
(apply 'start-process name buffer
! "/bin/sh" "-c"
(format "stty -nl echo rows %d columns %d sane 2>/dev/null;\
if [ $1 = .. ]; then shift; fi; exec \"$@\""
term-height term-width)
Diff finished. Fri Jan 14 17:38:01 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment