lilypond-user
[Top][All Lists]
Advanced

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

Re: Define an alias to a parametrized command


From: Volodymyr Prokopyuk
Subject: Re: Define an alias to a parametrized command
Date: Wed, 28 Jun 2023 12:28:46 +0200

Thank you Valetin, David, and Leo for your support! I really appreciate it!

Summary of the proposed options
I've settled on the second option for my use case.

Thank you very much,
Vlad


On Wed, Jun 28, 2023 at 12:55 AM Valentin Petzel <valentin@petzel.at> wrote:
Hello Vlad,

Also checkout this thread:
https://lists.gnu.org/archive/html/lilypond-user/2023-02/msg00035.html

If you want a real alias (that is a second binding to the same function) you
can do

#(define acc acciaccatura)

This will create another binding to the same object, which means you do not
need to care about what arguments that thing takes (but it will also mean that
changing one will also change the other.

The other options like saying

acc = \acciaccatura \etc

do not alias the command, but create a wrapper function around the original
function.

Cheers,
Valentin

Am Dienstag, 27. Juni 2023, 21:57:58 CEST schrieb Volodymyr Prokopyuk:
> Hello,
>
> I'd like to define a shorter alias to a parametrized command. My two
> specific use cases are
>
>    - Define \acc { c='8 d e } to be translated into \acciaccatura { c='8 d
>    e }
>    - Define \af 4. to be translated into \after 4.\!
>
> I've tried the \set command, but it seems that the \set command does not
> handle parameters. I have an intuitive understanding that this type of
> aliases can be done with Scheme, but I do not know how exactly.
>
> Thank you,
> Vlad


reply via email to

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