[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Action of \unset
From: |
Trevor Daniels |
Subject: |
Re: Action of \unset |
Date: |
Tue, 29 Apr 2008 23:35:28 +0100 |
Thanks Mats,
You wrote
As far as I can see, it removes any settings of the property
in the specified context (i.e. in the current context by default).
After I posted the query I hunted in the sources a bit and came to the same
conclusion. context.cc contains:
void
Context::unset_property (SCM sym)
{
properties_dict ()->remove (sym);
}
which seems pretty definite.
The reason that this often means that the setting is reverted
to the default value is either
1. that the default is that the property is unset and that LilyPond
makes some suitable choice if the property is unset.
2. that the default setting is done at the Score level (or
at least higher up in the context hierarchy).
The following example illustrates alternative 2:
\relative{
\set Staff.fontSize = #3
c d e f
\set Voice.fontSize = #1
c d e f
\unset Voice.fontSize
c d e f
\unset Staff.fontSize
c d e f
}
\relative{
\set fontSize = #3
c d e f
\set fontSize = #1
c d e f
\unset fontSize
c d e f
\unset fontSize
c d e f
}
It was an example like this that threw me, as I incorrectly generalised from
this rather special action with fontSize in writing the section on \set in
the LM originally.
This trick of setting a property at the Score level works for some other
(but not all) context properties; for example, it works with clefOctavation
but not with instrumentCueName. I don't know what determines this.
For a long time, I had the impression that \set and \unset did
push and pop on a stack (if you know about these computer
science concepts), but apparently I was wrong.
Me too. I was fooled by the special action of fontSize.
I'm not sure how to best explain these things, at least not in a
Learning Manual.
I've had a go in LM 3. It's in git as commit
133986d102f82aa501a0e8592a80c3cd350ffdb1 -
GDP: Process comments on LM 3 (B).
As usual, git has added lots of changes which seem to do
nothing, but you can just about make out the changes I've
made. Please let me know if you can suggest any improvements,
although it might be better to wait until the docs are
recompiled in GDP so you can see the changes in context.
(sorry! ;)
/Mats
Trevor
Trevor Daniels wrote:
The description of \unset in the Learning Manual is currently incorrect,
and I would like to replace that with an accurate description of its
action, which seems to depend to some extent on the type of context
property which is being unset. Could someone please summarise exactly
what \unset does. Thanks.
Trevor
_______________________________________________
lilypond-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-devel
--
=============================================
Mats Bengtsson
Signal Processing
Signals, Sensors and Systems
Royal Institute of Technology
SE-100 44 STOCKHOLM
Sweden
Phone: (+46) 8 790 8463 Fax: (+46) 8 790 7260
Email: address@hidden
WWW: http://www.s3.kth.se/~mabe
=============================================