]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 3244: Remove -d old-relative compatibility option
authorDavid Kastrup <dak@gnu.org>
Thu, 14 Mar 2013 12:46:49 +0000 (13:46 +0100)
committerDavid Kastrup <dak@gnu.org>
Thu, 21 Mar 2013 06:26:16 +0000 (07:26 +0100)
This removes the lily_1_8_relative variable and the code surrounding
it.  lily_1_8_relative_used apparently was unused; Scheme code for
interpreting its setting was not connected to the actual variable.

The callback for repeat-music was not actually being used and has been
removed.  While the command line option was still documented, it was
ineffective: only reenabling it in the file itself lead to any effect.

ly:relative-music::relative-callback and
ly:relative-music::no-relative-callback are now functionally
equivalent.

13 files changed:
Documentation/changes.tely
Documentation/usage/running.itely
lily/include/program-option.hh
lily/music-scheme.cc
lily/music-sequence.cc
lily/program-option-scheme.cc
lily/relative-octave-music.cc
lily/repeated-music.cc
ly/declarations-init.ly
ly/init.ly
python/convertrules.py
scm/lily-library.scm
scm/lily.scm

index dab40a311297339e0686d820f7704877dd16d10d..2b1a060f41c1ca95794c62ef58bccd5212ae8825 100644 (file)
@@ -61,6 +61,13 @@ which scares away people.
 
 @end ignore
 
+@item
+The @samp{-d old-relative} option has been removed.  Not actually
+accessible from the command line any more, its remaining use was
+for interpretating @code{\relative} in LilyPond files converted
+automatically from version@tie{}1.8 or older.  It is unclear how
+much of this was actually still operative.
+
 @item
 The meaning of @code{instrumentTransposition} has been reversed.
 After
