lilypond-devel
[Top][All Lists]
Advanced

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

Re: Implement -dtags-to-keep and -dtags-to-remove commandline options (i


From: dak
Subject: Re: Implement -dtags-to-keep and -dtags-to-remove commandline options (issue 149650043 by address@hidden)
Date: Thu, 09 Oct 2014 06:58:06 +0000

Reviewers: marc,

Message:
On 2014/10/09 06:36:16, marc wrote:

https://codereview.appspot.com/149650043/diff/1/Documentation/usage/running.itely
File Documentation/usage/running.itely (right):


https://codereview.appspot.com/149650043/diff/1/Documentation/usage/running.itely#newcode680
Documentation/usage/running.itely:680: @item @code{tags-to-keep}
What do you think about
@code{keep-with-tag} and @code{remove-with-tag}
to match the corresponding @code{\keepWithTag} and
@code{\removeWithTag}
LilyPond commands?

Giving similar functions different names would at least confuse myself
as a user
;-)

The reason I picked those names was basically that the list of options
for

lilypond -dhelp

and in the Usage Reference is alphabetically sorted and I had to pick
between separating the options, abandoning the sorting order, or letting
them start in a similar way.  So I thought this would likely be the
lesser evil, but of course that is entirely subjective and if we get
enough feedback to be even closely similar to a vote or statistical
relevance, I'll be happy to change the choice.

Description:
Implement -dtags-to-keep and -dtags-to-remove commandline options

Please review this at https://codereview.appspot.com/149650043/

Affected files (+26, -0 lines):
  M Documentation/usage/running.itely
  M scm/lily.scm
  M scm/music-functions.scm


Index: Documentation/usage/running.itely
diff --git a/Documentation/usage/running.itely b/Documentation/usage/running.itely index 0bff8f68df9636786d7eed1e0fdf43b83b8e4ea2..2979f66088198811ad01211f9c9d396c8310dfca 100644
--- a/Documentation/usage/running.itely
+++ b/Documentation/usage/running.itely
@@ -677,6 +677,16 @@ size increases in PDF files.
 @tab @code{#f}
 @tab Use woff font files in SVG backend.

address@hidden @code{tags-to-keep}
address@hidden @code{#f}
address@hidden Run @code{\keepWithTag} with the given list of tags on the
+music in every @code{\score}, see @ruser{Using Tags}.
+
address@hidden @code{tags-to-remove}
address@hidden @code{#f}
address@hidden Run @code{\removeWithTag} with the given list of tags on the
+music in every @code{\score}, see @ruser{Using Tags}.
+
 @item @code{trace-memory-frequency}
 @tab @code{#f}
 @tab Record Scheme cell usage this many times per second.  Dump the
Index: scm/lily.scm
diff --git a/scm/lily.scm b/scm/lily.scm
index 3ba26bc6dc6eece709b3714ec9e300a41311f46b..11dd0386b1cf0ad9c84ceb8fd168415aec7cd0c2 100644
--- a/scm/lily.scm
+++ b/scm/lily.scm
@@ -339,6 +339,12 @@ PDF previews.")
     (svg-woff
      #f
      "Use woff font files in SVG backend.")
+    (tags-to-keep
+     #f
+     "List of tags to keep.")
+    (tags-to-remove
+     #f
+     "List of tags to remove.")
     (trace-memory-frequency
      #f
      "Record Scheme cell usage this many times per
Index: scm/music-functions.scm
diff --git a/scm/music-functions.scm b/scm/music-functions.scm
index aad473c7f0cf126684c6e5a893fbdc39dea04b18..3b289ea57e907daaaed43b179c8c18d631fa846e 100644
--- a/scm/music-functions.scm
+++ b/scm/music-functions.scm
@@ -1347,6 +1347,16 @@ then revert skipTypesetting."

 (define-session-public toplevel-music-functions
   (list
+   (lambda (music parser)
+     (let ((tags (ly:get-option 'tags-to-keep)))
+       (if (symbol-list-or-symbol? tags)
+           (music-filter (tags-keep-predicate tags) music)
+           music)))
+   (lambda (music parser)
+     (let ((tags (ly:get-option 'tags-to-remove)))
+       (if (symbol-list-or-symbol? tags)
+           (music-filter (tags-remove-predicate tags) music)
+           music)))
    (lambda (music parser) (expand-repeat-chords!
                            (cons 'rhythmic-event
(ly:parser-lookup parser '$chord-repeat-events))





reply via email to

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