X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fscm-option.cc;h=185d5583309d44479df90fc48d29b8ee20997078;hb=34e6d3d79f3b5fc6188a20f9a2a5c0d34b2c81c8;hp=2eac1482aca2df84441d60cfb0a720e54163d4db;hpb=8d7a55721e3305f745c0b24c367de002dd197825;p=lilypond.git diff --git a/lily/scm-option.cc b/lily/scm-option.cc index 2eac1482ac..185d558330 100644 --- a/lily/scm-option.cc +++ b/lily/scm-option.cc @@ -1,17 +1,18 @@ -/* - scm-option.cc -- implement option setting from Scheme - +/* + scm-option.cc -- implement option setting from Scheme + source file of the GNU LilyPond music typesetter - - (c) 2001--2002 Han-Wen Nienhuys - - */ - -#include -#include "string.hh" -#include "lily-guile.hh" + + (c) 2001--2005 Han-Wen Nienhuys +*/ + #include "scm-option.hh" +#include + +#include "parse-scm.hh" +#include "warn.hh" +#include "main.hh" /* This interface to option setting is meant for setting options are @@ -23,102 +24,155 @@ preferably, also dont use TESTING_LEVEL_GLOBAL, since it defeats another purpose of this very versatile interface, which is to support multiple debug/testing options concurrently. - - */ - +*/ /* Write midi as formatted ascii stream? */ bool midi_debug_global_b; +int preview_resolution_global = 90; + /* General purpose testing flag */ int testing_level_global; /* - crash if internally the wrong type is used for a grob property. - */ -bool internal_type_checking_global_b; + Backwards compatibility. +*/ +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. +*/ +bool do_internal_type_checking_global; - TODO: verzin iets tegen optie code bloot - +/* + What is this function for ? +*/ +LY_DEFINE (ly_option_usage, "ly:option-usage", 0, 0, 0, (SCM), + "Print ly:set-option usage") +{ + printf (_ ("lilypond -e EXPR means:").to_str0 ()); + puts (""); + printf (_ (" Evalute the Scheme EXPR before parsing any .ly files.").to_str0 ()); + puts (""); + printf (_ (" Multiple -e options may be given, they will be evaluated sequentially.").to_str0 ()); + puts (""); + printf (_ (" The function ly:set-option allows for access to some internal variables.").to_str0 ()); + puts ("\n"); + printf (_ ("Usage: lilypond -e \"(ly : set - option SYMBOL VAL)\"").to_str0 ()); + puts ("\n"); + printf (_ ("Use help as SYMBOL to get online help.").to_str0 ()); + puts ("\n"); + + exit (0); + return SCM_UNSPECIFIED; +} - other interesting stuff to add: +/* Add these as well: -@item -T,--no-timestamps +@item -T, --no-timestamps don't timestamp the output -@item -t,--test +@item -t, --test Switch on any experimental features. Not for general public use. - - */ - -SCM -set_lily_option (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" + "@item help\n" + "List all options.\n" + "@item point-and-click\n" + "Switch point & click on or off.\n" + "@item midi-debug\n" + "If set to true, generate human readable MIDI\n" + "@item internal-type-checking\n" + "Set paranoia for property assignments\n" + "@item parse-protect\n" + "If protection is switched on, errors in inline scheme are caught in the parser. \n" + "If off, GUILE will halt on errors, and give a stack trace. Default is protected evaluation. \n" + "@item old-relative\n" + "Relative for simultaneous music functions similar to chord syntax\n" + "@item new-relative\n" + "Relative for simultaneous music functions similar to sequential music\n" + "@end table\n" + "\n" + "This function is useful to call from the command line: @code{lilypond -e\n" + "\"(ly : set - option 'midi-debug #t)\"}.\n") { - /* - Scheme option usage: - lilypond -e "(set-lily-option 'help 0)" - */ - if (var == ly_symbol2scm ("help")) - { - cout << _("lilypond -e EXPR means - -evalute EXPR as Scheme after init.scm has been read. In particular, -the function set-lily-option allows for access to some internal -variables. Usage: + if (val == SCM_UNDEFINED) + val = SCM_BOOL_T; - (set-lily-option SYMBOL VAL) - -possible options for SYMBOL are : -")<