[PATCH 0/4] Harmonize @-commands used in doc/guix.texi

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Bruno Victal
Owner
unassigned
Submitted by
Bruno Victal
Severity
normal
B
B
Bruno Victal wrote on 8 Mar 2023 02:19
(address . guix-patches@gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
cover.1678237929.git.mirai@makinata.eu
In a similar vein to the work done in #60634, in most cases it's
implicit that we're dealing with Scheme procedures. This patchset
normalizes the @-commands for procedures and corrects some incongruencies
missed in the #60634 patch-series.

Bruno Victal (4):
doc: Fix incorrect @deffn usage for service-types.
doc: Fix incorrect @deffn usage for data types.
doc: Use @defun for procedures.
doc: Use @defmac and @defspec for macros.

doc/guix.texi | 633 ++++++++++++++++++++++++--------------------------
1 file changed, 301 insertions(+), 332 deletions(-)

--
2.39.1
B
B
Bruno Victal wrote on 8 Mar 2023 02:22
[PATCH 1/4] doc: Fix incorrect @deffn usage for service-types.
(address . 62042@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
5915e69013728ad595e24a533598dc8212be8567.1678238486.git.mirai@makinata.eu
* doc/guix.texi (Networking Services): Fix incorrect @deffn usage for service-types.
---
doc/guix.texi | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

Toggle diff (44 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 6671ba9305..4f9eeede8a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -20034,7 +20034,7 @@ Networking Services
@command{inetd} ``superdaemon'', and more. This section describes
those.
-@deffn {Scheme Procedure} dhcpd-service-type
+@defvar dhcpd-service-type
This type defines a service that runs a DHCP daemon. To create a
service of this type, you must supply a @code{<dhcpd-configuration>}.
For example:
@@ -20045,7 +20045,7 @@ Networking Services
(config-file (local-file "my-dhcpd.conf"))
(interfaces '("enp0s25"))))
@end lisp
-@end deffn
+@end defvar
@deftp {Data Type} dhcpd-configuration
@table @asis
@@ -20281,7 +20281,7 @@ Networking Services
@end deftp
@cindex OpenNTPD
-@deffn {Scheme Procedure} openntpd-service-type
+@defvar openntpd-service-type
Run the @command{ntpd}, the Network Time Protocol (NTP) daemon, as implemented
by @uref{http://www.openntpd.org, OpenNTPD}. The daemon will keep the system
clock synchronized with that of the given servers.
@@ -20296,7 +20296,7 @@ Networking Services
(constraints-from '("https://www.google.com/"))))
@end lisp
-@end deffn
+@end defvar
@defvar %openntpd-servers
This variable is a list of the server addresses defined in

base-commit: c0650cf5b749adb3b9bb9c6061ef4f1f9bdc370e
--
2.39.1
B
B
Bruno Victal wrote on 8 Mar 2023 02:22
[PATCH 2/4] doc: Fix incorrect @deffn usage for data types.
(address . 62042@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
63b45af470e9b2c64fc957133e95f08e10ab7be4.1678238486.git.mirai@makinata.eu
* doc/guix.texi (Web Services): Fix incorrect @deffn usage for data types.
---
doc/guix.texi | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

Toggle diff (82 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 4f9eeede8a..bf294046db 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -29583,7 +29583,7 @@ Web Services
@code{httpd-config-file} and @code{httpd-virtualhost} record types are
given below.
-@deffn {Data Type} httpd-configuration
+@deftp {Data Type} httpd-configuration
This data type represents the configuration for the httpd service.
@table @asis
@@ -29600,9 +29600,9 @@ Web Services
file outside of the store can also be specified through a string.
@end table
-@end deffn
+@end deftp
-@deffn {Data Type} httpd-module
+@deftp {Data Type} httpd-module
This data type represents a module for the httpd service.
@table @asis
@@ -29616,13 +29616,13 @@ Web Services
"/modules/mod_wsgi.so")}.
@end table
-@end deffn
+@end deftp
@defvar %default-httpd-modules
A default list of @code{httpd-module} objects.
@end defvar
-@deffn {Data Type} httpd-config-file
+@deftp {Data Type} httpd-config-file
This data type represents a configuration file for the httpd service.
@table @asis
@@ -29701,9 +29701,9 @@ Web Services
list.
@end table
-@end deffn
+@end deftp
-@deffn {Data Type} httpd-virtualhost
+@deftp {Data Type} httpd-virtualhost
This data type represents a virtualhost configuration block for the httpd service.
These should be added to the extra-config for the httpd-service.
@@ -29727,7 +29727,7 @@ Web Services
of strings and G-expressions.
@end table
-@end deffn
+@end deftp
@anchor{NGINX}
@subsubheading NGINX
@@ -29768,7 +29768,7 @@ Web Services
@file{/var/log/nginx/error.log}. The second location can be changed
with the @var{log-directory} configuration option.
-@deffn {Data Type} nginx-configuration
+@deftp {Data Type} nginx-configuration
This data type represents the configuration for NGinx. Some
configuration can be done through this and the other provided record
types, or alternatively, a config file can be provided.
@@ -29908,7 +29908,7 @@ Web Services
valued G-expression.
@end table
-@end deffn
+@end deftp
@anchor{nginx-server-configuration}
@deftp {Data Type} nginx-server-configuration
--
2.39.1
B
B
Bruno Victal wrote on 8 Mar 2023 02:22
[PATCH 4/4] doc: Use @defmac and @defspec for macros.
(address . 62042@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
6122a9ef42150289534e13f1336353fc58aeda75.1678238486.git.mirai@makinata.eu
* doc/guix.texi (package Reference, Defining Package Variants)
(Build Utilities, The Store Monad, G-Expressions, operating-system Reference)
(Service Reference, Complex Configurations): Use @defmac and @defspec for macros.
---
doc/guix.texi | 97 +++++++++++++++++++++++++--------------------------
1 file changed, 47 insertions(+), 50 deletions(-)

Toggle diff (320 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index ed9994a41b..358be58205 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -7781,7 +7781,7 @@ package Reference
@end table
@end deftp
-@deffn {Scheme Syntax} this-package
+@defmac this-package
When used in the @emph{lexical scope} of a package field definition, this
identifier resolves to the package being defined.
@@ -7801,7 +7801,7 @@ package Reference
@end lisp
It is an error to refer to @code{this-package} outside a package definition.
-@end deffn
+@end defmac
The following helper procedures are provided to help deal with package
inputs.
@@ -8160,7 +8160,7 @@ Defining Package Variants
macro is a helper that can prove useful anytime you want to remove, add,
or replace package inputs.
-@deffn {Scheme Syntax} modify-inputs @var{inputs} @var{clauses}
+@defmac modify-inputs inputs clauses
Modify the given package inputs, as returned by @code{package-inputs} & co.,
according to the given clauses. Each clause must have one of the
following forms:
@@ -8195,7 +8195,7 @@ Defining Package Variants
The last type of clause is @code{append}, to add inputs at the back of
the list.
-@end deffn
+@end defmac
In some cases, you may find it useful to write functions
(``procedures'', in Scheme parlance) that return a package based on some
@@ -10161,7 +10161,7 @@ Build Utilities
@command{sed}. They complement Guile's extensive, but low-level, file
system interface (@pxref{POSIX,,, guile, GNU Guile Reference Manual}).
-@deffn {Scheme Syntax} with-directory-excursion @var{directory} @var{body}@dots{}
+@defmac with-directory-excursion directory body @dots{}
Run @var{body} with @var{directory} as the process's current directory.
Essentially, this macro changes the current directory to @var{directory}
@@ -10170,7 +10170,7 @@ Build Utilities
directory when the dynamic extent of @var{body} is left, be it @i{via}
normal procedure return or @i{via} a non-local exit such as an
exception.
-@end deffn
+@end defmac
@defun mkdir-p dir
Create directory @var{dir} and all its ancestors.
@@ -10202,8 +10202,8 @@ Build Utilities
is true. Report but ignore errors.
@end defun
-@deffn {Scheme Syntax} substitute* @var{file} @
- ((@var{regexp} @var{match-var}@dots{}) @var{body}@dots{}) @dots{}
+@defmac substitute* file @
+ ((regexp match-var@dots{}) body@dots{}) @dots{}
Substitute @var{regexp} in @var{file} by the string returned by
@var{body}. @var{body} is evaluated with each @var{match-var} bound to
the corresponding positional regexp sub-expression. For example:
@@ -10229,7 +10229,7 @@ Build Utilities
Be careful about using @code{$} to match the end of a line; by itself it
won't match the terminating newline of a line.
-@end deffn
+@end defmac
@subsection File Search
@@ -10390,7 +10390,7 @@ Build Utilities
those with tools written with build phases in mind.
@cindex build phases, modifying
-@deffn {Scheme Syntax} modify-phases @var{phases} @var{clause}@dots{}
+@defmac modify-phases phases clause@dots{}
Modify @var{phases} sequentially as per each @var{clause}, which may
have one of the following forms:
@@ -10403,7 +10403,7 @@ Build Utilities
Where every @var{phase-name} above is an expression evaluating to a
symbol, and @var{new-phase} an expression evaluating to a procedure.
-@end deffn
+@end defmac
The example below is taken from the definition of the @code{grep}
package. It adds a phase to run after the @code{install} phase, called
@@ -11190,16 +11190,16 @@ The Store Monad
The main syntactic forms to deal with monads in general are provided by
the @code{(guix monads)} module and are described below.
-@deffn {Scheme Syntax} with-monad @var{monad} @var{body} ...
+@defmac with-monad monad body @dots{}
Evaluate any @code{>>=} or @code{return} forms in @var{body} as being
in @var{monad}.
-@end deffn
+@end defmac
-@deffn {Scheme Syntax} return @var{val}
+@defmac return val
Return a monadic value that encapsulates @var{val}.
-@end deffn
+@end defmac
-@deffn {Scheme Syntax} >>= @var{mval} @var{mproc} ...
+@defmac >>= mval mproc @dots{}
@dfn{Bind} monadic value @var{mval}, passing its ``contents'' to monadic
procedures @var{mproc}@dots{}@footnote{This operation is commonly
referred to as ``bind'', but that name denotes an unrelated procedure in
@@ -11218,12 +11218,10 @@ The Store Monad
@result{} 4
@result{} some-state
@end lisp
-@end deffn
+@end defmac
-@deffn {Scheme Syntax} mlet @var{monad} ((@var{var} @var{mval}) ...) @
- @var{body} ...
-@deffnx {Scheme Syntax} mlet* @var{monad} ((@var{var} @var{mval}) ...) @
- @var{body} ...
+@defmac mlet monad ((var mval) @dots{}) body @dots{}
+@defmacx mlet* monad ((var mval) @dots{}) body @dots{}
Bind the variables @var{var} to the monadic values @var{mval} in
@var{body}, which is a sequence of expressions. As with the bind
operator, this can be thought of as ``unpacking'' the raw, non-monadic
@@ -11237,9 +11235,9 @@ The Store Monad
@code{mlet*} is to @code{mlet} what @code{let*} is to @code{let}
(@pxref{Local Bindings,,, guile, GNU Guile Reference Manual}).
-@end deffn
+@end defmac
-@deffn {Scheme System} mbegin @var{monad} @var{mexp} ...
+@defmac mbegin monad mexp @dots{}
Bind @var{mexp} and the following monadic expressions in sequence,
returning the result of the last expression. Every expression in the
sequence must be a monadic expression.
@@ -11247,21 +11245,21 @@ The Store Monad
This is akin to @code{mlet}, except that the return values of the
monadic expressions are ignored. In that sense, it is analogous to
@code{begin}, but applied to monadic expressions.
-@end deffn
+@end defmac
-@deffn {Scheme System} mwhen @var{condition} @var{mexp0} @var{mexp*} ...
+@defmac mwhen condition mexp0 mexp* @dots{}
When @var{condition} is true, evaluate the sequence of monadic
expressions @var{mexp0}..@var{mexp*} as in an @code{mbegin}. When
@var{condition} is false, return @code{*unspecified*} in the current
monad. Every expression in the sequence must be a monadic expression.
-@end deffn
+@end defmac
-@deffn {Scheme System} munless @var{condition} @var{mexp0} @var{mexp*} ...
+@defmac munless condition mexp0 mexp* @dots{}
When @var{condition} is false, evaluate the sequence of monadic
expressions @var{mexp0}..@var{mexp*} as in an @code{mbegin}. When
@var{condition} is true, return @code{*unspecified*} in the current
monad. Every expression in the sequence must be a monadic expression.
-@end deffn
+@end defmac
@cindex state monad
The @code{(guix monads)} module provides the @dfn{state monad}, which
@@ -11582,8 +11580,8 @@ G-Expressions
The syntactic form to construct gexps is summarized below.
-@deffn {Scheme Syntax} #~@var{exp}
-@deffnx {Scheme Syntax} (gexp @var{exp})
+@defmac #~@var{exp}
+@defmacx (gexp @var{exp})
Return a G-expression containing @var{exp}. @var{exp} may contain one
or more of the following forms:
@@ -11637,9 +11635,9 @@ G-Expressions
G-expressions created by @code{gexp} or @code{#~} are run-time objects
of the @code{gexp?} type (see below).
-@end deffn
+@end defmac
-@deffn {Scheme Syntax} with-imported-modules @var{modules} @var{body}@dots{}
+@defmac with-imported-modules modules body@dots{}
Mark the gexps defined in @var{body}@dots{} as requiring @var{modules}
in their execution environment.
@@ -11661,9 +11659,9 @@ G-Expressions
This form has @emph{lexical} scope: it has an effect on the gexps
directly defined in @var{body}@dots{}, but not on those defined, say, in
procedures called from @var{body}@dots{}.
-@end deffn
+@end defmac
-@deffn {Scheme Syntax} with-extensions @var{extensions} @var{body}@dots{}
+@defmac with-extensions extensions body@dots{}
Mark the gexps defined in @var{body}@dots{} as requiring
@var{extensions} in their build and execution environment.
@var{extensions} is typically a list of package objects such as those
@@ -11673,7 +11671,7 @@ G-Expressions
load path while compiling imported modules in @var{body}@dots{}; they
are also added to the load path of the gexp returned by
@var{body}@dots{}.
-@end deffn
+@end defmac
@defun gexp? obj
Return @code{#t} if @var{obj} is a G-expression.
@@ -11957,8 +11955,8 @@ G-Expressions
@dots{})} expression to construct the file name @emph{at run time}.
@end defun
-@deffn {Scheme Syntax} let-system @var{system} @var{body}@dots{}
-@deffnx {Scheme Syntax} let-system (@var{system} @var{target}) @var{body}@dots{}
+@defmac let-system system body@dots{}
+@defmacx let-system (system target) body@dots{}
Bind @var{system} to the currently targeted system---e.g.,
@code{"x86_64-linux"}---within @var{body}.
@@ -11981,9 +11979,9 @@ G-Expressions
(error "dunno!"))))
"-net" "user" #$image)
@end lisp
-@end deffn
+@end defmac
-@deffn {Scheme Syntax} with-parameters ((@var{parameter} @var{value}) @dots{}) @var{exp}
+@defmac with-parameters ((parameter value) @dots{}) exp
This macro is similar to the @code{parameterize} form for
dynamically-bound @dfn{parameters} (@pxref{Parameters,,, guile, GNU
Guile Reference Manual}). The key difference is that it takes effect
@@ -12000,7 +11998,7 @@ G-Expressions
The example above returns an object that corresponds to the i686 build
of Coreutils, regardless of the current value of @code{%current-system}.
-@end deffn
+@end defmac
Of course, in addition to gexps embedded in ``host'' code, there are
@@ -16651,7 +16649,7 @@ operating-system Reference
@end table
-@deffn {Scheme Syntax} this-operating-system
+@defmac this-operating-system
When used in the @emph{lexical scope} of an operating system field definition,
this identifier resolves to the operating system being defined.
@@ -16669,7 +16667,7 @@ operating-system Reference
It is an error to refer to @code{this-operating-system} outside an operating
system definition.
-@end deffn
+@end defmac
@end deftp
@@ -40564,8 +40562,8 @@ Service Reference
@code{modify-services} simply provides a more concise form for this
common pattern.
-@deffn {Scheme Syntax} modify-services @var{services} @
- (@var{type} @var{variable} => @var{body}) @dots{}
+@defspec modify-services services @
+ (type variable => body) @dots{}
Modify the services listed in @var{services} according to the given
clauses. Each clause has the form:
@@ -40598,7 +40596,7 @@ Service Reference
@xref{Using the Configuration System}, for example usage.
-@end deffn
+@end defspec
Next comes the programming interface for service types. This is
something you want to know when writing new service definitions, but not
@@ -41074,8 +41072,7 @@ Complex Configurations
G-expression (@pxref{G-Expressions}), which should, once serialized to
the disk, return a string. More details are listed below.
-@deffn {Scheme Syntax} define-configuration @var{name} @var{clause1} @
-@var{clause2} ...
+@defmac define-configuration name clause1 clause2 @dots{}
Create a record type named @code{@var{name}} that contains the
fields found in the clauses.
@@ -41185,9 +41182,9 @@ Complex Configurations
(string "test")
"Some documentation."))
@end lisp
-@end deffn
+@end defmac
-@deffn {Scheme Syntax} define-maybe @var{type}
+@defmac define-maybe type
Sometimes a field should not be serialized if the user doesn’t specify a
value. To achieve this, you can use the @code{define-maybe} macro to
define a ``maybe type''; if the value of a maybe type is left unset, or
@@ -41239,7 +41236,7 @@ Complex Configurations
maybe-symbol
"Docstring."))
@end lisp
-@end deffn
+@end defmac
@defun maybe-value-set? value
Predicate to check whether a user explicitly specified the value of a
--
2.39.1
B
B
Bruno Victal wrote on 8 Mar 2023 02:22
[PATCH 3/4] doc: Use @defun for procedures.
(address . 62042@debbugs.gnu.org)(name . Bruno Victal)(address . mirai@makinata.eu)
ab700073ec1b557013d450da3ae61d84efdc620a.1678238486.git.mirai@makinata.eu
* doc/guix.texi (Inferiors, Defining Packages, package Reference)
(origin Reference, Defining Package Variants, Writing Manifests)
(Build Utilities, Search Paths, The Store, Derivations, The Store Monad)
(G-Expressions, File Systems, Keyboard Layout, Base Services, X Window)
(Desktop Services, File-Sharing Services, Web Services, Virtualization Services)
(Version Control Services, Miscellaneous Services, Initial RAM Disk)
(Bootloader Configuration, Service Reference, Shepherd Services)
(Complex Configurations): Use @defun for procedures.
---
doc/guix.texi | 508 ++++++++++++++++++++++++--------------------------
1 file changed, 240 insertions(+), 268 deletions(-)

Toggle diff (478 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index bf294046db..ed9994a41b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4958,60 +4958,57 @@ Inferiors
The @code{(guix inferior)} module provides the following procedures to open an
inferior:
-@deffn {Scheme Procedure} inferior-for-channels @var{channels} @
- [#:cache-directory] [#:ttl]
+@defun inferior-for-channels channels [#:cache-directory] [#:ttl]
Return an inferior for @var{channels}, a list of channels. Use the cache at
@var{cache-directory}, where entries can be reclaimed after @var{ttl} seconds.
This procedure opens a new connection to the build daemon.
As a side effect, this procedure may build or substitute binaries for
@var{channels}, which can take time.
-@end deffn
+@end defun
-@deffn {Scheme Procedure} open-inferior @var{directory} @
- [#:command "bin/guix"]
+@defun open-inferior directory [#:command "bin/guix"]
Open the inferior Guix in @var{directory}, running
@code{@var{directory}/@var{command} repl} or equivalent. Return @code{#f} if
the inferior could not be launched.
-@end deffn
+@end defun
@cindex inferior packages
The procedures listed below allow you to obtain and manipulate inferior
packages.
-@deffn {Scheme Procedure} inferior-packages @var{inferior}
+@defun inferior-packages inferior
Return the list of packages known to @var{inferior}.
-@end deffn
+@end defun
-@deffn {Scheme Procedure} lookup-inferior-packages @var{inferior} @var{name} @
- [@var{version}]
+@defun lookup-inferior-packages inferior name [version]
Return the sorted list of inferior packages matching @var{name} in
@var{inferior}, with highest version numbers first. If @var{version} is true,
return only packages with a version number prefixed by @var{version}.
-@end deffn
+@end defun
-@deffn {Scheme Procedure} inferior-package? @var{obj}
+@defun inferior-package? obj
Return true if @var{obj} is an inferior package.
-@end deffn
+@end defun
-@deffn {Scheme Procedure} inferior-package-name @var{package}
-@deffnx {Scheme Procedure} inferior-package-version @var{package}
-@deffnx {Scheme Procedure} inferior-package-synopsis @var{package}
-@deffnx {Scheme Procedure} inferior-package-description @var{package}
-@deffnx {Scheme Procedure} inferior-package-home-page @var{package}
-@deffnx {Scheme Procedure} inferior-package-location @var{package}
-@deffnx {Scheme Procedure} inferior-package-inputs @var{package}
-@deffnx {Scheme Procedure} inferior-package-native-inputs @var{package}
-@deffnx {Scheme Procedure} inferior-package-propagated-inputs @var{package}
-@deffnx {Scheme Procedure} inferior-package-transitive-propagated-inputs @var{package}
-@deffnx {Scheme Procedure} inferior-package-native-search-paths @var{package}
-@deffnx {Scheme Procedure} inferior-package-transitive-native-search-paths @var{package}
-@deffnx {Scheme Procedure} inferior-package-search-paths @var{package}
+@defun inferior-package-name package
+@defunx inferior-package-version package
+@defunx inferior-package-synopsis package
+@defunx inferior-package-description package
+@defunx inferior-package-home-page package
+@defunx inferior-package-location package
+@defunx inferior-package-inputs package
+@defunx inferior-package-native-inputs package
+@defunx inferior-package-propagated-inputs package
+@defunx inferior-package-transitive-propagated-inputs package
+@defunx inferior-package-native-search-paths package
+@defunx inferior-package-transitive-native-search-paths package
+@defunx inferior-package-search-paths package
These procedures are the counterpart of package record accessors
(@pxref{package Reference}). Most of them work by querying the inferior
@var{package} comes from, so the inferior must still be live when you call
these procedures.
-@end deffn
+@end defun
Inferior packages can be used transparently like any other package or
file-like object in G-expressions (@pxref{G-Expressions}). They are also
@@ -7575,7 +7572,7 @@ Defining Packages
The build actions it prescribes may then be realized by using the
@code{build-derivations} procedure (@pxref{The Store}).
-@deffn {Scheme Procedure} package-derivation @var{store} @var{package} [@var{system}]
+@defun package-derivation store package [system]
Return the @code{<derivation>} object of @var{package} for @var{system}
(@pxref{Derivations}).
@@ -7584,22 +7581,21 @@ Defining Packages
@code{"x86_64-linux"} for an x86_64 Linux-based GNU system. @var{store}
must be a connection to the daemon, which operates on the store
(@pxref{The Store}).
-@end deffn
+@end defun
@noindent
@cindex cross-compilation
Similarly, it is possible to compute a derivation that cross-builds a
package for some other system:
-@deffn {Scheme Procedure} package-cross-derivation @var{store} @
- @var{package} @var{target} [@var{system}]
+@defun package-cross-derivation store package target [system]
Return the @code{<derivation>} object of @var{package} cross-built from
@var{system} to @var{target}.
@var{target} must be a valid GNU triplet denoting the target hardware
and operating system, such as @code{"aarch64-linux-gnu"}
(@pxref{Specifying Target Triplets,,, autoconf, Autoconf}).
-@end deffn
+@end defun
Once you have package definitions, you can easily define @emph{variants}
of those packages. @xref{Defining Package Variants}, for more on that.
@@ -7810,10 +7806,10 @@ package Reference
The following helper procedures are provided to help deal with package
inputs.
-@deffn {Scheme Procedure} lookup-package-input @var{package} @var{name}
-@deffnx {Scheme Procedure} lookup-package-native-input @var{package} @var{name}
-@deffnx {Scheme Procedure} lookup-package-propagated-input @var{package} @var{name}
-@deffnx {Scheme Procedure} lookup-package-direct-input @var{package} @var{name}
+@defun lookup-package-input package name
+@defunx lookup-package-native-input package name
+@defunx lookup-package-propagated-input package name
+@defunx lookup-package-direct-input package name
Look up @var{name} among @var{package}'s inputs (or native, propagated,
or direct inputs). Return it if found, @code{#f} otherwise.
@@ -7829,7 +7825,7 @@ package Reference
In this example we obtain the @code{gmp} package that is among the
direct inputs of @code{coreutils}.
-@end deffn
+@end defun
@cindex development inputs, of a package
@cindex implicit inputs, of a package
@@ -7838,8 +7834,7 @@ package Reference
package is compiled. This is what the @code{package-development-inputs}
procedure returns.
-@deffn {Scheme Procedure} package-development-inputs @var{package} @
- [@var{system}] [#:target #f]
+@defun package-development-inputs package [system] [#:target #f]
Return the list of inputs required by @var{package} for development
purposes on @var{system}. When @var{target} is true, return the inputs
needed to cross-compile @var{package} from @var{system} to
@@ -7870,7 +7865,7 @@ package Reference
gzip, GCC, libc, Bash, and more. To visualize it, @command{guix graph
hello} would show you explicit inputs, whereas @command{guix graph -t
bag hello} would include implicit inputs (@pxref{Invoking guix graph}).
-@end deffn
+@end defun
Because packages are regular Scheme objects that capture a complete
dependency graph and associated build procedures, it is often useful to
@@ -7878,7 +7873,7 @@ package Reference
thereof according to some parameters. Below are a few examples.
@cindex tool chain, choosing a package's tool chain
-@deffn {Scheme Procedure} package-with-c-toolchain @var{package} @var{toolchain}
+@defun package-with-c-toolchain package toolchain
Return a variant of @var{package} that uses @var{toolchain} instead of
the default GNU C/C++ toolchain. @var{toolchain} must be a list of
inputs (label/package tuples) providing equivalent functionality, such
@@ -7899,7 +7894,7 @@ package Reference
procedure works by changing the build system of @var{package} so that it
pulls in @var{toolchain} instead of the defaults. @ref{Build Systems},
for more on build systems.
-@end deffn
+@end defun
@node origin Reference
@subsection @code{origin} Reference
@@ -8016,8 +8011,7 @@ origin Reference
download)} module provides the most common method, @code{url-fetch},
described below.
-@deffn {Scheme Procedure} url-fetch @var{url} @var{hash-algo} @var{hash} @
- [name] [#:executable? #f]
+@defun url-fetch url hash-algo hash [name] [#:executable? #f]
Return a fixed-output derivation that fetches data from @var{url} (a
string, or a list of strings denoting alternate URLs), which is expected
to have hash @var{hash} of type @var{hash-algo} (a symbol). By default,
@@ -8030,19 +8024,19 @@ origin Reference
Alternatively, when URL starts with @code{file://}, return the
corresponding file name in the store.
-@end deffn
+@end defun
Likewise, the @code{(guix git-download)} module defines the
@code{git-fetch} origin method, which fetches data from a Git version
control repository, and the @code{git-reference} data type to describe
the repository and revision to fetch.
-@deffn {Scheme Procedure} git-fetch @var{ref} @var{hash-algo} @var{hash}
+@defun git-fetch ref hash-algo hash
Return a fixed-output derivation that fetches @var{ref}, a
@code{<git-reference>} object. The output is expected to have recursive
hash @var{hash} of type @var{hash-algo} (a symbol). Use @var{name} as
the file name, or a generic name if @code{#f}.
-@end deffn
+@end defun
@deftp {Data Type} git-reference
This data type represents a Git reference for @code{git-fetch} to
@@ -8085,13 +8079,12 @@ origin Reference
the @code{hg-fetch} origin method and @code{hg-reference} data type for
support of the Mercurial version control system.
-@deffn {Scheme Procedure} hg-fetch @var{ref} @var{hash-algo} @var{hash} @
- [name]
+@defun hg-fetch ref hash-algo hash [name]
Return a fixed-output derivation that fetches @var{ref}, a
@code{<hg-reference>} object. The output is expected to have recursive
hash @var{hash} of type @var{hash-algo} (a symbol). Use @var{name} as
the file name, or a generic name if @code{#false}.
-@end deffn
+@end defun
@node Defining Package Variants
@section Defining Package Variants
@@ -8242,7 +8235,7 @@ Defining Package Variants
that directly maps to the more sophisticated package transformation
options (@pxref{Package Transformation Options}):
-@deffn {Scheme Procedure} options->transformation @var{opts}
+@defun options->transformation opts
Return a procedure that, when passed an object to build (package,
derivation, etc.), applies the transformations specified by @var{opts} and returns
the resulting objects. @var{opts} must be a list of symbol/string pairs such as:
@@ -8254,7 +8247,7 @@ Defining Package Variants
Each symbol names a transformation and the corresponding string is an argument
to that transformation.
-@end deffn
+@end defun
For instance, a manifest equivalent to this command:
@@ -8293,8 +8286,7 @@ Defining Package Variants
graph, is what the @code{package-input-rewriting} procedure in
@code{(guix packages)} implements.
-@deffn {Scheme Procedure} package-input-rewriting @var{replacements} @
- [@var{rewrite-name}] [#:deep? #t]
+@defun package-input-rewriting replacements [rewrite-name] [#:deep? #t]
Return a procedure that, when passed a package, replaces its direct and
indirect dependencies, including implicit inputs when @var{deep?} is
true, according to @var{replacements}. @var{replacements} is a list of
@@ -8303,7 +8295,7 @@ Defining Package Variants
Optionally, @var{rewrite-name} is a one-argument procedure that takes
the name of a package and returns its new name after rewrite.
-@end deffn
+@end defun
@noindent
Consider this example:
@@ -8328,14 +8320,14 @@ Defining Package Variants
The following variant of @code{package-input-rewriting} can match packages to
be replaced by name rather than by identity.
-@deffn {Scheme Procedure} package-input-rewriting/spec @var{replacements} [#:deep? #t]
+@defun package-input-rewriting/spec replacements [#:deep? #t]
Return a procedure that, given a package, applies the given
@var{replacements} to all the package graph, including implicit inputs
unless @var{deep?} is false. @var{replacements} is a list of
spec/procedures pair; each spec is a package specification such as
@code{"gcc"} or @code{"guile@@2"}, and each procedure takes a matching
package and returns a replacement for that package.
-@end deffn
+@end defun
The example above could be rewritten this way:
@@ -8353,12 +8345,12 @@ Defining Package Variants
@code{package-mapping}: it supports arbitrary changes to nodes in the
graph.
-@deffn {Scheme Procedure} package-mapping @var{proc} [@var{cut?}] [#:deep? #f]
+@defun package-mapping proc [cut?] [#:deep? #f]
Return a procedure that, given a package, applies @var{proc} to all the packages
depended on and returns the resulting package. The procedure stops recursion
when @var{cut?} returns true for a given package. When @var{deep?} is true, @var{proc} is
applied to implicit inputs as well.
-@end deffn
+@end defun
@node Writing Manifests
@section Writing Manifests
@@ -8563,15 +8555,14 @@ Writing Manifests
@end table
@end deftp
-@deffn {Scheme Procedure} concatenate-manifests @var{lst}
+@defun concatenate-manifests lst
Concatenate the manifests listed in @var{lst} and return the resulting
manifest.
-@end deffn
+@end defun
@c TODO: <manifest-pattern>, manifest-lookup, manifest-remove, etc.
-@deffn {Scheme Procedure} package->manifest-entry @var{package} @
- [@var{output}] [#:properties]
+@defun package->manifest-entry package [output] [#:properties]
Return a manifest entry for the @var{output} of package @var{package},
where @var{output} defaults to @code{"out"}, and with the given
@var{properties}. By default @var{properties} is the empty list or, if
@@ -8589,9 +8580,9 @@ Writing Manifests
(manifest (list (package->manifest-entry git)
(package->manifest-entry git "send-email")))
@end lisp
-@end deffn
+@end defun
-@deffn {Scheme Procedure} packages->manifest @var{packages}
+@defun packages->manifest packages
Return a list of manifest entries, one for each item listed in
@var{packages}. Elements of @var{packages} can be either package
objects or package/string tuples denoting a specific output of a
@@ -8605,11 +8596,10 @@ Writing Manifests
(packages->manifest (list git `(,git "send-email")))
@end lisp
-@end deffn
+@end defun
@anchor{package-development-manifest}
-@deffn {Scheme Procedure} package->development-manifest @var{package} @
- [@var{system}] [#:target]
+@defun package->development-manifest package [system] [#:target]
Return a manifest for the @dfn{development inputs} of @var{package} for
@var{system}, optionally when cross-compiling to @var{target}.
Development inputs include both explicit and implicit inputs of
@@ -8637,7 +8627,7 @@ Writing Manifests
(GCC), the many supporting libraries (Boost, GLib, GTK, etc.), and a
couple of additional development tools---these are the dependencies
@command{guix show inkscape} lists.
-@end deffn
+@end defun
@c TODO: Move (gnu packages) interface to a section of its own.
@@ -8645,7 +8635,7 @@ Writing Manifests
to build manifests. In particular, it lets you look up packages by
name---see below.
-@deffn {Scheme Procedure} specifications->manifest @var{specs}
+@defun specifications->manifest specs
Given @var{specs}, a list of specifications such as @code{"emacs@@25.2"}
or @code{"guile:debug"}, return a manifest. Specs have the format that
command-line tools such as @command{guix install} and @command{guix
@@ -8662,7 +8652,7 @@ Writing Manifests
the right set of modules, and referring to the right variables.
Instead, we directly refer to packages in the same way as on the command
line, which can often be more convenient.
-@end deffn
+@end defun
@c TODO: specifications->package, etc.
@@ -10114,54 +10104,54 @@ Build Utilities
This section documents procedures that deal with store file names.
-@deffn {Scheme Procedure} %store-directory
+@defun %store-directory
Return the directory name of the store.
-@end deffn
+@end defun
-@deffn {Scheme Procedure} store-file-name? @var{file}
+@defun store-file-name? file
Return true if @var{file} is in the store.
-@end deffn
+@end defun
-@deffn {Scheme Procedure} strip-store-file-name @var{file}
+@defun strip-store-file-name file
Strip the @file{/gnu/store} and hash from @var{file}, a store file name.
The result is typically a @code{"@var{package}-@var{version}"} string.
-@end deffn
+@end defun
-@deffn {Scheme Procedure} package-name->name+version @var{name}
+@defun package-name->name+version name
Given @var{name}, a package name like @code{"foo-0.9.1b"}, return two
values: @code{"foo"} and @code{"0.9.1b"}. When the version part is
unavailable, @var{name} and @code{#f} are returned. The first hyphen
followed by a digit is considered to introduce the version part.
-@end deffn
+@end defun
@subsection File Types
The procedures below deal with files and file types.
-@deffn {Scheme Procedure} directory-exists? @var{dir}
+@defun directory-exists? dir
Return @code{#t} if @var{dir} exists and is a directory.
-@end deffn
+@end defun
-@deffn {Scheme Procedure} executable-file? @var{file}
+@defun executable-file? file
Return @code{#t} if @var{file} exists and is executable.
-@end deffn
+@end defun
-@deffn {Scheme Procedure} symbolic-link? @var{file}
+@defun symbolic-link? file
Return @code{#t} if @var{file} is a symbolic link (aka. a ``symlink'').
-@end deffn
+@end defun
-@deffn {Scheme Procedure} elf-file? @var{file}
-@deffnx {Scheme Procedure} ar-file? @var{file}
-@deffnx {Scheme Procedure} gzip-file? @var{file}
+@defun elf-file? file
+@defunx ar-file? file
+@defunx gzip-file? file
Return @code{#t} if @var{file} is, respectively, an ELF file, an
@code{ar} archive (such as a @file{.a} static library), or a gzip file.
-@end deffn
+@end defun
-@deffn {Scheme Procedure} reset-gzip-timestamp @var{file} [#:keep-mtime? #t]
+@defun reset-gzip-timestamp file [#:keep-mtime? #t]
If @var{file} is a gzip file, reset its embedded timestamp (as with
@command{gzip --no-name}) and return true. Otherwise return @code{#f}.
When @var{keep-mtime?} is true, preserve @var{file}'s modification time.
-@end deffn
+@end defun
@subsection File Manipulation
@@ -10182,20 +10172,20 @@ Build Utilities
exception.
@end deffn
-@deffn {Scheme Procedure} mkdir-p @var{dir}
+@defun mkdir-p dir
Create directory @var{dir} and all its ancestors.
-@end deffn
+@end defun
-@deffn {Scheme Procedure} install-file @var{file} @var{directory}
+@defun install-file file directory
Create @var{directory} if it does not exist and copy @var{file} in there
under the same name.
-@end deffn
+@end defun
-@deffn {Scheme Procedure} make-file-writable @var{file}
+@defun make-file-writable file
Make @var{file} writable for its owner.
-@end deffn
+@end defun
-@deffn {Scheme Procedure} copy-recursively @var{source} @var{destination} @
+@defun copy-recursively source destination @
[#:log (current-output-port)] [#:follow-symlinks? #f] @
[#:copy-file copy-file] [#:keep-mtime? #f] [#:keep-permissions? #t]
Copy @var{source} directory to @var{desti
This message was truncated. Download the full message here.
L
L
Ludovic Courtès wrote on 13 Mar 2023 15:06
Re: bug#62042: [PATCH 0/4] Harmonize @-commands used in doc/guix.texi
(name . Bruno Victal)(address . mirai@makinata.eu)(address . 62042-done@debbugs.gnu.org)
87jzzk21b3.fsf@gnu.org
Hi Bruno,

Bruno Victal <mirai@makinata.eu> skribis:

Toggle quote (11 lines)
> In a similar vein to the work done in #60634, in most cases it's
> implicit that we're dealing with Scheme procedures. This patchset
> normalizes the @-commands for procedures and corrects some incongruencies
> missed in the #60634 patch-series.
>
> Bruno Victal (4):
> doc: Fix incorrect @deffn usage for service-types.
> doc: Fix incorrect @deffn usage for data types.
> doc: Use @defun for procedures.
> doc: Use @defmac and @defspec for macros.

Applied. Thanks again for tidying things up!

Ludo’.
Closed
?