summary refs log tree commit diff
path: root/doc/contributing.texi
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-01-12 14:56:52 +0100
committerLudovic Courtès <ludo@gnu.org>2017-01-12 14:56:52 +0100
commit7bb2b10cd01a076d7d5e964ed433e62846042859 (patch)
treed1d6958d31e2814f1969d23417e8fec8da8bf575 /doc/contributing.texi
parenta91740655c8d18cd1b266d4d5719146cfeaf400d (diff)
downloadguix-7bb2b10cd01a076d7d5e964ed433e62846042859.tar.gz
etc: Add 'indent-package.el' script.
* configure.ac: Check for 'emacs', substitute 'EMACS', and emit
'etc/indent-package.el'.
* etc/indent-package.el.in: New file.
* doc/contributing.texi (Formatting Code): Mention
'etc/indent-package.el'.
(Submitting Patches): Likewise, and link to the above node.

Co-authored-by: Alex Kost <alezost@gmail.com>
Diffstat (limited to 'doc/contributing.texi')
-rw-r--r--doc/contributing.texi23
1 files changed, 21 insertions, 2 deletions
diff --git a/doc/contributing.texi b/doc/contributing.texi
index 24db9a89e6..9fc1eb54d8 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,20 @@ 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-package.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.
 
 We require all top-level procedures to carry a docstring.  This
 requirement can be relaxed for simple private procedures in the
@@ -358,6 +372,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-package.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