Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(743)

Issue 74540044: Add on-page-greater-than, -less-than (on-the-fly)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 1 month ago by pwm
Modified:
6 years, 10 months ago
Reviewers:
dak, Trevor Daniels
CC:
lilypond-devel_gnu.org
Base URL:
http://git.savannah.gnu.org/gitweb/?p=lilypond.git/trunk/
Visibility:
Public.

Description

Add on-page-greater-than, -less-than (on-the-fly) Adds two new ready-made procedures for use with the \on-the-fly conditional markup command. They test whether a page is greater than or less than a user-specified number. Documentation for both of them is also part of this commit.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -0 lines) Patch
M Documentation/notation/input.itely View 1 chunk +2 lines, -0 lines 0 comments Download
M ly/titling-init.ly View 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 5
pwm
Using a different local branch did the trick. -Paul
10 years, 1 month ago (2014-03-18 03:07:23 UTC) #1
Trevor Daniels
LGTM Trevor
10 years, 1 month ago (2014-03-18 12:11:51 UTC) #2
dak
Ok, I've taken another look at something that should help with this amount of fine-grained ...
6 years, 10 months ago (2017-06-09 13:36:53 UTC) #3
pwm
On 2017/06/09 13:36:53, dak wrote: > Ok, I've taken another look at something that should ...
6 years, 10 months ago (2017-06-10 19:36:30 UTC) #4
dak
6 years, 10 months ago (2017-06-12 15:22:51 UTC) #5
On 2017/06/10 19:36:30, pwm wrote:
>
> That's a nice consistency.  I tried it out and the following works too:
> 
> #(define (onpage proc nmbr)
>   (markup-when ((page:page-number -1))
>    (proc page:page-number nmbr)))
> 
> \paper {
>   #(set-paper-size "a7landscape")
>   oddFooterMarkup = \markup \on-the-fly #(onpage > 3) "This is
> long!"
> }

Come to think of it, the only application would seem in connection with
\on-the-fly, so it should be possible to wrap the \on-the-fly invocation into
the macro as well.

I've put up issue 5145 for basically replacing \on-the-fly with $ when one
really wants to write this as \markup $(onpage > 3) "This is long!".

This requires an amended definition of markup-when adding a markup command
signature:

#(define-macro (markup-when properties . cond)
   `(let ((markfun
	   (lambda (layout props arg)
	     (if
	      (let ,(map (lambda (p)
			   (if (pair? p)
			       `(,(car p) (chain-assoc-get ',(car p) props ,@(cdr p)))
			       `(,p (chain-assoc-get ',p props))))
			 properties)
		,@cond)
	      (interpret-markup layout props arg)
	      empty-stencil))))
      (set! (markup-command-signature markfun)
	    (list markup?))
      markfun))

#(define (on-page-greater-than nmbr)
  (markup-when ((page:page-number -1))
   (> page:page-number nmbr)))

\paper {
  #(set-paper-size "a7landscape")
  oddFooterMarkup = \markup $(on-page-greater-than 3) "This is long!"
}

\score {
  \repeat unfold 256 c'1
}

I don't actually want to pursue this path as the preferred user interface: it
just seemed to me that it should work.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b