]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 23 Mar 2008 17:50:15 +0000 (14:50 -0300)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 23 Mar 2008 17:50:15 +0000 (14:50 -0300)
Conflicts:

Documentation/user/pitches.itely
scripts/lilypond-book.py

1  2 
scripts/lilypond-book.py

index b6a8fe236c5cec73f98f1adf642ecaabd1c8d3e3,d4af98cf65f975e616e2cb0aec988b56e9a4adc5..6747a055e29df3f330ab564ad4571a72cc738505
@@@ -807,14 -804,34 +809,20 @@@ def verbatim_html (s)
             re.sub ('<', '&lt;',
                 re.sub ('&', '&amp;', s)))
  
 -def split_options (option_string):
 -    if option_string:
 -        if global_options.format == HTML:
 -            options = re.findall('[\w\.-:]+(?:\s*=\s*(?:"[^"]*"|\'[^\']*\'|\S+))?',option_string)
 -            for i in range(len(options)):
 -                options[i] = re.sub('^([^=]+=\s*)(?P<q>["\'])(.*)(?P=q)','\g<1>\g<3>',options[i])
 -            return options
 -        else:
 -            return re.split (format_res[global_options.format]['option_sep'],
 -                    option_string)
 -    return []
  
 -
 -def set_default_options (source):
 -    global default_ly_options
 -    if not default_ly_options.has_key (LINE_WIDTH):
 -        if global_options.format == LATEX:
+ texinfo_lang_re = re.compile ('(?m)^@documentlanguage (.*?)( |$)')
 +def set_default_options (source, default_ly_options, format):
 +    if LINE_WIDTH not in default_ly_options:
 +        if format == LATEX:
              textwidth = get_latex_textwidth (source)
 -            default_ly_options[LINE_WIDTH] = \
 -             '''%.0f\\pt''' % textwidth
 -        elif global_options.format == TEXINFO:
 +            default_ly_options[LINE_WIDTH] = '%.0f\\pt' % textwidth
 +        elif format == TEXINFO:
+             m = texinfo_lang_re.search (source)
+             if m and not m.group (1).startswith ('en'):
+                 default_ly_options[LANG] = m.group (1)
+             else:
+                 default_ly_options[LANG] = ''
 -            for (k, v) in texinfo_line_widths.items ():
 +            for regex in texinfo_line_widths:
                  # FIXME: @layout is usually not in
                  # chunk #0:
                  #
@@@ -1792,13 -1768,12 +1803,13 @@@ def do_file (input_filename)
              progress ('\n')
              return do_file (name)
  
 -        include_chunks = [process_include (c) for c in chunks
 -                          if is_derived_class (c.__class__, Include_snippet)]
 +        include_chunks = map (process_include,
-                    filter (lambda x: isinstance (x, IncludeSnippet),
-                        chunks))
++                              filter (lambda x: isinstance (x, IncludeSnippet),
++                                      chunks))
  
 -        return chunks + reduce (operator.add, include_chunks, [])
 +        return chunks + reduce (lambda x, y: x + y, include_chunks, [])
          
 -    except Compile_error:
 +    except CompileError:
          os.chdir (original_dir)
          progress (_ ("Removing `%s'") % output_filename)
          progress ('\n')