2 scm-option.cc -- implement option setting from Scheme
4 source file of the GNU LilyPond music typesetter
6 (c) 2001--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
12 #include "lily-guile.hh"
13 #include "scm-option.hh"
17 This interface to option setting is meant for setting options are
18 useful to a limited audience. The reason for this interface is that
19 making command line options clutters up the command-line option name
23 preferably, also dont use TESTING_LEVEL_GLOBAL, since it defeats
24 another purpose of this very versatile interface, which is to
25 support multiple debug/testing options concurrently.
30 /* Write midi as formatted ascii stream? */
31 bool midi_debug_global_b;
33 /* General purpose testing flag */
34 int testing_level_global;
37 crash if internally the wrong type is used for a grob property.
39 bool internal_type_checking_global_b;
43 @item -T,--no-timestamps
44 don't timestamp the output
47 Switch on any experimental features. Not for general public use. */
49 LY_DEFINE(set_lily_option,"set-lily-option", 2, 0, 0, (SCM var, SCM val),
50 "Set a global option for the program. Supported options include
57 If set to true, generate human readable MIDI
58 @item internal-type-checking
59 Set paranoia for property assignments
62 This function is useful to call from the command line: @code{lilypond -e
63 \"(set-lily-option 'midi-debug #t)\"}.
66 /* Scheme option usage:
67 lilypond -e "(set-lily-option 'help 0)" */
68 if (var == ly_symbol2scm ("help"))
70 printf ( _("lilypond -e EXPR means
72 evalute EXPR as Scheme after init.scm has been read. In particular,
73 the function set-lily-option allows for access to some internal
76 (set-lily-option SYMBOL VAL)
78 possible options for SYMBOL are :
80 printf ( " help (any-symbol)\n"
81 " internal-type-checking (boolean)\n"
82 " midi-debug (boolean)\n"
83 " testing-level (int)\n");
87 else if (var == ly_symbol2scm ("midi-debug"))
89 midi_debug_global_b = to_boolean (val);
91 else if (var == ly_symbol2scm ("testing-level"))
93 testing_level_global = gh_scm2int (val);
95 else if (var == ly_symbol2scm ("internal-type-checking"))
97 internal_type_checking_global_b = to_boolean (val);
99 else if (var == ly_symbol2scm ("find-old-relative"))
102 Seems to have been broken for some time!
104 @item -Q,--find-old-relative
105 show all changes needed to convert a file to relative octave syntax.
115 warning (_("Unknown internal option!"));
119 return SCM_UNSPECIFIED;