public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb/doc: Remove (...) around guile procedure names in @deffn lines
@ 2022-01-07 17:50 Andrew Burgess
  0 siblings, 0 replies; only message in thread
From: Andrew Burgess @ 2022-01-07 17:50 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8af9b8009b8b8a5ad39d014ef9aab51a8117a520

commit 8af9b8009b8b8a5ad39d014ef9aab51a8117a520
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Wed Dec 22 16:04:56 2021 +0000

    gdb/doc: Remove (...) around guile procedure names in @deffn lines
    
    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.

Diff:
---
 gdb/doc/guile.texi | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

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 @@ the command to @value{GDBN} from @code{make-command}.
 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 @@ the parameter to @value{GDBN} from @code{make-parameter}.
 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-07 17:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-07 17:50 [binutils-gdb] gdb/doc: Remove (...) around guile procedure names in @deffn lines Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).