From: Han-Wen Nienhuys <hanwen@xs4all.nl>
Date: Mon, 4 Jun 2007 01:14:20 +0000 (-0300)
Subject: add support for (ly:get-option 'datadir)
X-Git-Tag: release/2.11.26-1~19
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c9212744357d0e88c85f5621720687f81d37827f;p=lilypond.git

add support for (ly:get-option 'datadir)
---

diff --git a/lily/program-option-scheme.cc b/lily/program-option-scheme.cc
index b636948fa8..638aaf634d 100644
--- a/lily/program-option-scheme.cc
+++ b/lily/program-option-scheme.cc
@@ -39,8 +39,6 @@ static SCM option_hash;
 
 void internal_set_option (SCM var, SCM val)
 {
-  scm_hashq_set_x (option_hash, var, val);
-
   if (0)
     ;
   else if (var == ly_symbol2scm ("profile-property-accesses"))
@@ -100,6 +98,16 @@ void internal_set_option (SCM var, SCM val)
       debug_page_breaking_scoring = to_boolean (val);
       val = scm_from_bool (to_boolean (val));
     }
+  else if (var == ly_symbol2scm ("datadir"))
+    {
+      /* ignore input value. */
+      val = ly_string2scm (lilypond_datadir);
+    }
+
+
+  scm_hashq_set_x (option_hash, var, val);
+
+
 }
 
 
diff --git a/scm/lily.scm b/scm/lily.scm
index 48d911751a..cee1e74e80 100644
--- a/scm/lily.scm
+++ b/scm/lily.scm
@@ -31,6 +31,7 @@
     (backend ps "which backend to use by default; Options: eps, ps [default], scm, svg, tex, texstr)")
     (check-internal-types #f "check every property assignment for types")
     (clip-systems #f "Generate cut-out snippets of a score")
+    (datadir #f "LilyPond prefix for data files (Readonly).")
     (debug-gc #f "dump memory debugging statistics")
     (debug-gc-assert-parsed-dead #f "for memory debugging:
 ensure that all refs to parsed objects are dead.  This is an internal option, and is switched on automatically for -ddebug-gc.")