[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pygment regex question

From: Jean Abou Samra
Subject: Re: pygment regex question
Date: Sat, 26 Nov 2022 15:33:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0

Le 26/11/2022 à 11:32, Lukas-Fabian Moser a écrit :
Hi Werner,

In the NR, most such functions have its argument starting with `#`,
for example

\ottava #-2

Are there still cases where `#` is mandatory for numbers? Otherwise
the documentation could be updated to remove all `#`.

Yes, there are: In markup, for example.

\markup \fontsize 3 Hi

is still illegal.

I'm all for removing the # escape (and string quotes and/or #' for symbols) in the documentation where it's possible; my own LilyPond style feels much more relaxed since I found out how many of those I can omit.

\version "2.23.10"

\removeWithTag dyn \new Staff = upper {
  \tag dyn <>\mf
  \ottava -1

But of course there's always the danger of beginners tripping up on this because they do not recognise the situations where #/'/"" are still needed.

FWIW, the last one


is something I wouldn't do, since


does not work ("a_boringly" is interpreted as a pitch name).

Personally, I tend to leave out # when possible for numbers,
and also leave out #' for symbols when possible because it
is not only shorter, but allows the syntax highlighting program
to highlight them specially if they're built-ins, be it
in Frescobaldi or in the documentation via Pygments.
On the other hand, I usually use " marks (but not # when
not required) around strings, because I might want to add
spaces in them, and once again because it makes the syntax
highlighting more useful.

For \new Staff = <this>, I never settled my mind :-)  It
expects a string, but then one could argue that accepting
a symbol here would more sense.


Attachment: OpenPGP_signature
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]