[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Shortcut for \repeat unfold
From: |
Jean Abou Samra |
Subject: |
Shortcut for \repeat unfold |
Date: |
Sat, 25 Sep 2021 01:32:17 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
Hi,
This continues a discussion sparked at
https://gitlab.com/lilypond/lilypond/-/merge_requests/921
In short, I propose to make the first argument to
\repeat optional, making \repeat n music equivalent to
\repeat unfold n music.
The principal motivation is sparing typing. \repeat unfold
is commonly used as a time-saving shortcut, not only in
real-world usage, but also while constructing minimal
working examples involving filler music. It is personally
one of the commands I use the most frequently, and I am
apparently not alone in that case
(https://gitlab.com/lilypond/lilypond/-/merge_requests/921#note_682103342).
My experience is that every time I want to repeat a note
four times, I have a half-a-second wonder about whether
typing "\repeat unfold" will be shorter than cut-and-paste.
Now, if we want to shorten \repeat unfold, what's the best
syntax? I favor \repeat as it matches usage patterns of
functions with optional arguments (like \time). Even though
\repeat is not currently a music function, I think having it
mimic that syntax helps mnemonics. \repeat n music is also
very readable.
Other possibilities:
- "\rep n music", not as self-telling (and I think Lukas
only calls his shortcut \rep because redefining \repeat
is not syntactically valid);
- "music * n", attractive but the difference between c1*5
and { c1 } * 5 would be confusing; also, for longer passages
one would rather state the number of repetitions from the
start than having to remember to put it at the end;
- "\* n music", very short but doesn't read as nicely I think,
and I don't view repeats as special enough to warrant
this kind of syntax with many special characters.
With this change, documentation can be updated to use
the short syntax (let's leave Documentation/snippets as-is
though, to avoid piling work that will have to be paid
at the next LSR upgrade, whenever that happens).
Thoughts?
Regards,
Jean
PS: Apart from regression tests and documentation,
I have a draft implementation locally.
- Shortcut for \repeat unfold,
Jean Abou Samra <=
- Re: Shortcut for \repeat unfold, Aaron Hill, 2021/09/24
- Re: Shortcut for \repeat unfold, Lukas-Fabian Moser, 2021/09/25
- Re: Shortcut for \repeat unfold, antlists, 2021/09/25
- Re: Shortcut for \repeat unfold, Werner LEMBERG, 2021/09/25
- Re: Shortcut for \repeat unfold, Lukas-Fabian Moser, 2021/09/25
- Re: Shortcut for \repeat unfold, anthony, 2021/09/25
- Re: Shortcut for \repeat unfold, Lukas-Fabian Moser, 2021/09/25
- Re: Shortcut for \repeat unfold, Dan Eble, 2021/09/25
- Re: Shortcut for \repeat unfold, Lukas-Fabian Moser, 2021/09/25
- Re: Shortcut for \repeat unfold, Hans Åberg, 2021/09/25