Using flymake to check erb templates

Live syntax checking code in Emacs with flymake is extremely useful. It’s quite easy to use for syntax checking scripting languages or for running code analysis tools in the background. Flymake’s initial goal, however, was syntax checking compiled languages like C by running a custom make target. The flexibility needed to make all of this…

Setting default-directory for Mercurial MQ patches in Emacs

Emacs’ diff-mode is a great tool to work with patches. You can move inside a patch by files or by hunks, it highlights the changes in each line and you can apply and revert individual hunks. However, diff-mode doesn’t work out-of-the-box with Mercurial’s MQ extension. To make it work, we first have to make Emacs…

Showing the current directory in Emacs’ mode line

Today I got tired of always looking up, where all these little files named “_show.rhtml”, “_list.rhtml” and their ilk are living, and patched the emacs mode line to include the last element of the current buffer’s directory. http://www.emacswiki.org/cgi-bin/wiki/ModeLineDirtrack describes something very similar, but it repeats the whole mode line definition of mode-line-format, which might break…

Live syntax-checking JavaScript with Emacs

There are quite some options for doing live syntax checks from within Emacs. A good one is using Steve Yegge’s relatively new js2-mode for javascript editing which has a javascript parser built in. But that is not what this blog post will be about. The other option is to use flymake with some command line…