lilypond-user
[Top][All Lists]
Advanced

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

Re: Abbreviations


From: Simon Albrecht
Subject: Re: Abbreviations
Date: Sat, 04 Apr 2015 12:52:58 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

Am 04.04.2015 um 12:37 schrieb Reedmace Star:
* 2015-04-03 10:25 +0200 Andrew Bernard <address@hidden>:
Can I make a simple abbreviation for input? For example \t instead of \tuplet?
Since your question already got answered directly, I hope I can add a
piece of advice without sounding too destructive:

Don't do it. Redefining standard commands just to save typing is a
terrible idea.

This comes from experience not specific to LilyPond only. I still
"fondly" remember the times when I had to work with LaTeX files prepared
by wise guys who thought it was a brilliant idea to redefine those pesky
\begin{equation} and \end{equation} commands to \be and \ee. Besides
forcing me to get used to their nonstandard style and being, IMO,
considerably harder to read, this completely outsmarted syntax
highlighting and preview generation in my editor.

Apropos outsmarting tools: with LilyPond source code in particular, you
risk doing that to convert-ly, which works with textual substitutions.
For example, I am thinking of the relatively recent \times -> \tuplet
transition: while your code would not have broken with a redefinition as
above in place, you would have cut the way to getting updated to more
modern syntax.

The effects on collaboration with other humans matter more, however. You
might not consider this relevant if you are currently the only one
reading and writing your code, yet, again from experience: one, you
never know, some collaboration may come along sooner that you expect;
two, you may want to ask questions or report bugs on these mailing
lists, which also involves presenting parts of your code to others; and
finally, three: you become a stranger to your own code faster than you
think. Say your priorities shift, you don't work with LilyPond for two
or three years; getting used to the syntax again will then be tedious
enough without having to relearn an additional layer of indirection you
piled up on top of it.

To save typing, I suggest using the capabilities of your editor. Many of
those allow to define keyboard shortcuts or provide other mechanisms for
inserting commonly used pieces of text conveniently. If nothing else is
available, you can still enter a short placeholder string while typing
and then use search-and-replace before you compile.
That seems like valuable advice. Thank you.
Simon



reply via email to

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