Emacsのhaskell-modeでGHCi使用時にC-c C-rで編集中ソースのバッファに居続けるパッチ
EmacsのHaskell Modeでは、C-c C-rすると、GHCiのバッファにカーソルが移ってソースをGHCiでリロードする。その場ですぐ色々試したい場合はそのままでいいけど、自分はこまめにエラーチェックのつもりでC-c C-rするので、カーソルはソースバッファに戻って欲しい。パッチというほどの修正じゃないけど。
--- haskell-ghci.el~ 2007-04-10 01:38:18.953125000 +0900 +++ haskell-ghci.el 2007-04-10 01:45:59.109375000 +0900 @@ -271,6 +271,7 @@ (save-excursion (haskell-ghci-go cmd cd)) ;; Show *ghci* buffer. + (let ((haskell-file-buffer (current-buffer))) (pop-to-buffer haskell-ghci-process-buffer) (goto-char haskell-ghci-load-end) @@ -279,13 +280,14 @@ "^Ok, modules loaded" nil t) (progn (goto-char (point-max)) (recenter 2) - (message "There were no errors.")) + (message "There were no errors.") + (pop-to-buffer haskell-file-buffer)) ;; Something went wrong. If possible, be helpful and pinpoint the ;; first error in the file whilst leaving the error visible in the ;; *ghci* buffer. (goto-char haskell-ghci-load-end) - (haskell-ghci-locate-next-error))) + (haskell-ghci-locate-next-error)))) (defun haskell-ghci-locate-next-error ()
※patchコマンドでは-lしてください。