[PATCHv2,1/2] gdb/doc: Remove (...) around guile procedure names in @deffn lines

Message ID 8af9b8009b8b8a5ad39d014ef9aab51a8117a520.1641566623.git.aburgess@redhat.com
State New
Headers show
Series
  • gdb/doc: some improvements to the guile docs
Related show

Commit Message

Simon Marchi via Gdb-patches Jan. 7, 2022, 2:45 p.m.
Most guile procedures in the guile.texi file are defined like:

  @deffn {Scheme Procedure} name arg1 arg2 arg3

But there are two places where we do this:

  @deffn {Scheme Procedure} (name arg1 arg2 arg3)

Notice the added (...).  Though this does represent how a procedure
call is written in scheme, it's not the normal style throughout the
manual.  I also checked the 'info guile' info page to see how they
wrote there declarations, and they use the first style too.

The second style also has the drawback that index entries are added as
'(name', and so they are grouped in the '(' section of the index,
which is not very user friendly.

In this commit I've changed the definitions of make-command and
make-parameter to use the first style.

The procedure declaration lines can get pretty long with all of the
arguments, and this was true for both of the procedures I am changing
in this commit.  I have made use of a trailing '@' to split the deffn
lines, and keep them under 80 characters in the texi source.  This
makes no difference to how the final document looks.

Finally, our current style for keyword arguments, appears to be:

  [#:keyword-name argument-name]

I don't really understand the reason for this, 'info guile' just seems
to use:

  [#:keyword-name]

which seems just as good to me.  But I don't propose to change
that just now.  What I do notice though, is that sometimes, texinfo
will place a line break between the keyword-name and the
argument-name, for example, the pdf of make-command is:

  make-command name [#:invoke invoke] [#:command-class
    command-class] [#:completer-class completer] [#:prefix? prefix] [#:doc
    doc-string]

Notice the line break after '#:command-class' and after '#:doc',
neither of which are ideal.  And so, for the two commands I am
changing in this commit, I have made use of @w{...} to prevent line
breaks between the keyword-name and the argument-name.  Now the pdf
looks like this:

  make-command name [#:invoke invoke]
    [#:command-class command-class] [#:completer-class completer]
    [#:prefix? prefix] [#:doc doc-string]

Which seems much better.  I'll probably update the other deffn lines
at some point.
---
 gdb/doc/guile.texi | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

-- 
2.25.4

Comments

Simon Marchi via Gdb-patches Jan. 7, 2022, 2:59 p.m. | #1
> Date: Fri,  7 Jan 2022 14:45:25 +0000

> From: Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org>

> Cc: Andrew Burgess <aburgess@redhat.com>

> 

> Most guile procedures in the guile.texi file are defined like:

> 

>   @deffn {Scheme Procedure} name arg1 arg2 arg3

> 

> But there are two places where we do this:

> 

>   @deffn {Scheme Procedure} (name arg1 arg2 arg3)

> 

> Notice the added (...).  Though this does represent how a procedure

> call is written in scheme, it's not the normal style throughout the

> manual.  I also checked the 'info guile' info page to see how they

> wrote there declarations, and they use the first style too.

> 

> The second style also has the drawback that index entries are added as

> '(name', and so they are grouped in the '(' section of the index,

> which is not very user friendly.

> 

> In this commit I've changed the definitions of make-command and

> make-parameter to use the first style.

> 

> The procedure declaration lines can get pretty long with all of the

> arguments, and this was true for both of the procedures I am changing

> in this commit.  I have made use of a trailing '@' to split the deffn

> lines, and keep them under 80 characters in the texi source.  This

> makes no difference to how the final document looks.

> 

> Finally, our current style for keyword arguments, appears to be:

> 

>   [#:keyword-name argument-name]

> 

> I don't really understand the reason for this, 'info guile' just seems

> to use:

> 

>   [#:keyword-name]

> 

> which seems just as good to me.  But I don't propose to change

> that just now.  What I do notice though, is that sometimes, texinfo

> will place a line break between the keyword-name and the

> argument-name, for example, the pdf of make-command is:

> 

>   make-command name [#:invoke invoke] [#:command-class

>     command-class] [#:completer-class completer] [#:prefix? prefix] [#:doc

>     doc-string]

> 

> Notice the line break after '#:command-class' and after '#:doc',

> neither of which are ideal.  And so, for the two commands I am

> changing in this commit, I have made use of @w{...} to prevent line

> breaks between the keyword-name and the argument-name.  Now the pdf

> looks like this:

> 

>   make-command name [#:invoke invoke]

>     [#:command-class command-class] [#:completer-class completer]

>     [#:prefix? prefix] [#:doc doc-string]

> 

> Which seems much better.  I'll probably update the other deffn lines

> at some point.


Thanks.  This is really an "obvious fix", and is definitely OK.

Patch

diff --git a/gdb/doc/guile.texi b/gdb/doc/guile.texi
index 52348aab8f7..c7e367a9ca8 100644
--- a/gdb/doc/guile.texi
+++ b/gdb/doc/guile.texi
@@ -1727,8 +1727,10 @@ 
 There is no support for multi-line commands, that is commands that
 consist of multiple lines and are terminated with @code{end}.
 
-@c TODO: line length
-@deffn {Scheme Procedure} (make-command name @r{[}#:invoke invoke{]} @r{[}#:command-class command-class@r{]} @r{[}#:completer-class completer{]} @r{[}#:prefix? prefix@r{]} @r{[}#:doc doc-string{]})
+@deffn {Scheme Procedure} make-command name @w{@r{[}#:invoke invoke@r{]}} @
+    @w{@r{[}#:command-class command-class@r{]}} @
+    @w{@r{[}#:completer-class completer@r{]}} @
+    @w{@r{[}#:prefix? prefix@r{]}} @w{@r{[}#:doc doc-string@r{]}}
 
 The argument @var{name} is the name of the command.  If @var{name} consists of
 multiple words, then the initial words are looked for as prefix
@@ -2017,8 +2019,13 @@ 
 Parameters are exposed to the user via the @code{set} and
 @code{show} commands.  @xref{Help}.
 
-@c TODO line length
-@deffn {Scheme Procedure} (make-parameter name @r{[}#:command-class command-class@r{]} @r{[}#:parameter-type parameter-type{]} @r{[}#:enum-list enum-list@r{]} @r{[}#:set-func set-func{]} @r{[}#:show-func show-func{]} @r{[}#:doc doc{]} @r{[}#:set-doc set-doc{]} @r{[}#:show-doc show-doc{]} @r{[}#:initial-value initial-value{]})
+@deffn {Scheme Procedure} make-parameter name @
+    @w{@r{[}#:command-class command-class@r{]}} @
+    @w{@r{[}#:parameter-type parameter-type@r{]}} @
+    @w{@r{[}#:enum-list enum-list@r{]}} @w{@r{[}#:set-func set-func@r{]}} @
+    @w{@r{[}#:show-func show-func@r{]}} @w{@r{[}#:doc doc@r{]}} @
+    @w{@r{[}#:set-doc set-doc@r{]}} @w{@r{[}#:show-doc show-doc@r{]}} @
+    @w{@r{[}#:initial-value initial-value@r{]}}
 
 The argument @var{name} is the name of the new parameter.  If @var{name}
 consists of multiple words, then the initial words are looked for as prefix