New in Emacs - run checkdoc in batch mode19 May 2015
If you're doing some Elisp coding, you should definitely check out the
checkdoc command. Too bad it's (was) interactive-only. With
a small modification, I've made it suitable for batch.
emacs ?= emacs compile: $(emacs) -batch -l targets/avy-init.el
And here are the contents of avy-init.el:
(add-to-list 'load-path default-directory) (mapc #'byte-compile-file '("avy.el")) (require 'avy) (require 'checkdoc) (with-current-buffer (find-file "avy.el") (checkdoc-current-buffer t))
compile target a dependency of the
all target, so with a
make I can:
- run the tests
- check for compiler warnings
- check for
There's no reason to use
ansi-term (or an external shell) over
compile in this case. Using M-x
compile (or actually
M-x helm-make) I
can navigate to any compilation or style warning or failed test from
For the lazy, it's possible to jump to errors with a mouse, but navigating errors is a breeze with this Hydra:
(defhydra hydra-error (global-map "M-g") "goto-error" ("h" first-error "first") ("j" next-error "next") ("k" previous-error "prev") ("v" recenter-top-bottom "recenter") ("q" nil "quit"))
There is also ace-link-compilation, but I tend not to use it often.
I make good use of one of the coolest
pressing g will restart the compilation process.
Check out the new feature, I think it's really cool. Another incentive to try is that lately the emacs trunk has been extremely stable: I'm on Emacs25 almost all the time now, since it feels a lot faster.
Here are my aliasing settings:
$ which newemacs /usr/local/bin/newemacs $ readlink -f `which newemacs` /home/oleh/git/gnu-emacs/src/emacs
To run the tests with
newemacs instead of
emacs (since that's the
one for which
checkdoc works in batch), use M-x