Werner LEMBERG wrote:
Are you saying that the trick used in \verb is bad or just that we should never mention the example below in any documentation or that we should use the \verb trick but handle pairing characters specially?
The last one. All editors will benefit.
Agreed! Unfortunately, the implementors will suffer. A direct implementation of the \verb trick is a one line change (see the attachment), whereas your suggestion is much harder to implement without major surgery to the current lilypond-book implementation.
I won't submit the patch to CVS until I get some approval (of course, the documentation should be updated as well).
On second thought, I'm not convinced that it helps the users to add special cases to the simple general rule of delimiters.
/Mats
--- scripts/lilypond-book.py.orig 2004-10-12 17:25:03.000000000 +0200
+++ scripts/lilypond-book.py 2004-10-12 17:27:10.000000000 +0200
@@ -163,7 +163,7 @@
LATEX: {
'include': r'(?m)^[^%\n]*?(?P<match>\\input{(?P<filename>[^}]+)})',
- 'lilypond' :
r'(?m)^[^%\n]*?(?P<match>\\lilypond\s*(\[(?P<options>.*?)\])?\s*{(?P<code>.*?)})',
+ 'lilypond' :
r'(?m)^[^%\n]*?(?P<match>\\lilypond\s*(\[(?P<options>.*?)\])?\s*(?P<delim>.)(?P<code>.*?)(?P=delim))',
'lilypond_block':
r"(?sm)^[^%\n]*?(?P<match>\\begin\s*(\[(?P<options>.*?)\])?\s*{lilypond}(?P<code>.*?)\\end{lilypond})",
'lilypond_file':
r'(?m)^[^%\n]*?(?P<match>\\lilypondfile\s*(\[(?P<options>.*?)\])?\s*\{(?P<filename>.+)})',
'multiline_comment': no_match,
@@ -174,7 +174,7 @@
TEXINFO: {
'include': '(?m)^[^%\n]*?(?P<match>@include\s+(?P<filename>\S+))',
- 'lilypond' :
'(?m)^(?P<match>@lilypond(\[(?P<options>[^]]*)\])?{(?P<code>.*?)})',
+ 'lilypond' :
'(?m)^(?P<match>@lilypond(\[(?P<options>[^]]*)\])?(?P<delim>.)(?P<code>.*?)(?P=delim))',
'lilypond_block':
r'''(?ms)^(?P<match>@lilypond(\[(?P<options>[^]]*)\])?\s(?P<code>.*?)@end
lilypond)\s''',
'lilypond_file':
'(?m)^(?P<match>@lilypondfile(\[(?P<options>[^]]*)\])?{(?P<filename>[^}]+)})',
'multiline_comment': r'(?sm)^\s*([EMAIL PROTECTED])(?P<code>@[EMAIL
PROTECTED])\s',
_______________________________________________ bug-lilypond mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/bug-lilypond
