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

Issue 4810042: Fix 153: \once\set properly restores the context property (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 9 months ago by Reinhold
Modified:
12 years, 9 months ago
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Fix 153: \once\set properly restores the context property \once\set works by installing a finalization hook in the iterator. To restore the context property value before the \once\set, we simply cache the old value and pass it to the finalization hook as third argument. The finalizatino hook then sends a SetProperty event with the old value rather than an UnsetProperty event, which reverts the value to the default.

Patch Set 1 #

Patch Set 2 : Add regtest to show that subsequent and double \once\set calls work properly, too #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -19 lines) Patch
A input/regression/set-once.ly View 1 1 chunk +29 lines, -0 lines 8 comments Download
M lily/include/property-iterator.hh View 1 chunk +1 line, -1 line 0 comments Download
M lily/property-iterator.cc View 2 chunks +26 lines, -18 lines 4 comments Download

Messages

Total messages: 9
Trevor Daniels
LGTM, but I'd prefer longer names for o, m and tg (especially tg!). Trevor
12 years, 9 months ago (2011-07-21 07:09:18 UTC) #1
joeneeman
If you do \set #'foo = #1 c \once \set #'foo = #2 c \once ...
12 years, 9 months ago (2011-07-21 16:15:41 UTC) #2
Neil Puttock
On 2011/07/21 16:15:41, joeneeman wrote: > If you do > > \set #'foo = #1 ...
12 years, 9 months ago (2011-07-21 17:06:57 UTC) #3
Reinhold
On 2011/07/21 16:15:41, joeneeman wrote: > If you do > > \set #'foo = #1 ...
12 years, 9 months ago (2011-07-21 17:10:58 UTC) #4
Neil Puttock
LGTM. http://codereview.appspot.com/4810042/diff/4001/input/regression/set-once.ly File input/regression/set-once.ly (right): http://codereview.appspot.com/4810042/diff/4001/input/regression/set-once.ly#newcode1 input/regression/set-once.ly:1: \version "2.15.5" 2.15.6 http://codereview.appspot.com/4810042/diff/4001/input/regression/set-once.ly#newcode5 input/regression/set-once.ly:5: texidoc = "@code{\once\set} ...
12 years, 9 months ago (2011-07-21 17:34:07 UTC) #5
Reinhold
Will also correct those spacing issues pointed out by Neil before I'll push. http://codereview.appspot.com/4810042/diff/4001/input/regression/set-once.ly File ...
12 years, 9 months ago (2011-07-21 18:25:35 UTC) #6
pkx166h
pass make and reg tests. James
12 years, 9 months ago (2011-07-22 20:56:42 UTC) #7
Neil Puttock
http://codereview.appspot.com/4810042/diff/4001/input/regression/set-once.ly File input/regression/set-once.ly (right): http://codereview.appspot.com/4810042/diff/4001/input/regression/set-once.ly#newcode6 input/regression/set-once.ly:6: to the previous value rather than the default." On ...
12 years, 9 months ago (2011-07-23 20:48:20 UTC) #8
Reinhold
12 years, 9 months ago (2011-07-28 12:26:58 UTC) #9
On 2011/07/23 20:48:20, Neil Puttock wrote:
> On 2011/07/21 18:25:35, Reinhold wrote:
> > Yes, I'll reformulate it. How about 
> > "@code{\once \set} should change a context property value for just one
> timestep
> > and then return to the previous value, rather than resetting the property to
> its
> > global default value."
> 
> Hmm, I still think `the previous value' is ambiguous; if there's no explicit
> setting, but a global default does exist, then the value will return to the
> global setting.


I have now changed it to "... and then return to the previous value.". Noone
would expect \once \set to return to the default value, so it doesn't make much
sense to refer to the current buggy situation at all.

I have committed and pushed this as commit
d1db9b1d6ebb1014429974f22162b44bf9a03533
Sign in to reply to this message.

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