]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/program-option.cc: rename from scm-option.cc
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 9 Jun 2005 14:09:33 +0000 (14:09 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 9 Jun 2005 14:09:33 +0000 (14:09 +0000)
* lily/scm-option.cc (LY_DEFINE): handle no-foobar option setting.
(get_help_string): Print pretty help string.

* scripts/lilypond-book.py (PREAMBLE_LY): add no-point-and-click
to snippet preamble.

* lily/scm-option.cc: remove command-line-settings option. Fold
all command-line options plus default settings in a generic
interface.

* flower/getopt-long.cc (table_string): indent 2nd lines of help
texts too.

22 files changed:
ChangeLog
Documentation/user/invoking.itely
Documentation/user/point-and-click.itely
flower/getopt-long.cc
lily/include/program-option.hh [new file with mode: 0644]
lily/include/scm-option.hh [deleted file]
lily/main.cc
lily/midi-item.cc
lily/midi-stream.cc
lily/music-sequence.cc
lily/parser.yy
lily/program-option.cc [new file with mode: 0644]
lily/relative-octave-music.cc
lily/repeated-music.cc
lily/scm-option.cc [deleted file]
ly/init.ly
make/lilypond-vars.make
scm/backend-library.scm
scm/framework-ps.scm
scm/framework-tex.scm
scm/lily.scm
scripts/lilypond-book.py

index 69fdccdb847fa6600140287d89c9c7f556d7c850..620a0592bc42a3cefbbd7abd0fc4da28ef622acc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2005-06-09  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * lily/program-option.cc: rename from scm-option.cc
+
+       * lily/scm-option.cc (LY_DEFINE): handle no-foobar option setting.
+       (get_help_string): Print pretty help string.
+
+       * scripts/lilypond-book.py (PREAMBLE_LY): add no-point-and-click
+       to snippet preamble.
+
+       * lily/scm-option.cc: remove command-line-settings option. Fold
+       all command-line options plus default settings in a generic
+       interface. 
+
+       * flower/getopt-long.cc (table_string): indent 2nd lines of help
+       texts too.
+
 2005-06-09  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * flower/file-name.cc: Bugfix: only append DIRSEP if BASE_
 
        * lily/parser.yy (Repeated_music): remove >? 
 
-       * scm/framework-ps.scm (write-preamble): Support for -d
-       gs-font-load=1: read fonts via ghostscript. 
-       
        * scm/backend-library.scm (postscript->pdf): Support for
        -dgs-font-load=1
 
+       * scm/framework-ps.scm (write-preamble): make font loading
+       switchable to GS via --define-default gs-font-load=1
+
 2005-06-09  Graham Percival  <gperlist@shaw.ca>
 
        * Documentation/user/global.itely: added \layout docs.
 
 2005-06-09  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
-       * scm/framework-ps.scm (write-preamble): make font loading
-       switchable to GS via --define-default gs-font-load=1
-
        * lily/lily-parser-scheme.cc: add unistd.h
 
 2005-06-08  Han-Wen Nienhuys  <hanwen@xs4all.nl>
index 115c1050540e0214d3fda3d05790f89d3c6bd660..68cefef9c8d9368bee82e781d9315117fc608e07 100644 (file)
@@ -53,9 +53,7 @@ The following options are supported:
 @item -e,--evaluate=@var{expr}
 Evaluate the Scheme @var{expr} before parsing any @file{.ly} files.
 Multiple @code{-e} options may be given, they will be evaluated
-sequentially.  The function @code{ly:set-option} allows access to
-some internal variables.  Use @code{-e '(ly:option-usage)'} for more
-information.
+sequentially.  
 
 @item -f,--format=@var{format}
 which formats should be written.  Choices are @code{svg}, @code{ps},
@@ -97,19 +95,23 @@ This mode is used by default by lilypond-book.
 @cindex output format, setting
 
 @item -d,--define-default=@var{var}=@var{val}
-This defines an internal variable @var{var} as the Scheme value
-@var{val}.
+This sets the internal program option @var{var} to the Scheme value
+@var{val}. If @var{val} is not supplied, then @var{#t} is used. To
+switch off an option, @code{no-} may be prefixed to @var{var}, eg.
+@example
+-dno-point-and-click
+@end example
 
-Supported values include:
-@table @code
-@item resolution
-set PNG resolution
-@item preview-include-book-title
-include book-titles in preview
-@end table
+@noindent
+is the same as
+@example
+-dpoint-and-click='#f'
+@end example
+
+@cindex point and click
 
-These settings are returned when calling
-@code{(ly:get-option 'command-line-settings)} from Scheme.
+Setting the @code{help} option will print a summary of the options
+available, and exit.
 
 @item -h,--help
 Show a summary of usage.
@@ -135,7 +137,11 @@ Generate DVI files.  In this case, the @TeX{} backend should be
 specified, i.e., @code{-f tex}.
 
 @item --png
-Generate pictures of each page, in PNG format.  This implies @code{--ps}.
+Generate pictures of each page, in PNG format.  This implies
+@code{--ps}.  The resolution in DPI of the image may be set with
+@example
+-dresolution=110 
+@end example
 
 @item --pdf
 Generate PDF.  This implies @code{--ps}.
@@ -191,7 +197,7 @@ being compiled.  For a softer but secure alternative you can use the
 
 
 @item -j,--jail=@var{user},@var{group},@var{jail},@var{dir}
-Run LilyPond in a jail.
+Run LilyPond in a chroot jail.
 
 The @code{--jail} option provides a more flexible alternative to 
 @code{--safe} when LilyPond formatting is available through a web
index 3c1f8d1155056308d7dd56883b18dc8038ae8f7a..65fd27643ccea3a78f032766cb2c9a0cbaae84d5 100644 (file)
@@ -103,6 +103,6 @@ in a @file{.ly} file.  Alternately, you may pass this as an command-line
 option
 
 @example
-lilypond -e "(ly:set-option 'point-and-click #f)" file.ly
+lilypond -dno-point-and-click file.ly
 @end example
 
index 85b5f0ba9bb07149217b59799e1d19a4052748e6..9c24d78fba45024cd91a250db510bd083bf1535b 100644 (file)
@@ -306,7 +306,6 @@ const int EXTRA_SPACES = 5;
 String
 Long_option_init::table_string (Long_option_init *l)
 {
-  String argstr = "ARG";
   String tabstr = "";
 
   int wid = 0;
@@ -320,7 +319,9 @@ Long_option_init::table_string (Long_option_init *l)
       String s = "  " + l[i].str_for_help ();
       s += String_convert::char_string (' ', wid - s.length () + EXTRA_SPACES);
 
-      tabstr += s + gettext (l[i].help_str0_) + "\n";
+      String help_text (gettext (l[i].help_str0_));
+      help_text.substitute ("\n", "\n" + String_convert::char_string (' ', wid + EXTRA_SPACES + 2));
+      tabstr += s + help_text + "\n";
     }
 
   return tabstr;
diff --git a/lily/include/program-option.hh b/lily/include/program-option.hh
new file mode 100644 (file)
index 0000000..251db9d
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+  program-option.hh -- declare Scheme options
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2001--2005 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+#ifndef SCM_OPTION_HH
+#define SCM_OPTION_HH
+
+#include "lily-guile.hh"
+
+/* options */
+extern bool do_midi_debugging_global;
+extern int testing_level_global;
+extern bool lily_1_8_relative;
+extern bool lily_1_8_compatibility_used;
+
+
+SCM ly_get_option (SCM);
+SCM ly_set_option (SCM, SCM);
+
+struct Lilypond_option_init
+{
+  char const *name_;
+  char const *init_;
+  char const *descr_;
+};
+
+
+#endif /* SCM_OPTION_HH */
diff --git a/lily/include/scm-option.hh b/lily/include/scm-option.hh
deleted file mode 100644 (file)
index 8fd01f3..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
-  scm-option.hh -- declare Scheme options
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 2001--2005 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-#ifndef SCM_OPTION_HH
-#define SCM_OPTION_HH
-
-/* options */
-extern bool midi_debug_global_b;
-extern int testing_level_global;
-extern bool lily_1_8_relative;
-extern bool lily_1_8_compatibility_used;
-
-#endif /* SCM_OPTION_HH */
index 3986817c6e4c71b0b5748919b105e08fc43df9df..415425bef6bccddccaa01ef542bf66e32d9f952a 100644 (file)
@@ -137,12 +137,13 @@ static Getopt_long *option_parser = 0;
 
 static Long_option_init options_static[]
 = {
-  {_i ("BACK"), "backend", 'b', _i ("use backend BACK (gnome, ps [default],\n                                       scm, svg, tex, texstr)")},
+  {_i ("BACK"), "backend", 'b', _i ("use backend BACK (gnome, ps [default],\nscm, svg, tex, texstr)")},
 
   {_i ("SYM=VAL"), "define-default", 'd',
-   _i ("define a default Scheme setting.")},
+   _i ("set a Scheme program option. Uses #t if VAL is not specified\n"
+       "Try -dhelp for help.")},
 
-  {_i ("EXPR"), "evaluate", 'e', _i ("set scheme option, for help use\n                                       -e '(ly:option-usage)'")},
+  {_i ("EXPR"), "evaluate", 'e', _i ("evaluate scheme code")},
   /* Bug in option parser: --output =foe is taken as an abbreviation
      for --output-format.  */
   {_i ("FORMATs"), "formats", 'f', _i ("dump FORMAT,...  Also as separate options:")},
@@ -157,7 +158,8 @@ static Long_option_init options_static[]
   {_i ("FILE"), "init", 'i',  _i ("use FILE as init file")},
   {_i ("FILE"), "output", 'o',  _i ("write output to FILE (suffix will be added)")},
 #if HAVE_CHROOT
-  {_i ("USER,GROUP,JAIL,DIR"), "jail", 'j', _i ("chroot to JAIL, become USER:GROUP\n                                       and cd into DIR")},
+  {_i ("USER,GROUP,JAIL,DIR"), "jail", 'j', _i ("chroot to JAIL, become USER:GROUP\n"
+                                               "and cd into DIR")},
 #endif 
   {0, "no-print", 0, _i ("do not generate printed output")},
   {0, "preview", 'p',  _i ("generate a preview of the first system")},
@@ -535,7 +537,7 @@ main_with_guile (void *, int, char **)
   if (!init_scheme_variables.is_empty ()
       || !init_scheme_code_string.is_empty ())
     {
-      init_scheme_variables = "(ly:set-option 'command-line-settings (list "
+      init_scheme_variables = "(map (lambda (x) (ly:set-option (car x) (cdr x))) (list "
        + init_scheme_variables + "))";
       
       init_scheme_code_string
index 48f0061d709c294290caa465ff50d5a7be09a385..501bb66f2dbdc384b02858aa0b74f2417e5d140e 100644 (file)
@@ -14,7 +14,7 @@
 #include "string-convert.hh"
 #include "midi-stream.hh"
 #include "duration.hh"
-#include "scm-option.hh"
+#include "program-option.hh"
 #include "killing-cons.tcc"
 
 #define PITCH_WHEEL_TOP 0x3FFF
@@ -455,12 +455,12 @@ String
 Midi_track::data_string () const
 {
   String str = Midi_chunk::data_string ();
-  if (midi_debug_global_b)
+  if (do_midi_debugging_global)
     str += "\n";
   for (Cons<Midi_event> *i = event_p_list_.head_; i; i = i->next_)
     {
       str += i->car_->to_string ();
-      if (midi_debug_global_b)
+      if (do_midi_debugging_global)
        str += "\n";
     }
   return str;
index b3f3f6df148730df33d56092f3df218f2e08155a..99010d32ded3dcbcbd9cd5dd1aa1cdf83e595853 100644 (file)
@@ -17,7 +17,7 @@
 #include "misc.hh"
 #include "midi-item.hh"
 #include "warn.hh"
-#include "scm-option.hh"
+#include "program-option.hh"
 
 Midi_stream::Midi_stream (String file_name)
 {
@@ -52,7 +52,7 @@ Midi_stream::operator << (Midi_item const &midi_c_r)
   String str = midi_c_r.to_string ();
 
   // ugh, should have separate debugging output with Midi*::print routines
-  if (midi_debug_global_b)
+  if (do_midi_debugging_global)
     {
       str = String_convert::bin2hex (str) + "\n";
       for (int i = str.index ("0a"); i >= 0; i = str.index ("0a"))
index 9879da98e0bd3f6a9b896ffc3fe98fd04d7845ef..86bddb5ece74ddc49aae8b06abb494a71aa41664 100644 (file)
@@ -7,7 +7,7 @@
 */
 
 #include "warn.hh"
-#include "scm-option.hh"
+#include "program-option.hh"
 #include "pitch.hh"
 #include "input.hh"
 #include "music-sequence.hh"
index 7b2b22b3620117de898927037925dfa022424696..9cfa833ddf5173fc66a3e5077ae25c6b80847510 100644 (file)
@@ -41,7 +41,7 @@ FIXME:
 #include "paper-book.hh"
 #include "output-def.hh"
 #include "scm-hash.hh"
-#include "scm-option.hh"
+#include "program-option.hh"
 #include "score.hh"
 #include "text-interface.hh"
 #include "warn.hh"
diff --git a/lily/program-option.cc b/lily/program-option.cc
new file mode 100644 (file)
index 0000000..0769fcb
--- /dev/null
@@ -0,0 +1,212 @@
+/*
+  scm-option.cc -- implement option setting from Scheme
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 2001--2005  Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include "program-option.hh"
+
+#include <cstdio>
+#include <string.h>
+
+#include "string-convert.hh"
+#include "protected-scm.hh"
+#include "parse-scm.hh"
+#include "warn.hh"
+#include "main.hh"
+
+
+/* Write midi as formatted ascii stream? */
+bool do_midi_debugging_global;
+
+/*
+  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;
+
+
+static Lilypond_option_init options[] = {
+  {"point-and-click", "#t",
+   "use point & click"},
+  {"midi-debug", "#f",
+   "generate human readable MIDI",},
+  {"internal-type-checking", "#f",
+   "check every property assignment for types"},
+  {"parse-protect", "#t",
+   "continue when finding errors in inline\n" 
+   "scheme are caught in the parser. If off, halt \n"
+   "on errors, and print a stack trace."},
+  {"old-relative", "#f",
+   "relative for simultaneous music works\n"
+   "similar to chord syntax"},
+  {"resolution", "90",
+   "resolution for generating bitmaps"},
+  {"preview-include-book-title", "#t",
+   "include book-titles in preview images."},
+  {"gs-font-load", "#f",
+   "load fonts via Ghostscript."},
+  {0,0,0},
+};
+
+Protected_scm option_hash_;
+
+void internal_set_option (SCM var, SCM val)
+{
+  scm_hashq_set_x (option_hash_, var, val);
+  
+  if (var == ly_symbol2scm ("midi-debug"))
+    {
+      do_midi_debugging_global = to_boolean (val);
+      val = scm_from_bool (to_boolean (val));
+    }
+  else if (var == ly_symbol2scm ("point-and-click"))
+    {
+      point_and_click_global = to_boolean (val);
+      val = scm_from_bool (to_boolean (val));
+    }
+  else if (var == ly_symbol2scm ("parse-protect"))
+    {
+      parse_protect_global = to_boolean (val);
+      val = scm_from_bool (to_boolean (val));
+    }
+  else if (var == ly_symbol2scm ("internal-type-checking"))
+    {
+      do_internal_type_checking_global = to_boolean (val);
+      val = scm_from_bool (to_boolean (val));
+    }
+  else if (var == ly_symbol2scm ("old-relative"))
+    {
+      lily_1_8_relative = to_boolean (val);
+      /*  Needs to be reset for each file that uses this option.  */
+      lily_1_8_compatibility_used = to_boolean (val);
+      val = scm_from_bool (to_boolean (val));
+    }
+}
+
+const int HELP_INDENT = 30; 
+const int INDENT = 2; 
+const int SEPARATION = 5; 
+
+static String
+get_help_string ()
+{
+  String help ("Options supported by ly:set-option\n\n");
+  for (Lilypond_option_init *p = options; p->name_; p ++)
+    {
+      String opt_spec =
+       String_convert::char_string (' ', INDENT)
+       + String (p->name_)
+       + " ("
+       + String (p->init_)
+       + ")";
+       
+
+      if (opt_spec.length () + SEPARATION > HELP_INDENT)
+       {
+         opt_spec += "\n"
+           + String_convert::char_string (' ', HELP_INDENT);
+       }
+      else
+       opt_spec += String_convert::char_string (' ', HELP_INDENT - opt_spec.length ());
+      
+      String opt_help = p->descr_;
+      opt_help.substitute (String ("\n"),
+                          String ("\n")
+                          + String_convert::char_string (' ', HELP_INDENT));
+      
+      help += opt_spec + opt_help + "\n";
+    }
+  
+  help += String ("\n");
+  return help;
+}
+
+static void
+init_program_options ()
+{
+  option_hash_ = scm_c_make_hash_table (11);
+
+  for (Lilypond_option_init *p = options; p->name_; p ++)
+    {
+      SCM sym = ly_symbol2scm (p->name_);
+      SCM val = scm_c_eval_string (p->init_);
+
+      internal_set_option (sym, val);
+    }
+
+  String help = get_help_string ();
+
+
+
+  internal_set_option (ly_symbol2scm ("help"),
+                      scm_makfrom0str (help.to_str0 ()));
+}
+
+ADD_SCM_INIT_FUNC(scm_option, init_program_options);
+
+
+/*
+  This interface to option setting is meant for setting options are
+  useful to a limited audience. The reason for this interface is that
+  making command line options clutters up the command-line option name
+  space.
+
+*/
+
+Protected_scm command_line_settings = SCM_EOL;
+
+LY_DEFINE (ly_option_usage, "ly:option-usage", 0, 0, 0, (),
+          "Print ly:set-option usage")
+{
+  SCM stdout = scm_current_output_port();
+  scm_display (ly_get_option (ly_symbol2scm ("help")), stdout);
+  exit (0);
+  return SCM_UNSPECIFIED;
+}
+
+LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val),
+          "Set a program option. Try setting 'help for a help string.")
+{
+  SCM_ASSERT_TYPE (scm_is_symbol (var), var, SCM_ARG1,
+                  __FUNCTION__,  "symbol");
+
+  if (ly_symbol2scm ("help") == var)
+    {
+      ly_option_usage ();
+    }
+
+  if (val == SCM_UNDEFINED)
+    val = SCM_BOOL_T;
+
+  String  varstr = ly_scm2string (scm_symbol_to_string (var));
+  if (varstr.left_string (3) == String ("no-"))
+    {
+      var = ly_symbol2scm (varstr.nomid_string (0, 3).to_str0 ());
+      val = scm_from_bool (!to_boolean (val));
+    }
+  
+  SCM handle = scm_hashq_get_handle (option_hash_, var);
+  if (handle == SCM_BOOL_F)
+    {
+      warning (_f ("no such internal option: %s", varstr.to_str0 ()));
+    }
+
+  internal_set_option (var, val);
+  return SCM_UNSPECIFIED;
+}
+
+LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var),
+          "Get a global option setting.")
+{
+  SCM_ASSERT_TYPE (scm_is_symbol (var), var,
+                  SCM_ARG1, __FUNCTION__,  "symbol");
+  return scm_hashq_ref (option_hash_, var, SCM_BOOL_F);
+}  
index a04b735cbf5fae3d87221557f31eab6534141297..e3ee638953bc3f4f15531437004b37f818720045 100644 (file)
@@ -9,7 +9,7 @@
 #include "music.hh"
 #include "pitch.hh"
 #include "warn.hh"
-#include "scm-option.hh"
+#include "program-option.hh"
 
 class Relative_octave_music
 {
index 0081363e7f2a329536c879312b7c17f8f425c4cb..ee586efc89dea052e81bb2ee2897141f32e86909 100644 (file)
@@ -10,7 +10,7 @@
 #include "music-sequence.hh"
 #include "pitch.hh"
 #include "warn.hh"
-#include "scm-option.hh"
+#include "program-option.hh"
 
 Music *
 Repeated_music::body (Music *me)
diff --git a/lily/scm-option.cc b/lily/scm-option.cc
deleted file mode 100644 (file)
index 7e007ca..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
-  scm-option.cc -- implement option setting from Scheme
-
-  source file of the GNU LilyPond music typesetter
-
-  (c) 2001--2005  Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include <cstdio>
-
-#include "scm-option.hh"
-#include "protected-scm.hh"
-#include "parse-scm.hh"
-#include "warn.hh"
-#include "main.hh"
-
-/*
-  This interface to option setting is meant for setting options are
-  useful to a limited audience. The reason for this interface is that
-  making command line options clutters up the command-line option name
-  space.
-
-
-  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;
-
-/* General purpose testing flag */
-int testing_level_global;
-
-/*
-  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;
-
-Protected_scm command_line_settings = SCM_EOL;
-
-/*
-  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;
-}
-
-/* Add these as well:
-
-@item -T, --no-timestamps
-don't timestamp the output
-
-@item -t, --test
-Switch on any experimental features.  Not for general public use.
-*/
-
-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"
-          "@item command-line-settings\n"
-          "An alist of generic key/value pairs\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")
-{
-  if (val == SCM_UNDEFINED)
-    val = SCM_BOOL_T;
-
-  if (var == ly_symbol2scm ("help"))
-    /* lilypond -e "(ly:set-option 'help #t)" */
-    ly_option_usage (SCM_EOL);
-  else if (var == ly_symbol2scm ("midi-debug"))
-    midi_debug_global_b = to_boolean (val);
-  else if (var == ly_symbol2scm ("testing-level"))
-    testing_level_global = scm_to_int (val);
-  else if (var == ly_symbol2scm ("point-and-click"))
-    point_and_click_global = to_boolean (val);
-  else if (var == ly_symbol2scm ("parse-protect"))
-    parse_protect_global = to_boolean (val);
-  else if (var == ly_symbol2scm ("internal-type-checking"))
-    do_internal_type_checking_global = to_boolean (val);
-  else if (var == ly_symbol2scm ("old-relative"))
-    {
-      lily_1_8_relative = true;
-      /*  Needs to be reset for each file that uses this option.  */
-      lily_1_8_compatibility_used = false;
-    }
-  else if (var == ly_symbol2scm ("new-relative"))
-    lily_1_8_relative = false;
-  else if (var == ly_symbol2scm ("command-line-settings"))
-    {
-      SCM_ASSERT_TYPE(scm_list_p (val) == SCM_BOOL_T,
-                     val, SCM_ARG2, __FUNCTION__, "alist");
-      command_line_settings = scm_append (scm_list_2 (val, command_line_settings));
-    }
-  else
-    {
-      if (scm_is_symbol (var))
-       var = scm_symbol_to_string (var);
-
-      warning (_f ("no such internal option: %s", ly_scm2string (var)));
-    }
-  return SCM_UNSPECIFIED;
-}
-
-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 point-and-click\n"
-          "Report whether point & click is switched on.\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"
-          "@item command-line-settings\n"
-          
-          "@end table\n"
-          "\n")
-{
-  SCM o = SCM_UNSPECIFIED;
-
-  if (var == ly_symbol2scm ("safe")) // heavily used; put in front. 
-    o = ly_bool2scm (be_safe_global);
-  else if (var == ly_symbol2scm ("old-relative-used"))
-    o = ly_bool2scm (lily_1_8_compatibility_used);
-  else if (var == ly_symbol2scm ("old-relative"))
-    o = ly_bool2scm (lily_1_8_relative);
-  else if (var == ly_symbol2scm ("verbose"))
-    o = ly_bool2scm (be_verbose_global);
-  else if (var == ly_symbol2scm ("command-line-settings"))
-    {
-      o = command_line_settings;
-    }
-  else
-    {
-      if (scm_is_symbol (var))
-       var = scm_symbol_to_string (var);
-
-      String s = ly_scm2string (var);
-
-      warning (_f ("no such internal option: %s", s.to_str0 ()));
-    }
-  return o;
-}
index cf7245980cd0dbbe247eb5545bc002f3f875b427..e8bdf7ab351b8ef58d4b72f817ac4b83fc8c88bb 100644 (file)
@@ -12,7 +12,7 @@
 \include "declarations-init.ly"
 
 
-#(ly:set-option 'new-relative)
+#(ly:set-option 'old-relative #f)
 #(define toplevel-scores '())
 #(define $globalheader #f)
 #(define version-seen? #f)
index 7306b20b22cb7940944cc57bad64683caf989b0e..b099a45d337b292e56fad0da3632292279831ea1 100644 (file)
@@ -18,7 +18,7 @@ CONVERT_LY = $(script-dir)/convert-ly.py
 LILYPOND = $(builddir)/lily/$(outconfbase)/lilypond
 LILYPOND_BOOK = $(script-dir)/lilypond-book.py
 LILYPOND_BOOK_INCLUDES = -I $(pwd) -I $(outdir) -I$(input-dir) -I $(input-dir)/regression/ -I $(input-dir)/test/ -I $(input-dir)/tutorial/ -I $(builddir)/mf/$(outconfbase)/  -I $(builddir)/mf/out/
-LILYPOND_BOOK_FLAGS = --process="$(LILYPOND) --backend=eps --formats=ps,png --header=texidoc -I $(srcdir)/input/test -e '(ly:set-option (quote internal-type-checking) \#t)'"
+LILYPOND_BOOK_FLAGS = --process="$(LILYPOND) --backend=eps --formats=ps,png --header=texidoc -I $(srcdir)/input/test -dinternal-type-checking"
 
 
 #texi-html for www only:
index f39ac71471c7c18b0c457bace009c9e70e207184..7293b7be955bd6ea909f1116678cbed21d9630cf 100644 (file)
@@ -48,8 +48,7 @@
  -c .setpdfwrite\
  -f ~S\
 "
-                     (if (assoc 'gs-font-load
-                                (ly:get-option 'command-line-settings))
+                     (if (ly:get-option 'gs-font-load)
                          " -dNOSAFER "
                          " -dSAFER ")
                      (sanitize-command-option papersizename)
index 46ede2e15ab44eee9eac036f5918fa8c7d7c5ace..b4f23a74164636aa18eab8d9d7adc0c8a2bfb4af 100644 (file)
                   (lambda (x y) (string<? (cadr x) (cadr y))))))
 
 
-          (font-loader (if (assoc 'gs-font-load
-                                  (ly:get-option 'command-line-settings))
+          (font-loader (if (ly:get-option 'gs-font-load)
                            load-font-via-GS
                            load-font))
                         
     ;; skip booktitles.
     (if (and
         (not
-         (cdr (assoc
-              'preview-include-book-title
-              (ly:get-option 'command-line-settings))))
+         (ly:get-option 'preview-include-book-title))
         (< 1 (length systems))
         (ly:paper-system-title? (list-ref systems 0))
         (ly:paper-system-title? (list-ref systems 1)))
         (defs-resolution (ly:output-def-lookup defs 'pngresolution))
         (resolution (if (number? defs-resolution)
                         defs-resolution
-                        (cdr (assoc 'resolution
-                               (ly:get-option 'command-line-settings)))))
+                        (ly:get-option 'resolution)))
         (papersizename (ly:output-def-lookup defs 'papersizename)))
 
     (postscript->png resolution
index 568c5e7c409632c845b35bd2dfde25534cf2e935..55fc402d8c6625626ccb4b55eb7fd3af61b4a40b 100644 (file)
     (postscript->png
      (if (number? resolution)
         resolution
-        (assoc
-         'resolution
-         (ly:get-option 'command-line-settings)))
+        (ly:get-option 'resolution))
 
      (if (string? papersizename)
         papersizename
index 66bedac6138df7bc678891ccd9875773b0487a2f..4b5f1311f457fb376ce1b84f65d1ab86b606c0ae 100644 (file)
       (debug-enable 'backtrace)
       (read-enable 'positions)))
 
-;; initialize defaults. 
-(ly:set-option 'command-line-settings
-              '((resolution . 90)
-                (preview-include-book-title . #t)
-                ))
 
 (define-public tex-backend?
   (member (ly:output-backend) '("texstr" "tex")))
index 193c94bd8489cf5545325ea8c470c13357320caa..feb53946908ec2222c03f0a19d8d039df8fc1b4b 100644 (file)
@@ -557,6 +557,8 @@ PREAMBLE_LY = r'''%%%% Generated by %(program_name)s
                               (ly:parser-print-score
                                p (ly:music-scorify m p))))
 
+#(ly:set-option (quote no-point-and-click))
+
 #(define version-seen? #t)
 %(preamble_string)s