]> git.donarmstrong.com Git - lilypond.git/commitdiff
* Documentation/user/GNUmakefile (LILYPOND_BOOK_FLAGS): be anal
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 18 Aug 2002 15:03:54 +0000 (15:03 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 18 Aug 2002 15:03:54 +0000 (15:03 +0000)
with type checks.

* Documentation/GNUmakefile (LILYPOND_BOOK_FLAGS):
* input/regression/GNUmakefile (LILYPOND_BOOK_FLAGS):
* input/test/GNUmakefile (LILYPOND_BOOK_FLAGS):
* Documentation/user/invoking.itexi:
* lily/scm-option.cc:
* lily/main.cc: Debugging options: ly-set-option (was:
set-lily-option).

* lily/scm-option.cc (ly_option_usage): New function.

ChangeLog
Documentation/GNUmakefile
Documentation/user/GNUmakefile
Documentation/user/invoking.itexi
input/regression/GNUmakefile
input/test/GNUmakefile
lily/include/lily-guile.hh
lily/main.cc
lily/scm-option.cc

index fca07925e5f28e087ddedd24aa87946aa56cdc71..683eb8087fbd1d6966ab157c993c56492b401fb3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2002-08-18  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * Documentation/user/GNUmakefile (LILYPOND_BOOK_FLAGS): be anal
+       with type checks.
+
+       * Documentation/GNUmakefile (LILYPOND_BOOK_FLAGS): 
+       * input/regression/GNUmakefile (LILYPOND_BOOK_FLAGS):
+       * input/test/GNUmakefile (LILYPOND_BOOK_FLAGS): 
+       * Documentation/user/invoking.itexi: 
+       * lily/scm-option.cc:
+       * lily/main.cc: Debugging options: ly-set-option (was:
+       set-lily-option).
+
+       * lily/scm-option.cc (ly_option_usage): New function.
+
 2002-08-18  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
        * lily/parser.yy (script_abbreviation): accept -_ script.
index 4b7c27c927b595a2cf872e3a971b5c7c60b93c4f..69aa4bfef441c53e6f3dd0c84cff76e26c399f54 100644 (file)
@@ -4,7 +4,7 @@ NAME = documentation
 SUBDIRS=user bibliography pictures topdocs misc windows
 STEPMAKE_TEMPLATES=documentation texinfo tex
 LOCALSTEPMAKE_TEMPLATES=lilypond ly
-LILYPOND_BOOK_FLAGS=--extra-options '-e "(set-lily-option (quote internal-type-checking) \#t)"'
+LILYPOND_BOOK_FLAGS=--extra-options '-e "(ly-set-option (quote internal-type-checking) \#t)"'
 README_TOP_FILES=NEWS DEDICATION ChangeLog
 EXTRA_DIST_FILES=
 
index 120d24d2a541fc31ab385c5c870c3c1022edfb89..a3f909f13a1f5cff0e69b43d280590dd99009cd7 100644 (file)
@@ -21,6 +21,7 @@ INFO_FILES = $(addprefix $(outdir)/, lilypond.info lilypond-internals.info)
 
 STEPMAKE_TEMPLATES=tex texinfo documentation
 LOCALSTEPMAKE_TEMPLATES=lilypond ly
+LILYPOND_BOOK_FLAGS=--extra-options '-e "(ly-set-option (quote internal-type-checking) \#t)"'
 
 # Hmm, what about?
 # local-dist: check-info
index 92c1580d0c3022bb546fa50bfb058c60cae69d5e..f6f8924191adb799a87c45ad1c9f20305d7d8e72 100644 (file)
@@ -40,13 +40,12 @@ The following options are supported:
 
 @table @code
 
-@item -e,--evaluate=@var{code}
-  Evaluates the Scheme @var{code} before parsing @file{.ly}
-files. Multiple @code{-e} options may be given. They will be evaluated
-sequentially. The function @code{set-lily-option} may be invoked to
-set various debugging options.
-
-
+@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 for access to
+some internal variables.  Use @code{-e '(ly-option-usage')} for more
+information.
 
 @item -f,--format=@var{format}
 @c
index 2528cf34b26aee194ef26548fdd4270b422a1410..540e72e923d3feed2493d5a7a66c6138303d8f93 100644 (file)
@@ -2,7 +2,7 @@ depth = ../..
 
 STEPMAKE_TEMPLATES=documentation texinfo tex
 LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc
-LILYPOND_BOOK_FLAGS=--extra-options '-e "(set-lily-option (quote internal-type-checking) \#t)"'
+LILYPOND_BOOK_FLAGS=--extra-options '-e "(ly-set-option (quote internal-type-checking) \#t)"'
 
 include $(depth)/make/stepmake.make 
 TITLE=LilyPond Regression Tests
index df34db779d5dd083b2a6182d43c4522d8b467169..82fc916468e100fa44ddcb570a6e24caa012f603 100644 (file)
@@ -4,7 +4,7 @@ depth = ../..
 STEPMAKE_TEMPLATES=documentation texinfo tex
 LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc
 
