|
|
Created:
12 years, 6 months ago by dak Modified:
12 years, 6 months ago CC:
lilypond-devel_gnu.org Base URL:
http://git.savannah.gnu.org/gitweb/?p=lilypond.git/trunk/ Visibility:
Public. |
Description\undo\hideNotes is equivalent to \unHideNotes, \undo\easyHeadsOn to
\easyHeadsOff. While this can't undo reverts, it is useful for a lot
of overriding commands defined in ly/property-init.ly, and is also
useful in combination with \hide/\omit.
Patch Set 1 #Patch Set 2 : Change \un to \undo #MessagesTotal messages: 13
please provide usage example(s). I suppose i like this idea, but without examples i don't know what exactly will be possible, and what won't be possible. thanks, Janek
Sign in to reply to this message.
On 2012/10/05 14:46:09, janek wrote: > please provide usage example(s). I suppose i like this idea, but without > examples i don't know what exactly will be possible, and what won't be possible. Is it enough to say that after unHideNotes = \un\hideNotes oneVoice = \un\voiceOne you would not notice a difference? \un\omit StringNumber will revert the effect of \omit StringNumber.
Sign in to reply to this message.
I think I would prefer to name this function \undo. This more accurately expresses what it does: \undo\voiceOne reverses everything that \voiceOne does, or did. The action of \un\voiceOne is not so intuitively obvious, nor does it make an English work or phrase. \reverse would be an alternative, but its length reduces its attraction. Trevor
Sign in to reply to this message.
Le 6 oct. 2012 à 09:10, dak@gnu.org a écrit : > Reviewers: janek, > > Message: > On 2012/10/05 14:46:09, janek wrote: >> please provide usage example(s). I suppose i like this idea, but > without >> examples i don't know what exactly will be possible, and what won't be > possible. > > Is it enough to say that after > > unHideNotes = \un\hideNotes > oneVoice = \un\voiceOne > > you would not notice a difference? \un\omit StringNumber will revert the > effect of \omit StringNumber. Very nice, thanks.
Sign in to reply to this message.
On 2012/10/06 07:44:51, Trevor Daniels wrote: > I think I would prefer to name this function \undo. > This more accurately expresses what it does: > \undo\voiceOne reverses everything that \voiceOne > does, or did. The action of \un\voiceOne is not > so intuitively obvious, nor does it make an English > work or phrase. > > \reverse would be an alternative, but its length > reduces its attraction. "reverse" is already taken as a Scheme operator. Digging through the thesaurus, other viable options would be "cancel" or "revoke". One main design target of \un is to block bikeshedding by providing a way of undoing a simple or complex override in a manner that is sufficiently concise and straightforward to make it not worth the effort to think up an individual name for the reversal operation. \un\omit is similar to "I see you omitted to mention my participation in this draft. Let me un-omit this.", namely the use of a dashed artificial un-word for the sake of expressing a literal reversal. It also matches \hideNotes/\unHideNotes in character, but looking through ly/property-init.ly, it would appear that most pairings are of the xxxOn/xxxOff form anyway, or even completely different like \voiceNeutralStyle, \tupletNeutral, \tieSolid, \defaultTimeSignature, \arpeggioNormal. Good grief. The principal aim is to make the use of \un/\undo\whatever a no-brainer, not have people start thinking about shorter alternatives. \undo might work well enough, I don't know. Maybe one should survey people. If you take a look at <URL:http://code.google.com/p/lilypond/issues/detail?id=2002> and the following discussions, you'll see that I made \once work for a lot of things it did not work before just to be able to avoid the want or need for additional commands like \hideNote that would make it harder for users to guess the behavior of a LilyPond-provided command. And you'll see that Adam was less than convinced that \once\hideNotes was tolerably short. \undo certainly seems nicer for things like \undo\xxxOn in contrast to \un\xxxOn. Are there other opinions/votes/leanings?
Sign in to reply to this message.
On Sat, Oct 6, 2012 at 9:10 AM, <dak@gnu.org> wrote: > Is it enough to say that after > > unHideNotes = \un\hideNotes > oneVoice = \un\voiceOne > > you would not notice a difference? \un\omit StringNumber will revert the > effect of \omit StringNumber. That's what i expected. Are there any limitations? For example, would \un\clef and \un\key result in - reverting to previous clef/key - something strange - syntax error ? On Sat, Oct 6, 2012 at 9:44 AM, <tdanielsmusic@googlemail.com> wrote: > I think I would prefer to name this function \undo. +1, feels more natural to me also. thanks, Janek
Sign in to reply to this message.
Janek Warchoł <janek.lilypond@gmail.com> writes: > On Sat, Oct 6, 2012 at 9:10 AM, <dak@gnu.org> wrote: >> Is it enough to say that after >> >> unHideNotes = \un\hideNotes >> oneVoice = \un\voiceOne >> >> you would not notice a difference? \un\omit StringNumber will revert the >> effect of \omit StringNumber. > > That's what i expected. Are there any limitations? For example, > would \un\clef and \un\key result in > - reverting to previous clef/key > - something strange > - syntax error Something strange is most likely. \set does not really maintain a stack, so \unset just kills the context-dependent value. \un\clef would likely return to the violin clef, \un\key to c\major, regardless of what has happened before. This is just a wild guess. \un\key would not actually trigger a key display (since \key is not pure override), but likely accidentals would afterwards behave like c\major. That's all just guessing, I haven't tried any of that out actually. -- David Kastrup
Sign in to reply to this message.
On Sat, Oct 6, 2012 at 10:50 AM, David Kastrup <dak@gnu.org> wrote: > >> Are there any limitations? For example, >> would \un\clef and \un\key result in >> - reverting to previous clef/key >> - something strange >> - syntax error > > Something strange is most likely. \set does not really maintain a > stack, so \unset just kills the context-dependent value. Something strange happened, indeed. This: { \key a \major \clef F cis dis c e \un\key a\major \un\clef F cis fis c e } produced a treble clef glyph (but it didn't affect notnotese positions) and accidentals that were still in a major. Also, i couldn't just write \un\key nor \un\clef. I think it would be good to polish this, so that this either works or always produces syntax error. cheers, Janek
Sign in to reply to this message.
Janek Warchoł <janek.lilypond@gmail.com> writes: > On Sat, Oct 6, 2012 at 10:50 AM, David Kastrup <dak@gnu.org> wrote: >> >>> Are there any limitations? For example, >>> would \un\clef and \un\key result in >>> - reverting to previous clef/key >>> - something strange >>> - syntax error >> >> Something strange is most likely. \set does not really maintain a >> stack, so \unset just kills the context-dependent value. > > Something strange happened, indeed. This: > { > \key a \major \clef F > cis dis c e > \un\key a\major \un\clef F > cis fis c e > } > produced a treble clef glyph (but it didn't affect notnotese > positions) and accidentals that were still in a major. > Also, i couldn't just write \un\key nor \un\clef. Huh? \key is not a music expression on its own, neither is \clef. > I think it would be good to polish this, so that this either works or > always produces syntax error. If we produce an error for music harvested for overrides that have more effects than just the override, something like \midi { \tempo 4 = 60 } would have to be prohibited as well since it silently drops markup. You'll have similar problems using \once on commands like that. Figuring out heuristics when or when one should not issue a warning is not all that easy to decide with a reasonable amount of consistency, and this is not a problem particular to \undo. -- David Kastrup
Sign in to reply to this message.
On Sat, Oct 6, 2012 at 11:15 AM, David Kastrup <dak@gnu.org> wrote: > Janek Warchoł <janek.lilypond@gmail.com> writes: >> I think it would be good to polish this, so that this either works or >> always produces syntax error. > > Figuring out heuristics when or when one should not issue a warning is > not all that easy to decide with a reasonable amount of consistency, and > this is not a problem particular to \undo. ok.
Sign in to reply to this message.
On 2012/10/06 07:44:51, Trevor Daniels wrote: > I think I would prefer to name this function \undo. > This more accurately expresses what it does: > \undo\voiceOne reverses everything that \voiceOne > does, or did. The action of \un\voiceOne is not > so intuitively obvious, nor does it make an English > work or phrase. Should be "word", not "work", of course. My fingers seem to get more dyslexic every day :( Trevor
Sign in to reply to this message.
Janek Warchoł <janek.lilypond@gmail.com> writes: > On Sat, Oct 6, 2012 at 11:15 AM, David Kastrup <dak@gnu.org> wrote: >> Janek Warchoł <janek.lilypond@gmail.com> writes: >>> I think it would be good to polish this, so that this either works or >>> always produces syntax error. >> >> Figuring out heuristics when or when one should not issue a warning is >> not all that easy to decide with a reasonable amount of consistency, and >> this is not a problem particular to \undo. > > ok. Not that this would not be useful. It's just that it's a lot of detail work and finetuning without providing any new functionality. To get a warning, you need to actually _run_ the source file, and in most cases that means that proofreading would equally well tell you what you want to know. So the return for the one-time investment in programming is rather small. I won't object if anybody wants to work on this, but at the current point of time I myself have stuff I consider more important. -- David Kastrup
Sign in to reply to this message.
|