+def invokes_lilypond ():
+ return re.search ('^[\'\"0-9A-Za-z/]*lilypond', process_cmd)
+
+def set_default_options (source):
+ global default_ly_options
+ if not default_ly_options.has_key (LINEWIDTH):
+ if format == LATEX:
+ textwidth = get_latex_textwidth (source)
+ default_ly_options[LINEWIDTH] = \
+ '''%.0f\\pt''' % textwidth
+ elif format == TEXINFO:
+ for (k, v) in texinfo_linewidths.items ():
+ # FIXME: @layout is usually not in
+ # chunk #0:
+ #
+ # \input texinfo @c -*-texinfo-*-
+ #
+ # Bluntly search first K items of
+ # source.
+ # s = chunks[0].replacement_text ()
+ if re.search (k, source[:1024]):
+ default_ly_options[LINEWIDTH] = v
+ break
+