mooz/js2-mode — pull request #36 by edmccard (2012-02-13 03:41:29+00:00)
Title: before-save-hook as local variable

js2-mode makes `before-save-hook` a buffer-local variable, which prevents any global `before-save-hook` functions from running in javascript buffers (I happen to use [ethan-wspace](https://github.com/glasserc/ethan-wspace) to handle whitespace cleanup for all major modes). The Emacs manual [recommends](http://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Buffer_002dLocal.html) using `add-hook` with a non-nil `local` argument for buffer-local hooks, so I changed the way `js2-cleanup-whitespace` is hooked.