lilypond-devel
[Top][All Lists]
Advanced

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

Re: Result of (ly:get-option 'point-and-click)


From: David Kastrup
Subject: Re: Result of (ly:get-option 'point-and-click)
Date: Tue, 19 Jan 2016 11:41:05 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Urs Liska <address@hidden> writes:

> Hi devs,
>
> please consider
>
> #(if (ly:get-option 'point-and-click)
>      (let ((point-and-click (ly:get-option 'point-and-click)))
>        (display point-and-click)))
>
> Can this ever print anything else than #t ?

Yes.

> As far as I can see
>     (ly:get-option 'point-and-click)
>
> can return either #t or #f, is that right?

No.

> And if that's right what is the code in output-ps.scm for:
>
>   (if (ly:get-option 'point-and-click)
>       (let* ((cause (ly:grob-property grob 'cause))
>              (music-origin (if (ly:stream-event? cause)
>                                (ly:event-property cause 'origin)))
>              (point-and-click (ly:get-option 'point-and-click)))
>         (if (and
>              (ly:input-location? music-origin)
>              (cond ((boolean? point-and-click) point-and-click)
>                    ((symbol? point-and-click)
>                     (ly:in-event-class? cause point-and-click))
>                    (else (any (lambda (t)
>                                 (ly:in-event-class? cause t))
>                               point-and-click))))
>
> It looks that all this code is only executed when point-and-click is
> set, so I don't see why all this code has to be executed.

When all else fails, try reading the documentation.

<URL:http://lilypond.org/doc/v2.18/Documentation/usage/configuring-the-system-for-point-and-click#selective-point_002dand_002dclick>

> As a test I replaced the conditional by a simple
>     (if (ly:input-location? music-origin)
> and a few test scores compiled with proper point-and-click in the output
> file.
>
> So: Is there a reason for this code or can I remove it?

There is a reason, it is extensively documented, and you could have used
"git blame -w" on the lines in question to lead that reason back to

commit 4e021773761fbb873602891f788b408c5c085953
Author: David Kastrup <address@hidden>
Date:   Tue Nov 1 20:55:04 2011 +0100

    Issue 1954: Implement event type filtering for pointAndClick events.

I mean, code cleanup is all well and nice, but we are talking about a
well-traceable feature with full user-level documentation, user-level
commands to control it, and regtest and everything here.

What does it take to save a feature from "cleanup"?

-- 
David Kastrup



reply via email to

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