unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Luis Felipe via "Bug reports for GUILE, GNU's Ubiquitous Extension Language" <bug-guile@gnu.org>
To: 62870@debbugs.gnu.org
Subject: bug#62870: Texinfo: stexi->texi: Itemize End command not in a line of its own
Date: Sat, 15 Apr 2023 19:51:54 +0000	[thread overview]
Message-ID: <06c808f6-08e6-bc96-827f-4e2662b08923@zoho.com> (raw)


[-- Attachment #1.1.1: Type: text/plain, Size: 2368 bytes --]

Hi,

The command ending an itemization (end command) is not placed in a line 
of its own, but it should:

"Block commands: These commands are written at the start of a line, with 
general text on following lines, terminated by a matching '@end' command 
on a line of its own." — Texinfo manual, @-Command Syntax.

This happens with the "itemize" command, but not with similar block 
commands like "example", "lisp", "display" and "format".

Operating system: Guix System x86_64 Kernel: 6.1.14-gnu
GNU Guile: 3.0.9


STEPS TO REPRODUCE

1. Start a Guile REPL
2. Run the following code:

    #+begin_src scheme
      (use-modules (texinfo serialize))
      (stexi->texi
       '(*fragment* (itemize (item "mango") (item "lemon"))))
    #+end_src


EXPECTED RESULT

A string like this one:

#+begin_src scheme
   "@itemize\n@item\nmango\n@item\nlemon\n@end itemize\n"
#+end_src

Which displays like this:

#+begin_example
@itemize
@item
mango
@item
lemon
@end itemize
#+end_example


UNEXPECTED RESULT

A string where the "@end itemize" command is not on a line of its own. 
Instead, the command gets appended to the last item in the list:

#+begin_src scheme
   "\n@c %start of fragment\n\n@itemize \n@item\nmango@item\nlemon@end 
itemize\n\n\n@c %end of fragment\n"
#+end_src

Which displays like this:

#+begin_example

@c %start of fragment

@itemize
@item
mango@item
lemon@end itemize


@c %end of fragment
#+end_example

Since the "@end" command is expected to be on a line of its own, tools 
like Texinfo's "makeinfo" program emit warnings like the following when 
converting the fragment to HTML:

#+begin_example
index.texi:73: warning: @end should only appear at the beginning of a line
#+end_example

(It seems also that the "items" themselves are not properly formatted, 
and, in addition, I wouldn't expect the wrapping comments about start 
and end of the fragment; but those seem like a different story, and 
don't trigger warnings anyways.)


WORKAROUND

Append a newline character to the last item of the list, like so:

#+begin_src scheme
   (use-modules (texinfo serialize))
   (stexi->texi
    '(*fragment* (itemize (item "mango") (item "lemon\n"))))
#+end_src

-- 
Luis Felipe López Acevedo
https://luis-felipe.gitlab.io/


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 2881 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

                 reply	other threads:[~2023-04-15 19:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=06c808f6-08e6-bc96-827f-4e2662b08923@zoho.com \
    --to=bug-guile@gnu.org \
    --cc=62870@debbugs.gnu.org \
    --cc=sirgazil@zoho.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).