#include "lily-guile.hh"
#include "scm-option.hh"
#include "warn.hh"
+#include "main.hh"
/*
This interface to option setting is meant for setting options are
/*
Backwards compatibility.
*/
-bool lily_1_8_relative = true;
+bool lily_1_8_relative = false;
+bool lily_1_8_compatibility_used = false;
+
/*
crash if internally the wrong type is used for a grob property.
*/
@item -t,--test
Switch on any experimental features. Not for general public use. */
-LY_DEFINE (ly_set_option, "ly:set-option", 2, 0, 0, (SCM var, SCM val),
+LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val),
"Set a global option value. Supported options include\n"
"\n"
"@table @code\n"
"This function is useful to call from the command line: @code{lilypond -e\n"
"\"(ly-set-option 'midi-debug #t)\"}.\n")
{
+ if (val == SCM_UNDEFINED)
+ val = SCM_BOOL_T;
+
if (var == ly_symbol2scm ("help"))
{
/* lilypond -e "(ly-set-option 'help #t)" */
else if (var == ly_symbol2scm ("old-relative"))
{
lily_1_8_relative = true;
+ lily_1_8_compatibility_used = false;
}
else if (var == ly_symbol2scm ("new-relative"))
{
lily_1_8_relative = false;
}
+ else if (var == ly_symbol2scm ("debug-beam"))
+ {
+ extern bool debug_beam_quanting_flag;
+ debug_beam_quanting_flag = true;
+ }
else
{
warning (_("Unknown internal option!"));
}
+LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var),
+ "Get a global option setting. Supported options include\n"
+ "@table @code\n"
+ "@item old-relative-used\n"
+ "Report whether old-relative compatibility mode is necessary\n"
+ "@item old-relative\n"
+ "Report whether old-relative compatibility mode is used\n"
+ "@item verbose\n"
+ "Report whether we are running in verbose mode\n"
+ "@end table\n"
+ "\n")
+{
+ if (var == ly_symbol2scm ("old-relative-used"))
+ {
+ return gh_bool2scm (lily_1_8_compatibility_used);
+ }
+ if (var == ly_symbol2scm ("old-relative"))
+ {
+ return gh_bool2scm (lily_1_8_relative);
+ }
+ if (var == ly_symbol2scm ("verbose"))
+ {
+ return gh_bool2scm (verbose_global_b);
+ }
+ else
+ {
+ warning (_("Unknown internal option!"));
+ }
+
+ return SCM_UNSPECIFIED;
+}