summaryrefslogtreecommitdiff
path: root/doc/contributing.texi
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2017-01-14 05:24:09 -0500
committerMark H Weaver <mhw@netris.org>2017-01-14 05:24:09 -0500
commit5827ea30ee64f2981929f865cf4c07e6c4712773 (patch)
tree31b6505f4ad9b53860028d2e47db62c34c15e484 /doc/contributing.texi
parent57203ebba0fa3eaa7c2df9bfd3e7c59f8ee98f6a (diff)
parentdd42a330d1301fd34f36dada9d142006165abaef (diff)
Merge branch 'master' into gnome-updates
Diffstat (limited to 'doc/contributing.texi')
-rw-r--r--doc/contributing.texi28
1 files changed, 26 insertions, 2 deletions
diff --git a/doc/contributing.texi b/doc/contributing.texi
index 24db9a89e6..4454df1f98 100644
--- a/doc/contributing.texi
+++ b/doc/contributing.texi
@@ -237,6 +237,8 @@ especially when matching lists.
@node Formatting Code
@subsection Formatting Code
+@cindex formatting code
+@cindex coding style
When writing Scheme code, we follow common wisdom among Scheme
programmers. In general, we follow the
@url{http://mumble.net/~campbell/scheme/style.txt, Riastradh's Lisp
@@ -246,8 +248,25 @@ please do read it.
Some special forms introduced in Guix, such as the @code{substitute*}
macro, have special indentation rules. These are defined in the
-@file{.dir-locals.el} file, which Emacs automatically uses. If you do
-not use Emacs, please make sure to let your editor know the rules.
+@file{.dir-locals.el} file, which Emacs automatically uses.
+
+@cindex indentation, of code
+@cindex formatting, of code
+If you do not use Emacs, please make sure to let your editor knows these
+rules. To automatically indent a package definition, you can also run:
+
+@example
+./etc/indent-code.el gnu/packages/@var{file}.scm @var{package}
+@end example
+
+@noindent
+This automatically indents the definition of @var{package} in
+@file{gnu/packages/@var{file}.scm} by running Emacs in batch mode. To
+indent a whole file, omit the second argument:
+
+@example
+./etc/indent-code.el gnu/services/@var{file}.scm
+@end example
We require all top-level procedures to carry a docstring. This
requirement can be relaxed for simple private procedures in the
@@ -358,6 +377,11 @@ Bundling unrelated changes together makes reviewing harder and slower.
Examples of unrelated changes include the addition of several packages,
or a package update along with fixes to that package.
+@item
+Please follow our code formatting rules, possibly running the
+@command{etc/indent-code.el} script to do that automatically for you
+(@pxref{Formatting Code}).
+
@end enumerate
When posting a patch to the mailing list, use @samp{[PATCH] @dots{}} as