GaucheのInfoをEmacsで見る
カーソルを合わせている関数のinfoを見られるようにする。
1. まず、http://www.katch.ne.jp/~leque/software/repos/gauche-mode/gauche-mode.el
をロードパスの通ったところに入れ(ロードパスはM-x describe-variable load-pathで見れる)、
.emacsに
(autoload 'gauche-mode "gauche-mode" nil t) ;1つ目の引数はM-xのあとにタイプするもの、2つ目のはgauche-modeのファイル名
を追加。
2. (Emacsのインストールされているフォルダ)/info/dirに
* Gauche (ja): (gauche-refj.info). An R5RS Scheme implementation.
を追加。
3. infoファイル(拡張子がinfoのもの、gauche-refe.info*)を
(Emacsのフォルダ)/infoに保存。
これで、infoを見たい関数のところで
M-x info-lookup-symbol
としてやると見られる。
べんりー!
Emacsのインデント、ハイライト設定
Gauche特有の手続きの場合、Emacsのscheme-modeでもハイライトされなかったりインデントがうまくいかなかったりする。
それで設定をしようと思ったのだけれど、.emacsに書くのはどう考えてもアレなのでscheme-mode自体をいじることにした。
そのときいじるファイルはmacのCarbonEmacsなら
/Applications/Emacs.app/Contents/Resources/lisp/progmodes/にあるscheme.el
インデント
scheme.elに
http://karetta.jp/book-node/kahua-seminar2/000735
をコピペ。
ハイライト
ハイライトしたい単語を以下のように追加する。
場所はだいたい300行くらいのとこ。
(defconst scheme-font-lock-keywords-2 (append scheme-font-lock-keywords-1 (eval-when-compile (list ;; ;; Control structures. (cons (concat "(" (regexp-opt '("begin" "call-with-current-continuation" "call/cc" "call-with-input-file" "call-with-output-file" "case" "cond" "do" "else" "for-each" "if" "lambda" "let" "let*" "let-syntax" "letrec" "letrec-syntax" ;;こんな感じで追加する ;; for Gauche "let-optionals*" "fold" "match" ;; Hannes Haug <hannes.haug@student.uni-tuebingen.de> wants: "and" "or" "delay" "force" ;; Stefan Monnier <stefan.monnier@epfl.ch> says don't bother: ;;"quasiquote" "quote" "unquote" "unquote-splicing" "map" "syntax" "syntax-rules") t) "\\>") 1)
あとはM-x byte-compile-fileでscheme.elをバイトコンパイルすればOK。
簡単!!