-LILYPOND_BOOK_FLAGS=--extra-options '-e "(set-lily-option (quote internal-type-checking) \#t)"'
+LILYPOND_BOOK_FLAGS=--extra-options '-e "(ly-set-option (quote internal-type-checking) \#t)"'
 
 ## Hmm, would this work?  No -- if we really want examples, move
 ## to other dir (input/) comes to mind.
index db21226950ece51252d0db034266dcd14d7ef702..ffaed005730cfc72ae9f4bc1a617c6b6e3df0d4c 100644 (file)
@@ -284,6 +284,20 @@ SCM \
 FNAME ARGLIST\
 
 
+#define LY_DEFINE_NOARGS(FNAME, PRIMNAME, REQ, OPT, VAR, DOCSTRING) \
+SCM FNAME ## _proc;\
+void \
+FNAME ## init_noargs ()\
+{\
+ FNAME ## _proc \
+    = scm_c_define_gsubr (PRIMNAME,REQ, OPT, VAR, (Scheme_function_unknown) FNAME);\
+  ly_add_function_documentation (PRIMNAME, "", DOCSTRING);\
+}\
+ADD_SCM_INIT_FUNC (FNAME ## init_unique_prefix_noargs, FNAME ## init_noargs);\
+SCM \
+FNAME
+
+
 
 
 
index 9fee2c5c5e35d7c8bc83da709565de9bf78b021c..3375142449239b40e8baffc8f95c8ef63c1f3ef1 100644 (file)
@@ -103,11 +103,11 @@ static Getopt_long *oparser_p_static = 0;
        follow regular localisation guidelines).
  */
 static Long_option_init options_static[] = {
-  /* print example usage:  lilypond -e "" ? */
-  {_i ("EXPR"), "evaluate", 'e',_i ("Scheme options: try -e \"(set-lily-option 'help 0)\" for more help.")},
+  {_i ("EXPR"), "evaluate", 'e',
+   _i ("set options, use -e '(ly-option-usage)' for help")},
   /* another bug in option parser: --output=foe is taken as an abbreviation
      for --output-format */
-  {_i ("EXT"), "format", 'f',  _i ("use output format EXT")},
+  {_i ("EXT"), "format", 'f', _i ("use output format EXT")},
   {0, "help", 'h',  _i ("this help")},
   {_i ("FIELD"), "header", 'H',  _i ("write header field to BASENAME.FIELD")},
   {_i ("DIR"), "include", 'I',  _i ("add DIR to search path")},
@@ -354,7 +354,8 @@ main_prog (void *, int, char **)
   const char *arg  = oparser_p_static->get_next_arg ();
 
   /* Only exit until after running init_scheme_code, for
-     (set-lily-option 'help) */
+     (ly-option-usage) or
+     -e "(ly-set-option 'help #t)" */
   if (!arg)
     {
       usage ();
index 9c484e3d9dc6dcb1e2923e75805ab74f03cb6bd4..f175b214838f7432f76ab61718d02375cccc8f6d 100644 (file)
@@ -38,6 +38,30 @@ int testing_level_global;
  */
 bool internal_type_checking_global_b;
 
+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 (_ ("Where SYMBOL VAL pair is any of:").to_str0 ());
+  puts ("");
+  printf ( "  help ANY-SYMBOL\n"
+          "  internal-type-checking BOOLEAN\n"
+          "  midi-debug BOOLEAN\n"
+          "  testing-level INTEGER\n");
+  
+  exit (0);
+  return SCM_UNSPECIFIED;
+}
+
 /* Add these as well:
 
 @item -T,--no-timestamps
@@ -46,43 +70,26 @@ don't timestamp the output
 @item -t,--test
 Switch on any experimental features.  Not for general public use. */
 
-LY_DEFINE(set_lily_option,"set-lily-option", 2, 0, 0,  (SCM var, SCM val),
-         "Set a global option for the program. Supported options  include
-
+LY_DEFINE (ly_set_option, "ly-set-option", 2, 0, 0, (SCM var, SCM val),
+           "Set a global option value.  Supported options include
 
 @table @code
 @item help
 List all options.
 @item midi-debug
-If set to true, generate human  readable MIDI
+If set to true, generate human readable MIDI
 @item internal-type-checking
 Set paranoia for property assignments 
 @end table
 
 This function is useful to call from the command line: @code{lilypond -e
-\"(set-lily-option 'midi-debug #t)\"}.
+\"(ly-set-option 'midi-debug #t)\"}.
 ")
 {
-  /* Scheme option usage:
-    lilypond -e "(set-lily-option 'help 0)" */
   if (var == ly_symbol2scm ("help"))
     {
-      printf ( _("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:
-
-  (set-lily-option SYMBOL VAL)
-
-possible options for SYMBOL are :
-").to_str0 ());
-      printf ( "  help (any-symbol)\n"
-              "  internal-type-checking (boolean)\n"
-              "  midi-debug (boolean)\n"
-              "  testing-level (int)\n");
-              
-      exit (0);
+      /* lilypond -e "(ly-set-option 'help #t)" */
+      ly_option_usage (SCM_EOL);
     }
   else if (var == ly_symbol2scm ("midi-debug"))
     {