lilypond-devel
[Top][All Lists]
Advanced

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

Re: Add layout changing command \layout-from for getting context defs fr


From: janek . lilypond
Subject: Re: Add layout changing command \layout-from for getting context defs from music (issue 5686046)
Date: Thu, 23 Feb 2012 05:52:32 +0000

HTH,
Janek


http://codereview.appspot.com/5686046/diff/1/ly/context-mods-init.ly
File ly/context-mods-init.ly (right):

http://codereview.appspot.com/5686046/diff/1/ly/context-mods-init.ly#newcode49
ly/context-mods-init.ly:49: to @code{'Voice}.
On 2012/02/23 00:53:58, dak wrote:
On 2012/02/23 00:13:34, janek wrote:
> I don't get what these Bottoms are.

\set whatever = value is the same as \set Bottom.whatever = value.
Bottom is an
alias for Voice most of the time, but in some contexts (like TabStaff
and below)
also for TabVoice, or for Lyrics or some other things.

How should I write this instead?

maybe
"if you specify optional @var{bottom} argument, all instructions that
apply to bottom-level contexts (for example Voice) will be applied to
the context you specified.  For example, you can tell layout-from to
apply \override #'font-size = #2 to TabVoice or Lyrics context instead
of default Voice context."
(if i understood it correctly)

http://codereview.appspot.com/5686046/diff/1/ly/context-mods-init.ly#newcode55
ly/context-mods-init.ly:55: ;; Scheme.
On 2012/02/23 00:53:58, dak wrote:
The parser turns all sets, overrides etc into something wrapped in
ContextSpeccedMusic.  If you ever get a set, override etc that is not
wrapped in
ContextSpeccedMusic, the user has created it in Scheme himself.  In
that case,
the code will try to use #f as a context modification resulting in an
error.
It's a situation that can only be triggered when you are messing in
experienced
areas, so I don't bother providing a different behavior.

One could let "mods" be an empty context modification instead: in that
case, the
bad commands outside of ContextSpeccedMusic would just silently get
eaten.  I
prefer an explicit error, even if it is a Scheme execution error.  It
is close
enough to the cause to be informative.

Proposal for a comment expressing that better?

Something like
"All standard layout instruction events occur inside
ContextSpeccedMusic.  We initialize the context with #f and overwrite it
using ContextSpeccedMusic - this will fail and produce an error in case
of special instructions written by user in Scheme."
perhaps.
Or you could simply use the first paragraph of your explanation (The
parser turns...).  It's nice & clear to me.

http://codereview.appspot.com/5686046/



reply via email to

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