Urs Liska <u...@openlilylib.org> 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 <d...@gnu.org> 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 _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel