Hi,

I have added a --debug switch to lilypond-book, which makes the output more 
readable, and I changed the default behaviour to preserve the line numbers 
in .tex files.

However, lilypond-book is very broken at the moment, so I haven't been able to 
test it. I will commit the fix as soon as lilypond-book works again.

-- 
Erik
--- lilypond-book.py	2006-03-05 16:53:14.000000000 +0100
+++ lilypond-book.py.new	2006-03-05 16:57:27.000000000 +0100
@@ -136,7 +136,11 @@
 	p = ly.get_option_parser (usage='lilypond-book [OPTIONS] FILE',
 				  version="@TOPLEVEL_VERSION@",
 				  description=help_summary)
-
+	p.add_option ('', '--debug', 
+		      action="store_true",
+		      dest="debug",
+		      default=False,
+		      help=_ ("Increase readability of output files"))
 	p.add_option ('-F', '--filter', metavar=_ ("FILTER"),
 		      action="store",
 		      dest="filter_cmd",
@@ -1154,14 +1158,12 @@
 			if VERBATIM in self.option_dict:
 				verb = self.substring ('code')
 				str += (output[LATEX][VERBATIM] % vars ())
-		
+			elif not global_options.debug:
+				# maintain line breaks
+				breaks = self.ly ().count ("\n")
+				str += "".ljust (breaks, "\n").replace ("\n","%\n")
 		str += (output[LATEX][OUTPUT] % vars ())
 
-		## todo: maintain breaks
-		if 0:
-			breaks = self.ly ().count ("\n")
-			str += "".ljust (breaks, "\n").replace ("\n","%\n")
-		
 		if QUOTE in self.option_dict:
 			str = output[LATEX][QUOTE] % vars ()
 		return str
@@ -1687,6 +1689,13 @@
 	if not global_options.format:
 		global_options.format = guess_format (files[0])
 
+	if not global_options.debug:
+		global output
+		for s in (QUOTE, VERBATIM):
+			output[HTML][s] = output[f][s].replace("\n"," ")
+		for s in (OUTPUT, QUOTE, VERBATIM):
+			output[LATEX][s] = output[LATEX][s].replace("\n"," ")
+
 	formats = 'ps'
 	if global_options.format in (TEXINFO, HTML):
 		formats += ',png'
_______________________________________________
lilypond-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to