[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Doc-string with newline character
From: |
Thomas Morley |
Subject: |
Re: Doc-string with newline character |
Date: |
Thu, 31 Dec 2020 12:04:01 +0100 |
Am Do., 31. Dez. 2020 um 00:11 Uhr schrieb Thomas Morley
<thomasmorley65@gmail.com>:
>
> Am Do., 31. Dez. 2020 um 00:00 Uhr schrieb David Kastrup <dak@gnu.org>:
> >
> > Thomas Morley <thomasmorley65@gmail.com> writes:
> >
> > > Am Mi., 30. Dez. 2020 um 10:37 Uhr schrieb Jonas Hahnfeld
> > > <hahnjo@hahnjo.de>:
> > >>
> > >> Hi,
> > >>
> > >> Am Mittwoch, dem 30.12.2020 um 10:31 +0100 schrieb Thomas Morley:
> > >> > Hi,
> > >> >
> > >> > while preparing a patch a noticed a problem with a doc-string:
> > >> > I want to refer to newline characters and wrote "@code{#\newline}",
> > >> > but it comes out as
> > >> > # ewline
> > >> > for both pdf and html.
> > >> > I couldn't figure how to let print
> > >> > #\newline
> > >> >
> > >> > Any hint?
> > >>
> > >> I didn't try, but I could imagine that you need to escape the backslash
> > >> so it's not expanded when parsing the string, like so:
> > >> @code{#\\newline}
> > >>
> > >> Does this help?
> > >>
> > >> Jonas
> > >
> > > @code{#\\newline} did the trick already (I thought I had checked this...)
> > > Patch is now up
> > > https://gitlab.com/lilypond/lilypond/-/merge_requests/581
> > >
> > > Though, there is a further question.
> > > The patch aims at introducing a new markup-list-command. Thus the
> > > doc-string is taken for
> > > NR A.12 Text markup list commands
> > > This now looks as attached.
> > >
> > > I'd love to see there
> > > "
> > > Used properties
> > > - split-char (#\newline)
> > > "
> > >
> > > Any chance?
> > >
> > > Thanks,
> > > Harm
> > >
> > >
> > >
> >
> > It's probably a bug. Try replacing in
> >
> > (format #f "@item @code{~a} (~a)\n"
> >
> > in the function doc-markup-function-properties in
> > scm/document-markup.scm the second ~a with ~s (which should quote
> > everything in read syntax). This would likely have more consequences,
> > like when there are string defaults.
> >
> > --
> > David Kastrup
>
> I'll have a look.
>
>
> Many thanks,
> Harm
While using ~s #\newline is displayed properly:
Used properties:
• split-char (#\newline)
Though, empty lists would be displayed without quote (p.e. from
markup-command \whiteout):
Used properties:
• thickness (())
To keep it, one could do in `doc-markup-function-properties`:
(let ((default (cadr prop-spec)))
(if (and (list? default)
(null? default))
'()
default)
(format #f "@item @code{~a} (~:[~s~;'()~])"
(car prop-spec)
(null? default)
default))
->
Used properties:
• thickness ('())
I regard the formatting code a bit cryptic.
How are opinions about keeping the apostrophe for empty lists?
Pairs don't display it anyway. P.e. from \overtie:
Used properties:
• shorten-pair ((0 . 0))
Thanks,
Harm
- Doc-string with newline character, Thomas Morley, 2020/12/30
- Re: Doc-string with newline character, Jonas Hahnfeld, 2020/12/30
- Re: Doc-string with newline character, Thomas Morley, 2020/12/30
- Re: Doc-string with newline character, David Kastrup, 2020/12/30
- Re: Doc-string with newline character, Thomas Morley, 2020/12/30
- Re: Doc-string with newline character,
Thomas Morley <=
- Re: Doc-string with newline character, David Kastrup, 2020/12/31
- Re: Doc-string with newline character, Thomas Morley, 2020/12/31
- Re: Doc-string with newline character, David Kastrup, 2020/12/31
Re: Doc-string with newline character, Werner LEMBERG, 2020/12/30