Skip to content

Instantly share code, notes, and snippets.

@blt
Created November 15, 2013 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blt/7493749 to your computer and use it in GitHub Desktop.
Save blt/7493749 to your computer and use it in GitHub Desktop.
(setq tempo-interactive t)
(require 'tempo)
(tempo-define-template "erl-module"
'(
"-module()." n>
n>
"-ifdef(TEST)."n>
"-include_lib(\"eunit/include/eunit.hrl\")."n>
"-endif."n>
n>
"-export([])."n>
n>
"%%%==================================================================="n>
"%%% API"n>
"%%%==================================================================="n>
n>
"%%%==================================================================="n>
"%%% Internal Functions"n>
"%%%==================================================================="n>
n>
"%%%==================================================================="n>
"%%% Test"n>
"%%%==================================================================="n>
n>
"-ifdef(TEST)."n>
n>
"some_test_() ->"n>
"["n>
"?_assertMatch(true, true)"n>
"]."n>
n>
"-endif."n>
))
(tempo-define-template "erl-eunit-module"
'(
"-module()." n>
n>
"-include_lib(\"eunit/include/eunit.hrl\")."n>
n>
"%%%===================================================================" n>
"%%% fun_test/arity" n>
"%%%===================================================================" n>
n>
> "fun_test_() ->" n>
> "[" n>
> "{ \"describe your test here\"," n>
> "[" n>
> "?_assertMatch(true, true)" n>
> "]" n>
> "}" n>
> "]." n>
n>
"%%%===================================================================" n>
"%%% Internal Functions" n>
"%%%===================================================================" n>
))
(tempo-define-template "erl-gravestone"
'("%%%===================================================================" n>
"%%% "
(p "Heading: ") n>
"%%%===================================================================" n>
))
(define-skeleton erl-skeleton-intfun-gravestone
"Insert an internal function gravestone"
\n
"%%%===================================================================" \n
"%%% Internal Functions" \n
"%%%===================================================================" \n
\n)
(provide 'erl-templates)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment