guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Snippets for working on Guix


From: Ricardo Wurmus
Subject: Snippets for working on Guix
Date: Fri, 15 Dec 2017 00:48:14 +0100
User-agent: mu4e 0.9.18; emacs 25.3.1

Hi Guix,

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:

  ./scheme-mode/guix-package
  ./scheme-mode/guix-origin
  ./scheme-mode/guix-git-reference
  ./scheme-mode/guix-hg-reference
  ./scheme-mode/guix-cvs-reference
  ./scheme-mode/guix-svn-reference
  ./text-mode/guix-commit-message-add-package
  ./text-mode/guix-commit-message-update-package

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!

Attachment: guix-package
Description: Text document

Attachment: guix-origin
Description: Text document

Attachment: guix-git-reference
Description: Text document

Attachment: guix-svn-reference
Description: Text document

Attachment: guix-hg-reference
Description: Text document

Attachment: guix-cvs-reference
Description: Text document

Attachment: guix-commit-message-add-package
Description: Text document

Attachment: guix-commit-message-update-package
Description: Text document

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

reply via email to

[Prev in Thread] Current Thread [Next in Thread]