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: ;;; Code:
(require 'prelude-programming) (require 'prelude-programming)
(prelude-require-package 'coffee-mode)
(eval-after-load 'coffee-mode (eval-after-load 'coffee-mode
'(progn '(progn
;; CoffeeScript uses two spaces. ;; CoffeeScript uses two spaces.
(setq coffee-tab-width 2) (setq coffee-tab-width 2)
;; If you don't have js2-mode ;; remove the "Generated by CoffeeScript" header
(setq coffee-js-mode 'javascript-mode) (add-to-list 'coffee-args-compile "--no-header")
;; 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")
(defun prelude-coffee-mode-defaults () (defun prelude-coffee-mode-defaults ()
"coffee-mode-defaults" ;; Update the already compiled js on save
;; Compile '.coffee' files on every save
(and (buffer-file-name) (and (buffer-file-name)
(file-exists-p (buffer-file-name)) (file-exists-p (buffer-file-name))
(file-exists-p (coffee-compiled-file-name (buffer-file-name))) (file-exists-p (coffee-compiled-file-name (buffer-file-name)))