index 5bae43cb1ee1e1fae79f068be7aae238da585a58..76d6823b9ec7b77feb64e99c143febd088f5bc13 100644 (file)
@@ -541,11 +541,6 @@ string.
 @tab @code{#f}
 @tab Convert text strings to paths when glyphs belong to a music font.
 
-@item @code{old-relative}
-@tab @code{#f}
-@tab Make @code{\relative} mode for simultaneous music work similar to
-chord syntax.
-
 @item @code{paper-size}
 @tab @code{\"a4\"}
 @tab Set default paper size.  Note the string must be enclosed in
index ae131d3f5d31dfa79272dbd3731ba26e948021d0..83526816de55cffbb3081d651980b3b5bb0714d2 100644 (file)
@@ -22,8 +22,6 @@
 #include "lily-guile.hh"
 
 /* options */
-extern bool lily_1_8_relative;
-extern bool lily_1_8_compatibility_used;
 
 SCM ly_get_option (SCM);
 SCM ly_set_option (SCM, SCM);
index 3412e73b5642761765b09b971c5e585f14027229..dc2d9a6aa24640bb933942cd13050b25467af5a5 100644 (file)
@@ -182,8 +182,6 @@ LY_DEFINE (ly_make_music_relative_x, "ly:make-music-relative!",
   Pitch start = *unsmob_pitch (pitch);
   Music *m = unsmob_music (music);
   Pitch last = m->to_relative_octave (start);
-  if (lily_1_8_relative)
-    m->set_property ("last-pitch", last.smobbed_copy ());
 
   return last.smobbed_copy ();
 }
index 7ab62470b567bc5fad37a004329749d7fa7d00a2..b40597df246bb4bd296e5f0a33b205ba057abcc2 100644 (file)
@@ -177,25 +177,8 @@ Music_sequence::simultaneous_relative_callback (SCM music, SCM pitch)
 {
   Music *me = unsmob_music (music);
   Pitch p = *unsmob_pitch (pitch);
-
-  SCM elts = me->get_property ("elements");
-  SCM copied = SCM_EOL;
-  if (lily_1_8_relative)
-    copied = ly_music_deep_copy (elts);
-
-  Pitch retval = music_list_to_relative (elts, p, false);
-
-  if (lily_1_8_relative)
-    {
-
-      Pitch retval_1_8 = music_list_to_relative (copied, p, true);
-      if (retval_1_8 != retval)
-        lily_1_8_compatibility_used = true;
-
-      retval = retval_1_8;
-    }
-
-  return retval.smobbed_copy ();
+  return music_list_to_relative (me->get_property ("elements"),
+                                 p, false).smobbed_copy ();
 }
 
 MAKE_SCHEME_CALLBACK (Music_sequence, event_chord_relative_callback, 2);
index 616e99397a4d2c8c70b7cd5235bf08a9350fcf35..302b48e3f48b9ec5f6dda3450c39a111f66a30c8 100644 (file)
@@ -37,11 +37,6 @@ bool debug_page_breaking_scoring;
 bool music_strings_to_paths;
 bool relative_includes;
 
-/*
-  Backwards compatibility.
-*/
-bool lily_1_8_relative = false;
-bool lily_1_8_compatibility_used = false;
 bool profile_property_accesses = false;
 /*
   crash if internally the wrong type is used for a grob property.
@@ -85,13 +80,6 @@ internal_set_option (SCM var,
       be_safe_global = valbool;
       val = val_scm_bool;
     }
-  else if (varstr == "old-relative")
-    {
-      lily_1_8_relative = valbool;
-      /* Needs to be reset for each file that uses this option. */
-      lily_1_8_compatibility_used = valbool;
-      val = val_scm_bool;
-    }
   else if (varstr == "strict-infinity-checking")
     {
       strict_infinity_checking = valbool;
index 94f566357c5cf5eeb9831ade241834b77e76514d..2f31e20a223c3a2d854557df7dd6f1289aa99dd8 100644 (file)
@@ -38,23 +38,9 @@ Relative_octave_music::no_relative_callback (SCM /* music */,
 
 MAKE_SCHEME_CALLBACK (Relative_octave_music, relative_callback, 2)
 SCM
-Relative_octave_music::relative_callback (SCM music, SCM pitch)
+Relative_octave_music::relative_callback (SCM /* music */,
+                                          SCM pitch)
 {
-  Music *me = unsmob_music (music);
-  if (lily_1_8_relative)
-    {
-      lily_1_8_compatibility_used = true;
-      /*  last-pitch should be junked some time, when
-          we ditch 1.8 compat too.
-
-          When you do, B should start where A left off.
-
-          \relative { A \relative { ...} B }  */
-      SCM last_pitch = me->get_property ("last-pitch");
-      Pitch *ptr = unsmob_pitch (last_pitch);
-      return (ptr) ? last_pitch : pitch;
-    }
-  else
-    return pitch;
+  return pitch;
 }
 
index 13e12df2a48af8f8bcc61540b64658a7649c0a2e..78ffd6b8800c33f316c70225a58f741ba32e107a 100644 (file)
@@ -35,33 +35,6 @@ Repeated_music::alternatives (Music *me)
   return me->get_property ("elements");
 }
 
-MAKE_SCHEME_CALLBACK (Repeated_music, relative_callback, 2);
-SCM
-Repeated_music::relative_callback (SCM music, SCM pitch)
-{
-  Pitch p = *unsmob_pitch (pitch);
-  Music *me = unsmob_music (music);
-  if (lily_1_8_relative)
-    {
-      Music *body = unsmob_music (me->get_property ("element"));
-      if (body)
-        p = body->to_relative_octave (p);
-
-      Pitch last = p;
-      SCM alternatives = me->get_property ("elements");
-
-      for (SCM s = alternatives; scm_is_pair (s); s = scm_cdr (s))
-        {
-          lily_1_8_compatibility_used = true;
-          unsmob_music (scm_car (s))->to_relative_octave (p);
-        }
-
-      return last.smobbed_copy ();
-    }
-  else
-    return me->generic_to_relative_octave (p).smobbed_copy ();
-}
-
 Moment
 Repeated_music::alternatives_get_length (Music *me, bool fold)
 {
index c2bdb96b70bfec25937f8cef51191c887028ac96..f37103c9a96b4e506bae9587185ba025dd64ee8e 100644 (file)
@@ -18,9 +18,6 @@
 
 \version "2.17.6"
 
-%% < 1.8 compatibility switch
-#(ly:set-option 'old-relative)
-
 %% named durations
 breve = #(ly:make-duration -1 0)
 longa = #(ly:make-duration -2 0)
index 8e8a2fc2123436dd8ee428e859b3ff7bfecdaea6..3be64edb7f9811c839626576da7f50485d81a2c5 100644 (file)
@@ -19,7 +19,6 @@
 
 #(note-names-language parser default-language)
 
-#(ly:set-option 'old-relative #f)
 #(define location #f)
 #(define toplevel-scores (list))
 #(define toplevel-bookparts (list))
@@ -48,11 +47,6 @@ $(if (ly:get-option 'include-settings)
 %% Above and below comments compensate for the parser's look-ahead.
 %%
 
-#(if (and (ly:get-option 'old-relative)
-      (defined? 'input-file-name)
-      (not (ly:get-option 'old-relative-used)))
-  (old-relative-not-used-message input-file-name))%% there is a problem at the end of the input file
-
 #(if (and (not version-seen)
       (defined? 'input-file-name))
   (version-not-seen-message input-file-name))
index a1c8d507a648a7d31df0e0e150a0badb7449ace2..274313b2604936e54756b294cb5b657045e48818 100644 (file)
@@ -3520,6 +3520,14 @@ def conv(str):
                   r"\1/\2", str)
     return str
 
+@rule((2, 17, 15), r"#(ly:set-option 'old-relative)")
+def conv(str):
+    if re.search (r"[#$]\(ly:set-option\s+'old-relative", str):
+        stderr_write (NOT_SMART % "#(ly:set-option 'old-relative)")
+        stderr_write (UPDATE_MANUALLY)
+        raise FatalConversionError ();
+    return str
+
 # Guidelines to write rules (please keep this at the end of this file)
 #
 # - keep at most one rule per version; if several conversions should be done,
index c6b8dd2a9ea3378e2794aa6931a9a2efd82ba38e..736d0c38107fed33e615fd3614f56c17ee67e8c2 100644 (file)
@@ -999,8 +999,3 @@ print a warning and set an optional @var{default}."
     (ly:format "~a:1" input-file-name)
     (_ "no \\version statement found, please add~afor future compatibility")
     (format #f "\n\n\\version ~s\n\n" (lilypond-version))))
-
-(define-public (old-relative-not-used-message input-file-name)
-  (ly:warning-located
-    (ly:format "~a:1" input-file-name)
-    (_ "old relative compatibility not used")))
index 1c9353ff59a0750b9267424e39fc5be872ad419a..c1f8f1fe3453362e9af71b0f6f47c83788a5dfa2 100644 (file)
@@ -209,9 +209,6 @@ file to given string.")
     (music-strings-to-paths #f
 "Convert text strings to paths when glyphs belong
 to a music font.")
-    (old-relative #f
-"Make \\relative mode for simultaneous music work
-similar to chord syntax.")
     (point-and-click #t
 "Add point & click links to PDF output.")
     (paper-size "a4"