Created
September 2, 2010 06:56
-
-
Save valeryz/561978 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; | |
| ;; A way to use Google's gjslint from Emacs | |
| ;; Copyright 2010 (c) Valeriy Zamarayev | |
| ;; | |
| ;; Put this into your .emacs | |
| ;; (require 'gjslint) | |
| ;; (add-hook 'js-mode-hook | |
| ;; (lambda () (flymake-mode t))) | |
| (require 'flymake) | |
| (defun flymake-gjslint-init () | |
| "Initialize flymake for gjslint" | |
| (let* ((temp-file (flymake-init-create-temp-buffer-copy | |
| 'flymake-create-temp-inplace))) | |
| (list "gjslint" (list temp-file "--nosummary")))) | |
| (add-to-list 'flymake-allowed-file-name-masks | |
| '(".+\\.js$" | |
| flymake-gjslint-init | |
| flymake-simple-cleanup | |
| flymake-get-real-file-name)) | |
| (add-to-list 'flymake-err-line-patterns | |
| '("^Line \\([[:digit:]]+\\), E:[[:digit:]]+: " | |
| nil 1 nil)) | |
| (provide 'gjslint) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment