Emacs hacks for Mozilla hackers
January 5, 2011 § 3 Comments
If you use Emacs to work on Mozilla code, you might find something you like in my mozilla-elisp repository. It currently includes:
- mozilla-c-style.el, a package which defines a C/C++ indentation style named “Mozilla”, which you can select with C-c . (c-set-style). This properly handles case labels, long return expressions, and things like that. The comments at the top explain how to turn it on by default in Mozilla code. It may have some SpiderMonkey-isms in it; if you send me bug reports, I will split it into “Mozilla” and “SpiderMonkey” styles.
- mercurial-queues.el, a major mode for editing Mercurial Queues series files, pushing, popping, and refreshing patches, and so on. In particular, the push and pop commands take care of refreshing any buffers visiting modified files. (This is currently slow if you have many buffers open, due to a shortcoming in vc‘s Mercurial support that makes refreshing a buffer take a significant fraction of a second. I have an unpolished workaround; if anyone besides me begins to use this and complains to me, then I’ll certainly finish it up and get it into the code.)
- diff-find-mq-file.el, a quick hack to help ‘diff-goto-source‘ and ‘diff-apply-hunk‘, commands that jump from a hunk in a patch file to the place where that hunk would apply, find the file to patch when they’re invoked on a patch in a .hg/patches directory.
Happy Hacking!
Hi,
I want to thanks you for the mercurial-queues bindings and the patched diff-mode. I found them useful in combination of:
C-u M-! find -name \*.rej -printf ‘%p:1:1\n’
M-x compilation-mode
to iterate over the list of non-applied patches.
Awesome!
Is there a mode for *.jsm files?
Thanks!
For editing JavaScript I’m using Steve Yegge’s js2-mode. I haven’t made any local modifications to that, so I haven’t put a copy in my repo.