Clean up prelude-coffee.el

This commit is contained in:
toctan 2014-09-26 12:04:30 +08:00
parent 91f53c10ca
commit ca4797da79

View file

@ -33,29 +33,18 @@
;;; Code:
(require 'prelude-programming)
(prelude-require-package 'coffee-mode)
(eval-after-load 'coffee-mode
'(progn
;; CoffeeScript uses two spaces.
(setq coffee-tab-width 2)
;; If you don't have js2-mode
(setq coffee-js-mode 'javascript-mode)
;; If you don't want your compiled files to be wrapped
(setq coffee-args-compile '("-c" "--bare"))
;; *Messages* spam
(setq coffee-debug-mode t)
;; Emacs key binding
(define-key coffee-mode-map [(meta r)] 'coffee-compile-buffer)
(setq coffee-command "coffee")
;; remove the "Generated by CoffeeScript" header
(add-to-list 'coffee-args-compile "--no-header")
(defun prelude-coffee-mode-defaults ()
"coffee-mode-defaults"
;; Compile '.coffee' files on every save
;; Update the already compiled js on save
(and (buffer-file-name)
(file-exists-p (buffer-file-name))
(file-exists-p (coffee-compiled-file-name (buffer-file-name)))