Railsのプロジェクトで coffee script を使うけどもコンパイルは全て Asset pipelineがやってくれるので、たまに変換結果の js をちょっと見てみたい時に困った事になります。
なのでEmacsの smart compile の機能を使ってすぐに 出力結果を得られるようにしてみました。
解決策
coffee -pで標準出力に変換結果を出力してくれるので
(global-set-key (kbd "C-c C-x") 'smart-compile)
(setq smart-compile-alist
(append
'(("\\.rb$" . "ruby %f"))
'(("\\.php$" . "php %f"))
'(("\\.coffee$" . "coffee -p %f"))
'(("\Gemfile$" . "bundle install"))
smart-compile-alist))
としておけばOKです。
参考
[Convert coffee to javascript and show the result to standard output in Emacs – Stack Overflow][1]