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>
13 #include "lily-guile.hh"
14 #include "scm-option.hh"
18 This interface to option setting is meant for setting options are
19 useful to a limited audience. The reason for this interface is that
20 making command line options clutters up the command-line option name
24 preferably, also dont use TESTING_LEVEL_GLOBAL, since it defeats
25 another purpose of this very versatile interface, which is to
26 support multiple debug/testing options concurrently.
31 /* Write midi as formatted ascii stream? */
32 bool midi_debug_global_b;
34 /* General purpose testing flag */
35 int testing_level_global;
38 crash if internally the wrong type is used for a grob property.
40 bool internal_type_checking_global_b;
46 @item -T,--no-timestamps
47 don't timestamp the output
50 Switch on any experimental features. Not for general public use.
54 LY_DEFINE(set_lily_option,"set-lily-option", 2, 0, 0, (SCM var, SCM val),
55 "Set a global option for the program. Supported options include
62 If set to true, generate human readable MIDI
65 This function is useful to call from the command line: @code{lilypond -e
66 \"(set-lily-option 'midi-debug #t)\"}.
71 lilypond -e "(set-lily-option 'help 0)"
73 if (var == ly_symbol2scm ("help"))
75 cout << _("lilypond -e EXPR means
77 evalute EXPR as Scheme after init.scm has been read. In particular,
78 the function set-lily-option allows for access to some internal
81 (set-lily-option SYMBOL VAL)
83 possible options for SYMBOL are :
86 cout << " help (any-symbol)"<<endl;
87 cout << " internal-type-checking (boolean)"<<endl;
88 cout << " midi-debug (boolean)"<<endl;
89 cout << " testing-level (int)"<<endl;
93 else if (var == ly_symbol2scm ("midi-debug"))
95 midi_debug_global_b = to_boolean (val);
97 else if (var == ly_symbol2scm ("testing-level"))
99 testing_level_global = gh_scm2int (val);
101 else if (var == ly_symbol2scm ("internal-type-checking"))
103 internal_type_checking_global_b = to_boolean (val);
105 else if (var == ly_symbol2scm ("find-old-relative"))
108 Seems to have been broken for some time!
110 @item -Q,--find-old-relative
111 show all changes needed to convert a file to relative octave syntax.
121 warning (_("Unknown internal option!"));
125 return SCM_UNSPECIFIED;