[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Test direction within event-function
From: |
David Kastrup |
Subject: |
Re: Test direction within event-function |
Date: |
Wed, 17 Oct 2018 12:01:36 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Urs Liska <address@hidden> writes:
> Hi,
>
> I'm trying to write an event-function that creates both a slur and a
> markup on opposite sides. I can do that by manually specifying the
> directions:
>
> \version "2.19.82"
>
> testDirection =
> #(define-event-function ()()
> #{
> _(
> ^"Text"
> #})
>
> {
> c' \testDirection d' )
> }
>
> but I have to make it possible to do it both ways (top/bottom and
> bottom/top).
> I know how to set the directions with an extra (optional) function
> argument, but I would prefer if I could extract the direction directly
> from within the event-function.
You can't. It is set after calling the event-function. You can use
tweaks/callbacks for the respective grob functions (most likely
"direction") where you use event-cause to get the originating event, get
the event direction from there and either use or invert it.
Am badly available for a few days. Sister's wedding.
--
David Kastrup