mineo / yatemplate

File templates for Emacs with YASnippet
https://github.com/mineo/yatemplate
GNU General Public License v3.0
68 stars 11 forks source link

Setting find-file-hook and after-save-hook / More robust / Added tests #2

Closed rubikitch closed 8 years ago

rubikitch commented 8 years ago

I am a Japanese technical writer. I'll write a press article about your yatemplate for Emacs beginners. So I made yatemplate more robust not to confuse users. Thanks.

mineo commented 8 years ago

Thanks for the pull request! I actually don't know much about emacs lisp, so I'll need some to to review it and understand what's going on (first problem: I don't know how to run the test file :cry: ).

rubikitch commented 8 years ago

I try-and-error'ed ~/.emacs.d/templates/* many times. Callingyatemplate-fill-alist' many times remains old settings. It should be right to remove old settings before filling `auto-insert-alist'. So I wrote some unit tests.

To execute test, first `M-x package-install test-simple', Then press C-e C-x C-e at the first line of yatemplate-test.el. The test is executed by batch mode.

In my environment:

$ emacs -batch -L /r/.emacs.d/elpa/test-simple-20151023.1122/ -L /r/.emacs.d/elpa/yasnippet-20151012.1023/ -l /r/sync/emacs/quelpa/build/yatemplate/yatemplate-tests.el

The -L arguments are got from current emacs session by `locate-library'.

Cheeers,

mineo commented 8 years ago

Ok, I think I understand how it works. Thanks for the pull request, I've merged it!