lilypond-devel
[Top][All Lists]
Advanced

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

Re: Implement \hidden/\hide as a shorthands for \tweak/override #'\stenc


From: dak
Subject: Re: Implement \hidden/\hide as a shorthands for \tweak/override #'\stencil = ##f (issue 6443087)
Date: Thu, 13 Sep 2012 00:06:12 +0000

Reviewers: Graham Percival,

Message:
On 2012/09/12 23:20:46, Graham Percival wrote:
I'm really not happy with \hide vs. \hidden depending on whether it's
override
or tweak.  How do we expect novice users (or moderate users) to know
which they
need to use?

How do we expect them to know whether to use \override or \tweak?

I could offer using \hide for both uses like we do with \footnote, by
writing \default in lieu of a music event.  However,

\new Voice \with { \hide StringNumber \default } { ... }

leaves me quite unenthusiastic even though it uses a more functional
rather than grammatical distinction between override and tweak.

I copy your "not happy" sentiment, but when thinking this through, one
really wants to have both override and tweak under a reasonably
idiomatic shortcut available.  If we can only have one, I'd probably
take the override since it can be used in context modifications as well
and better matches existing \hide*.

Description:
Implement \hidden/\hide as a shorthands for \tweak/override #'\stencil =
##f

Please review this at http://codereview.appspot.com/6443087/

Affected files:
  M ly/music-functions-init.ly


Index: ly/music-functions-init.ly
diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly
index e1dcd992e00bf66c60fa7e09e012632732fc7db6..7098d4df8a16b276b957380367cb2dd0cad8b67c 100644
--- a/ly/music-functions-init.ly
+++ b/ly/music-functions-init.ly
@@ -475,6 +475,24 @@ given through @var{ratio}.")
     \revert NoteHead #'stencil
   #})

+hidden =
+#(define-music-function (parser location grob music)
+   ((string? *unspecified*) ly:music?)
+   (_i "Use a @code{\\tweak} to set the @samp{stencil} of the following
address@hidden's grobs to @code{#f}, for example if @var{music} should only
+be apparent in Midi output.
+An indirect @var{grob} can optionally be specified by name.")
+   #{ \tweak $grob #'stencil ##f #music #})
+
+hide =
+#(define-music-function (parser location grob)
+   (string?)
+   (_i "Use an @code{\\override} to set the @samp{stencil} of the named
address@hidden to @code{#f}, for example if it should only
+be apparent in Midi output.  You may precede this command with
address@hidden to let it only affect the current time step.")
+   #{ \override $grob #'stencil = ##f #})
+
 inStaffSegno =
 #(define-music-function (parser location) ()
    (_i "Put the segno variant 'varsegno' at this position into the staff,





reply via email to

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