On 1 February 2010 06:36, Patrick McCarty <pnor...@gmail.com> wrote:

> Sorry, here's a real patch (in case this is the correct fix).

Heh, that's the exact opposite of John's intention, I believe. :)

Any item which has a match in PROCESSING_INDEPENDENT_OPTIONS is
supposed to be removed.  Unfortunately, the double loop ends up
removing one match while duplicating seven others (hence why some
options show eight copies, whereas others have seven).

I attach my first successful attempt at a fix (complete with silly
debug output and badly placed function def ;) below; surely there's a
simpler method than using filter ()?

BTW, this duplication happens again when the hash is updated, so the
following lines would also need correcting:

1286             for option in self.get_option_list ():
1287                 for name in PROCESSING_INDEPENDENT_OPTIONS:
1288                     if not option.startswith (name):
1289                         hash.update (option)

Cheers,
Neil
From 3f29f260a05e3fc3b0f16a1bf1495b90ac032026 Mon Sep 17 00:00:00 2001
From: Neil Puttock <n.putt...@gmail.com>
Date: Mon, 1 Feb 2010 00:25:42 +0000
Subject: [PATCH] Fix lilypond-book option glitch

---
 scripts/lilypond-book.py |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py
index ac3969c..632b723 100644
--- a/scripts/lilypond-book.py
+++ b/scripts/lilypond-book.py
@@ -1202,13 +1202,20 @@ left-margin-default right-margin-default)"
         override[LINE_WIDTH] = texinfo_line_widths['@smallbook']
         override.update (default_ly_options)
 
+        def not_processing_independent (opt):
+            for name in PROCESSING_INDEPENDENT_OPTIONS:
+                if opt.startswith (name):
+                    return False
+
+            return True
+
         option_list = []
         for option in self.get_option_list ():
-            for name in PROCESSING_INDEPENDENT_OPTIONS:
-                if not option.startswith (name):
-                    option_list.append (option)
+            option_list.append (option)
+        warning ("option_string before: %s" % option_list)  
+        option_list = filter (not_processing_independent, option_list)
         option_string = ','.join (option_list)
-
+        warning ("option_string: %s" % option_string)
         compose_dict = {}
         compose_types = [NOTES, PREAMBLE, LAYOUT, PAPER]
         for a in compose_types:
-- 
1.6.3.3

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to