2002-09-05 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ * scripts/lilypond-book.py (output_verbatim): python 2.2 workaround.
+
+ * scm/documentation-lib.scm (scm->string): print procedure name in
+ stead of #<procedure .. >
+
+ * scripts/ly2dvi.py (run_lilypond): exit with error if lily exited
+ any file with an error.
+
* input/regression/molecule-hacking.ly: also restore Y
extent. Fixes bugs with stem attachment of parenthesized note
heads.
# strange shell, this C
set datadir="@local_lilypond_datadir@"
- if ( $?GS_LIB ) then
- setenv GS_LIB "$datadir/ps:$GS_LIB"
- else
- setenv GS_LIB "$datadir/ps"
- endif
-
-
# setenv LILYPONDPREFIX "$datadir"
-
# bit silly. for ly2dvi, overrules compiled-in datadir...
# setenv LILYPONDPREFIX "@local_lilypond_datadir@"
setenv TEXMF "{$datadir,"`kpsexpand \$TEXMF`"}"
unset noglob
+
+
+# if ( $?GS_LIB ) then
+# setenv GS_LIB "$datadir/ps:$GS_LIB"
+# else
+# setenv GS_LIB "$datadir/ps"
+# endif
+
+
+
# Add all available TeX Type1 fonts (including Feta) to Ghostscript:
-if ( $?GS_FONTPATH ) then
- setenv GS_FONTPATH `kpsewhich -expand-path=\$T1FONTS`:$GS_FONTPATH
-else
- setenv GS_FONTPATH `kpsewhich -expand-path=\$T1FONTS`
-endif
+#if ( $?GS_FONTPATH ) then
+# setenv GS_FONTPATH `kpsewhich -expand-path=\$T1FONTS`:$GS_FONTPATH
+#else
+# setenv GS_FONTPATH `kpsewhich -expand-path=\$T1FONTS`
+#endif
export TEXMF
# For direct ps output: ps/lilyponddefs.ps
-GS_LIB="$datadir/ps:"${GS_LIB:=""}
-export GS_LIB
+## GS_LIB="$datadir/ps:"${GS_LIB:=""}
+## export GS_LIB
# For direct ps output fonts. Add all available TeX Type1 fonts
-GS_FONTPATH=`kpsewhich -expand-path=\\$T1FONTS`:${GS_FONTPATH:=""}
-export GS_FONTPATH
+## GS_FONTPATH=`kpsewhich -expand-path=\\$T1FONTS`:${GS_FONTPATH:=""}
+## export GS_FONTPATH
parens are also not seen by accidentals.
"
- }
+}
#(define (parenthesize-callback callback)
"Construct a function that will do CALLBACK and add parentheses.
the first and last (quarter) note bothe get one tremolo flag.
*/
int requested_type = gh_scm2int (tremolo_req_->get_mus_property ("tremolo-type"));
- if (requested_type <= 8)
- {
- tremolo_req_->origin()->warning (_("tremolo duration is too long"));
- requested_type = 0;
- }
SCM f = get_property ("tremoloFlags");
if (!requested_type && gh_number_p (f))
requested_type = gh_scm2int (f);
else
daddy_trans_->set_property ("tremoloFlags", gh_int2scm (requested_type));
- if (requested_type)
+ int tremolo_flags = intlog2 (requested_type) - 2
+ - (duration_log > 2 ? duration_log - 2 : 0);
+ if (tremolo_flags <= 0)
+ {
+ tremolo_req_->origin()->warning (_("tremolo duration is too long"));
+ tremolo_flags = 0;
+ }
+
+ if (tremolo_flags)
{
tremolo_ = new Item (get_property ("StemTremolo"));
announce_grob(tremolo_, tremolo_req_->self_scm());
the tremolo-type minus the number of flags of the note
itself.
*/
- int tremolo_flags = intlog2 (requested_type) - 2
- - (duration_log > 2 ? duration_log - 2 : 0);
- if (tremolo_flags < 0)
- tremolo_flags = 0;
- tremolo_->set_grob_property ("flag-count",
+ tremolo_->set_grob_property ("flag-count",
gh_int2scm (tremolo_flags));
tremolo_->set_parent (stem_, X_AXIS);
}
(string-append "@code{" (texify (scm->string x)) "}")
)
+
+;;
+;; don't confuse users with #<procedure .. > syntax.
+;;
(define (scm->string val)
- (string-append
- (if (self-evaluating? val) "" "'")
- (call-with-output-string (lambda (port) (display val port)))
- ))
+ (if (procedure? val)
+ (symbol->string (procedure-name val))
+ (string-append
+ (if (self-evaluating? val) "" "'")
+ (call-with-output-string (lambda (port) (display val port)))
+ )))
(define (node name)
(string-append
body = re.sub ('>', '>', body)
body = re.sub ('<', '<', body)
elif __main__.format == 'texi':
- body = re.sub ('([@{}])', '@\\1', body)
+
+ # clumsy workaround for python 2.2 pre bug.
+ body = re.sub ('@', '@@', body)
+ body = re.sub ('{', '@{', body)
+ body = re.sub ('}', '@}', body)
if small:
key = 'output-small-verbatim'
sys.exit (e)
def error (s):
- '''Report the error S. Exit by raising an exception. Please
- do not abuse by trying to catch this error. If you do not want
- a stack trace, write to the output directly.
+ '''Report the error S.
+
+ If verbose is set, exit by raising an exception. Otherwise,
+ simply sys.exit().
+
+ Please do not abuse by trying to catch this error. If you do
+ not want a stack trace, write to the output directly.
RETURN VALUE
'''
progress (_ ("error: ") + s)
- raise _ ("Exiting ... ")
+ if verbose_p:
+ raise _ ("Exiting ... ")
+ else:
+ sys.exit (2)
def getopt_args (opts):
'''Construct arguments (LONG, SHORT) for getopt from list of options.'''
keep_temp_dir_p = 0
verbose_p = 0
preview_p = 0
+lilypond_error_p = 0
preview_resolution = 90
pseudo_filter_p = 0
latex_cmd = 'latex'
sys.stderr.write ( "\n" \
+ _ ("LilyPond failed on an input file (exit status %d).") % exit_status + "\n")
sys.stderr.write (_("Trying to salvage the rest.") +'\n\n')
-
+
+ global lilypond_error_p
+ lilypond_error_p = 1
def analyse_lilypond_output (filename, extra):
os.chdir (original_dir)
cleanup_temp ()
-
+
+ sys.exit (lilypond_error_p)
else:
help ()
user_error (_ ("no files specified on command line"), 2)