2013-08-26 docTeX mode and YASnippet (en)

Well, I had a long hiatus in posting here - both real life and then vacation contributed to it. But I’m alive and kicking, still a Catholic, TeX and Emacs user and boardgamer - expect more posts soon!

And for now, a short tip (and a reminder for a future myself;)) for using YASnippet with AUCTeX’s docTeX mode. Since much of a docTeX document is (formally) commented out, YASnippet does not expand its snippets there. There is, however, a variable called yas-buffer-local-condition, which allows for very fine-grained control over which snippets can expand where. I didn’t need that fine-grained control, however, for my half-dozen snippets for docTeX mode, so what I did was basically putting

(add-hook 'docTeX-mode-hook '(lambda () (setq yas-buffer-local-condition t)))

in my .emacs, C-M-x-ing it and reloading my docTeX file.

CategoryEnglish, CategoryBlog, CategoryEmacs, CategoryTeX