From 543dc9db58da5e3acaf72dae2478933742fa6e90 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Thu, 14 Mar 2013 13:46:49 +0100 Subject: [PATCH] Issue 3244: Remove -d old-relative compatibility option 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. --- Documentation/changes.tely | 7 +++++++ Documentation/usage/running.itely | 5 ----- lily/include/program-option.hh | 2 -- lily/music-scheme.cc | 2 -- lily/music-sequence.cc | 21 ++------------------- lily/program-option-scheme.cc | 12 ------------ lily/relative-octave-music.cc | 20 +++----------------- lily/repeated-music.cc | 27 --------------------------- ly/declarations-init.ly | 3 --- ly/init.ly | 6 ------ python/convertrules.py | 8 ++++++++ scm/lily-library.scm | 5 ----- scm/lily.scm | 3 --- 13 files changed, 20 insertions(+), 101 deletions(-) diff --git a/Documentation/changes.tely b/Documentation/changes.tely index dab40a3112..2b1a060f41 100644 --- a/Documentation/changes.tely +++ b/Documentation/changes.tely @@ -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 diff --git a/Documentation/usage/running.itely b/Documentation/usage/running.itely index 5bae43cb1e..76d6823b9e 100644 --- a/Documentation/usage/running.itely +++ b/Documentation/usage/running.itely @@ -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 diff --git a/lily/include/program-option.hh b/lily/include/program-option.hh index ae131d3f5d..83526816de 100644 --- a/lily/include/program-option.hh +++ b/lily/include/program-option.hh @@ -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); diff --git a/lily/music-scheme.cc b/lily/music-scheme.cc index 3412e73b56..dc2d9a6aa2 100644 --- a/lily/music-scheme.cc +++ b/lily/music-scheme.cc @@ -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 (); } diff --git a/lily/music-sequence.cc b/lily/music-sequence.cc index 7ab62470b5..b40597df24 100644 --- a/lily/music-sequence.cc +++ b/lily/music-sequence.cc @@ -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); diff --git a/lily/program-option-scheme.cc b/lily/program-option-scheme.cc index 616e99397a..302b48e3f4 100644 --- a/lily/program-option-scheme.cc +++ b/lily/program-option-scheme.cc @@ -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; diff --git a/lily/relative-octave-music.cc b/lily/relative-octave-music.cc index 94f566357c..2f31e20a22 100644 --- a/lily/relative-octave-music.cc +++ b/lily/relative-octave-music.cc @@ -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; } diff --git a/lily/repeated-music.cc b/lily/repeated-music.cc index 13e12df2a4..78ffd6b880 100644 --- a/lily/repeated-music.cc +++ b/lily/repeated-music.cc @@ -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) { diff --git a/ly/declarations-init.ly b/ly/declarations-init.ly index c2bdb96b70..f37103c9a9 100644 --- a/ly/declarations-init.ly +++ b/ly/declarations-init.ly @@ -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) diff --git a/ly/init.ly b/ly/init.ly index 8e8a2fc212..3be64edb7f 100644 --- a/ly/init.ly +++ b/ly/init.ly @@ -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)) diff --git a/python/convertrules.py b/python/convertrules.py index a1c8d507a6..274313b260 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -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, diff --git a/scm/lily-library.scm b/scm/lily-library.scm index c6b8dd2a9e..736d0c3810 100644 --- a/scm/lily-library.scm +++ b/scm/lily-library.scm @@ -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"))) diff --git a/scm/lily.scm b/scm/lily.scm index 1c9353ff59..c1f8f1fe34 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -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" -- 2.39.2