Linting coffee-script in EmacsMar 2, 2012 · 1 minute read (archived post)
I’ve been doing a lot of node.js recently, and I started editing coffee-script in my favourite editor which is Emacs. Now one thing I use regularly in Emacs is flymake-mode which essentially provides a set of hooks that are activated when you type into a buffer in Emacs.
You need a bit of emacs configuration to make it work. I use:
;; make coffeelinenode work nicely! (add-to-list 'load-path "path-to-coffeelintnode") (require 'flymake-coffeelint) ;; Make sure we can find the lintnode executable (setq coffeelintnode-location "path-to-coffeelintnode") (setq coffeelintnode-node-program "path-to-node-executable") (setq coffeelintnode-coffeelint-excludes (list 'max_line_length)) (setq coffeelintnode-coffeelint-includes '()) (setq coffeelintnode-coffeelint-set "") ;; Start the server when we first open a coffee file and start checking (setq coffeelintnode-autostart 'true) (add-hook 'coffee-mode-hook (lambda () (coffeelintnode-hook) (unless (eq buffer-file-name nil) (flymake-mode 1)) ;dont invoke flymake on temporary buffers for the interpreter (local-set-key [f2] 'flymake-goto-prev-error) (local-set-key [f3] 'flymake-goto-next-error)))