2017-12-14 23:48:14 UTC
to avoid the need to type out boilerplate I wrote a couple of snippets
that can be used with yasnippet in Emacs, and I thought I should share
them with you.
These snippets are available:
The snippets in the âscheme-modeâ directory are used to define new
packages. Enable yas-global-mode and type âpackage...<TAB>â to get a
package skeleton. Hit <TAB> to jump to the next field to complete it.
You can also select a build system from a list.
At last you end up at âorigin...â; when you hit <TAB> it will expand
the âguix-originâ snippet, which allows you to select a fetch method
from a list. As the last step you end up at the âuriâ field, which may
be further expandable with âguix-git-referenceâ, âguix-hg-referenceâ,
âguix-cvs-referenceâ, or âguix-svn-referenceâ.
The âtext-modeâ snippets are for commit messages. They use magit to
get the names of staged files. You can use âadd<TAB>â to create a
commit message for adding a package, or âupdate<TAB>â to create a
message for updating a package.
These commit message snippets arenât very smart, because it isnât
trivial to reliably infer the kind of change from just the staged hunk.
With some more work one might be able to detect a version number change
and the name of the package that has been updated.
I hope this is useful for some of you!