From 66331c5dd92bbe2926a8566e0a2defc4834b5967 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Tue, 26 Aug 2003 10:12:14 +0000 Subject: [PATCH] * lily/my-lily-lexer.cc (start_main_input): define input-file-name as Scheme variable. * scripts/convert-ly.py (conv): dashes rule. Apply rule. --- ChangeLog | 4 +++ input/mutopia/R.Schumann/romanze-op28-2.ly | 4 +-- input/regression/apply-output.ly | 12 ++++----- input/regression/chord-name-exceptions.ly | 2 +- input/regression/font-magnification.ly | 2 +- input/regression/new-markup-syntax.ly | 2 +- input/regression/output-property.ly | 2 +- input/test/add-text-script.ly | 2 +- input/test/boxed-molecule.ly | 4 +-- input/test/chord-names-jazz.ly | 24 ++++++++--------- input/test/dynamic-extra.ly | 2 +- input/test/move-specific-text.ly | 2 +- input/test/trill.ly | 2 +- lily/arpeggio.cc | 6 +++-- lily/lexer.ll | 6 ++++- lily/my-lily-lexer.cc | 4 +++ ly/chord-modifiers-init.ly | 28 ++++++++++---------- ly/engraver-init.ly | 6 ++--- ly/init.ly | 4 ++- ly/property-init.ly | 8 +++--- scm/define-grobs.scm | 2 +- scm/font.scm | 30 ---------------------- scripts/convert-ly.py | 25 +++++++++--------- 23 files changed, 85 insertions(+), 98 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd66ccd1bd..d81224c876 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ 2003-08-26 Han-Wen Nienhuys + * lily/my-lily-lexer.cc (start_main_input): define input-file-name + as Scheme variable. + * scripts/convert-ly.py (conv): dashes rule. + Apply rule. * Documentation/user/lilypond-book.itely: syntax fixes. diff --git a/input/mutopia/R.Schumann/romanze-op28-2.ly b/input/mutopia/R.Schumann/romanze-op28-2.ly index c3239c8a09..acff585107 100644 --- a/input/mutopia/R.Schumann/romanze-op28-2.ly +++ b/input/mutopia/R.Schumann/romanze-op28-2.ly @@ -165,8 +165,8 @@ lefta = \notes \transpose c cis { es' des'4^1~ \stemDown des'8.[ c'16] } } \transpose c' c, { - g4(-4 a8-3~a f-5 g-4 | a4-3 g8\markup { \finger "4-3" } ~g f-4 e-5 | - d4)\markup { \finger "4-5" }( g8-3~g es f-4 | g4-3 f8-4~f es d-4 | + g4(-4 a8-3~a f-5 g-4 | a4-3 g8-\markup { \finger "4-3" } ~g f-4 e-5 | + d4)-\markup { \finger "4-5" }( g8-3~g es f-4 | g4-3 f8-4~f es d-4 | c4) r8 f4-4( as8-5~ | as g-4 b)-5 as4-5( ces'8-4~ | ces' b des'-4 c'4)-5( <>8 | \stemDown \tieDown des'4.)_5~des'~ | diff --git a/input/regression/apply-output.ly b/input/regression/apply-output.ly index 4077e2519c..cd4bf3728c 100644 --- a/input/regression/apply-output.ly +++ b/input/regression/apply-output.ly @@ -20,16 +20,16 @@ position. (if (and (memq 'note-head-interface ifs) (memq sp '(-2 -3 -5))) (begin - (ly:set-grob-property! gr 'molecule-callback brew-new@\markup-molecule) + (ly:set-grob-property! gr 'molecule-callback brew-new-markup-molecule) (ly:set-grob-property! gr 'font-family 'roman) (ly:set-grob-property! gr 'text - (make-raise@\markup -0.5 + (make-raise-markup -0.5 (case sp - ((-5) (make-simple@\markup "m")) - ((-3) (make-simple@\markup "c ")) - ((-2) (make-smaller@\markup (make-bold@\markup "2"))) - (else (make-simple@\markup "bla")) + ((-5) (make-simple-markup "m")) + ((-3) (make-simple-markup "c ")) + ((-2) (make-smaller-markup (make-bold-markup "2"))) + (else (make-simple-markup "bla")) )))) ))) diff --git a/input/regression/chord-name-exceptions.ly b/input/regression/chord-name-exceptions.ly index d93ff544b7..4655cbc9b0 100644 --- a/input/regression/chord-name-exceptions.ly +++ b/input/regression/chord-name-exceptions.ly @@ -24,7 +24,7 @@ adds the new exceptions to the default ones, which are defined in % 7sus4 denoted with ^7 wahh chExceptionMusic = \notes { - <>1\markup { \super "7" "wahh" }} + <>1-\markup { \super "7" "wahh" }} % add to existing exceptions. chExceptions = #(append diff --git a/input/regression/font-magnification.ly b/input/regression/font-magnification.ly index 678604505f..3e739b36f6 100644 --- a/input/regression/font-magnification.ly +++ b/input/regression/font-magnification.ly @@ -12,7 +12,7 @@ c4 c4-"normal" % why doesn't this work? - c4\markup \bold \magnify #2.0 "foobar" + c4-\markup \bold \magnify #2.0 "foobar" \property Voice .NoteHead \set #'font-magnification = #1.2 \property Voice.TextScript \set #'font-magnification = #2.0 diff --git a/input/regression/new-markup-syntax.ly b/input/regression/new-markup-syntax.ly index 7353ec2a49..ec0eed659f 100644 --- a/input/regression/new-markup-syntax.ly +++ b/input/regression/new-markup-syntax.ly @@ -8,7 +8,7 @@ texidoc = "New markup syntax." \score { \notes { - f'\markup { + f'-\markup { foo \raise #0.2 \hbracket \bold bar \override #'(baseline-skip . 4) diff --git a/input/regression/output-property.ly b/input/regression/output-property.ly index 9efd4cfadc..c21b5d8a30 100644 --- a/input/regression/output-property.ly +++ b/input/regression/output-property.ly @@ -20,7 +20,7 @@ possible to use @code{\override} would shift both texts. \notes\relative c''' { a^"two"^"m.d." \context Voice - \outputproperty #(make-text-checker (make-simple@\markup "m.d.")) + \outputproperty #(make-text-checker (make-simple-markup "m.d.")) #'extra-offset = #'(-4.0 . -3.5) a^"two"^"m.d." a^"two"^"m.d." diff --git a/input/test/add-text-script.ly b/input/test/add-text-script.ly index 8ae76b9dba..d1f6c661f3 100644 --- a/input/test/add-text-script.ly +++ b/input/test/add-text-script.ly @@ -13,7 +13,7 @@ create, then write a function that will build the structure for you. #(define (make-text-script x) (let ((m (make-music-by-name 'TextScriptEvent))) (ly:set-mus-property! m 'direction DOWN) - (ly:set-mus-property! m 'text (make-simple@\markup x)) + (ly:set-mus-property! m 'text (make-simple-markup x)) m)) #(define (add-text-script m x) diff --git a/input/test/boxed-molecule.ly b/input/test/boxed-molecule.ly index db880634c7..fd873045d8 100644 --- a/input/test/boxed-molecule.ly +++ b/input/test/boxed-molecule.ly @@ -9,7 +9,7 @@ arbitrary grobs. " } \score { \notes \relative c'' { \property Voice.TextScript \override #'molecule-callback = - #(make-molecule-boxer 0.1 0.3 0.2 brew-new@\markup-molecule) + #(make-molecule-boxer 0.1 0.3 0.2 brew-new-markup-molecule) c'4^"foo" @@ -17,7 +17,7 @@ arbitrary grobs. " } #(make-molecule-boxer 0.05 0.25 0.25 Stem::brew_molecule) \property Score.RehearsalMark \override #'molecule-callback = - #(make-molecule-boxer 0.15 0.3 0.3 brew-new@\markup-molecule) + #(make-molecule-boxer 0.15 0.3 0.3 brew-new-markup-molecule) c8 \property Voice.Stem \revert #'molecule-callback diff --git a/input/test/chord-names-jazz.ly b/input/test/chord-names-jazz.ly index ba9ad70401..0fa2be4830 100644 --- a/input/test/chord-names-jazz.ly +++ b/input/test/chord-names-jazz.ly @@ -67,29 +67,29 @@ chs = \notes \transpose c' c' efullmusicJazzAlt = \notes { - <>1\markup { "+" } - <>\markup { \normal-size-super + <>1-\markup { "+" } + <>-\markup { \normal-size-super % \override #'(font-family . math) "N" } \override #'(font-family . math) "M" } %%c:3.5.7 = \markup { \override #'(font-family . math) "M" } %%c:3.5.7 = \markup { \normal-size-super "maj7" } - <>\markup { \super "o" } % should be $\circ$ ? - <>\markup { \super \combine "o" "/" } - <>\markup { \super "o7" } + <>-\markup { \super "o" } % should be $\circ$ ? + <>-\markup { \super \combine "o" "/" } + <>-\markup { \super "o7" } } efullJazzAlt = #(sequential-music-to-chord-exceptions efullmusicJazzAlt #f) epartialmusicJazzAlt = \notes{ - <>1\markup { \normal-size-super "2" } - <>\markup { "m" } - <>\markup { \normal-size-super "sus4" } - <>\markup { \normal-size-super "5" } + <>1-\markup { \normal-size-super "2" } + <>-\markup { "m" } + <>-\markup { \normal-size-super "sus4" } + <>-\markup { \normal-size-super "5" } %% TODO, partial exceptions - <>\markup { "m" }\markup { \normal-size-super "sus4" } - <>\markup { "m" }\markup { \normal-size-super "sus2" } + <>-\markup { "m" }-\markup { \normal-size-super "sus4" } + <>-\markup { "m" }-\markup { \normal-size-super "sus2" } } epartialJazzAlt = #(sequential-music-to-chord-exceptions epartialmusicJazzAlt #f) @@ -98,7 +98,7 @@ jazzAltProperties = \sequential { \property ChordNames.majorSevenSymbol = #whiteTriangleMarkup - \property ChordNames.chordNameSeparator = #(make-simple@\markup "/") + \property ChordNames.chordNameSeparator = #(make-simple-markup "/") \property ChordNames.chordNameExceptionsFull = #efullJazzAlt \property ChordNames.chordNameExceptionsPartial = #epartialJazzAlt \property ChordNames.chordNameFunction = #jazz-chord-names diff --git a/input/test/dynamic-extra.ly b/input/test/dynamic-extra.ly index 4814204ada..86ee253f8c 100644 --- a/input/test/dynamic-extra.ly +++ b/input/test/dynamic-extra.ly @@ -9,7 +9,7 @@ piuf = \markup { \italic "pi\\`u" \dynamic "f" } \score{ \notes\relative c''{ - c\piuf + c-\piuf c c2\< c2\! diff --git a/input/test/move-specific-text.ly b/input/test/move-specific-text.ly index d3138d529f..662f108e51 100644 --- a/input/test/move-specific-text.ly +++ b/input/test/move-specific-text.ly @@ -11,7 +11,7 @@ move text around. " } \score { \notes\relative c''' { \property Voice.Stem \set #'direction = #1 - \outputproperty #(make-text-checker (make-simple@\markup "m.d.")) + \outputproperty #(make-text-checker (make-simple-markup "m.d.")) #'extra-offset = #'(-3.5 . -4.5) a^2^"m.d." } diff --git a/input/test/trill.ly b/input/test/trill.ly index 9bfdd7052e..65845ebc89 100644 --- a/input/test/trill.ly +++ b/input/test/trill.ly @@ -18,7 +18,7 @@ Show trill line type. " \property Voice.TextSpanner \set #'style = #'trill \property Voice.TextSpanner \set #'edge-height = #'(0 . 0) \property Voice.TextSpanner \set #'edge-text - = #(cons (make-musicglyph@\markup "scripts-trill") "") + = #(cons (make-musicglyph-markup "scripts-trill") "") a#(ly:export (make-span-event 'TextSpanEvent START)) b c a #(ly:export (make-span-event 'TextSpanEvent STOP)) } \paper { raggedright = ##t} diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc index bdeabba728..08d9430544 100644 --- a/lily/arpeggio.cc +++ b/lily/arpeggio.cc @@ -56,10 +56,12 @@ Arpeggio::brew_molecule (SCM smob) if (heads.empty_b ()) { - programming_error ("Huh? Dumb blonde encountered?"); /* - Nee Valerie, jij bent _niet_ dom. + Dumb blonde error + + :-) */ + programming_error ("Huh, no heads for arpeggio found."); return SCM_EOL; } diff --git a/lily/lexer.ll b/lily/lexer.ll index baa1d6f0f0..a9163c51b6 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -179,7 +179,11 @@ HYPHEN -- s = s.left_string (s.index_last ('\"')); yy_pop_state(); - this->here_input().source_file_->name_ = s; + this->here_input().source_file_->name_ = s; + scm_module_define (gh_car (scopes_), + ly_symbol2scm ("input-file-name"), + scm_makfrom0str (s.to_str0())); + } . { diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index 5e4e92e5c8..d84f6f4e52 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -156,6 +156,10 @@ My_lily_lexer::start_main_input () { new_input (main_input_string_, &global_input_file->sources_); allow_includes_b_ = allow_includes_b_ && ! (safe_global_b); + + scm_module_define (gh_car (scopes_), + ly_symbol2scm ("input-file-name"), + scm_makfrom0str (main_input_string_.to_str0())); } void diff --git a/ly/chord-modifiers-init.ly b/ly/chord-modifiers-init.ly index c12446db3d..a5c99754cc 100644 --- a/ly/chord-modifiers-init.ly +++ b/ly/chord-modifiers-init.ly @@ -2,31 +2,31 @@ \chordmodifiers #default-chord-modifier-list -whiteTriangleMarkup = #(make-override@\markup - '(font-family . math) (make-simple@\markup "M")) +whiteTriangleMarkup = #(make-override-markup + '(font-family . math) (make-simple-markup "M")) -blackTriangleMarkup = #(make-override@\markup - '(font-family . math) (make-simple@\markup "N")) +blackTriangleMarkup = #(make-override-markup + '(font-family . math) (make-simple-markup "N")) ignatzekExceptionMusic = \notes{ - <>1\markup { "+" } - <>\markup { \super "o" } % should be $\circ$ ? - <>\markup { \super \combine "o" "/" } - <>\markup { \super "o7" } + <>1-\markup { "+" } + <>-\markup { \super "o" } % should be $\circ$ ? + <>-\markup { \super \combine "o" "/" } + <>-\markup { \super "o7" } } ignatzekExceptions = #(sequential-music-to-chord-exceptions ignatzekExceptionMusic #t) partialJazzMusic = \notes{ - <>1\markup { \normal-size-super "2" } - <>\markup { "m" } - <>\markup { \normal-size-super "sus4" } - <>\markup { \normal-size-super "5" } + <>1-\markup { \normal-size-super "2" } + <>-\markup { "m" } + <>-\markup { \normal-size-super "sus4" } + <>-\markup { \normal-size-super "5" } %% TODO, partial exceptions - <>\markup { "m" }\markup { \normal-size-super "sus4" } - <>\markup { "m" }\markup { \normal-size-super "sus2" } + <>-\markup { "m" }-\markup { \normal-size-super "sus4" } + <>-\markup { "m" }-\markup { \normal-size-super "sus2" } } %% TODO: compatibility ignatzek code diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 636e119dfd..3598f76bcc 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -503,7 +503,7 @@ ScoreContext = \translator { %% chord names: chordNameFunction = #ignatzek-chord-names majorSevenSymbol = #whiteTriangleMarkup - chordNameSeparator = #(make-simple@\markup "/") + chordNameSeparator = #(make-simple-markup "/") chordNameExceptions = #ignatzekExceptions chordNoteNamer = #'() chordRootNamer = #note-name->markup @@ -521,8 +521,8 @@ ScoreContext = \translator { tablatureFormat = #fret-number-tablature-format %% - bassFigureFormatFunction = #make-bass-figure@\markup - metronomeMarkFormatter = #make-metronome@\markup + bassFigureFormatFunction = #make-bass-figure-markup + metronomeMarkFormatter = #make-metronome-markup \grobdescriptions #all-grob-descriptions } diff --git a/ly/init.ly b/ly/init.ly index bc66f5aaaf..ce58a26a4d 100644 --- a/ly/init.ly +++ b/ly/init.ly @@ -16,4 +16,6 @@ #(if (and (ly:get-option 'old-relative) (not (ly:get-option 'old-relative-used))) - (ly:warn "Old relative compatibility was not used.")) + (ly:warn (string-append + "\n" + input-file-name ": old relative compatibility was not used."))) diff --git a/ly/property-init.ly b/ly/property-init.ly index a5b3a1705f..5ab7062c3d 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -255,10 +255,10 @@ unHideNotes = \sequential { } germanChords = { - \property ChordNames. chordRootNamer = #(chord-name->german@\markup #t) - \property ChordNames. chordNoteNamer = #note-name->german@\markup + \property ChordNames. chordRootNamer = #(chord-name->german-markup #t) + \property ChordNames. chordNoteNamer = #note-name->german-markup } semiGermanChords = { - \property ChordNames. chordRootNamer = #(chord-name->german@\markup #f) - \property ChordNames. chordNoteNamer = #note-name->german@\markup + \property ChordNames. chordRootNamer = #(chord-name->german-markup #f) + \property ChordNames. chordNoteNamer = #note-name->german-markup } diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 8e6e40576b..697d3d19ce 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -1205,7 +1205,7 @@ (molecule-callback . ,Volta_bracket_interface::brew_molecule) (direction . 1) (padding . 1) - (font-style . volta) + (font-family . number) (Y-offset-callbacks . (,Side_position_interface::aligned_side)) (thickness . 1.6) ; stafflinethickness (height . 2.0) ; staffspace; diff --git a/scm/font.scm b/scm/font.scm index 2fdf3adb6e..025f8f9903 100644 --- a/scm/font.scm +++ b/scm/font.scm @@ -6,10 +6,6 @@ ;;; (c) 2000--2003 Jan Nieuwenhuizen ;;; -(define style-to-font-alist - `( -)) - (define (font-field name font-descr) (list-ref font-descr @@ -317,32 +313,6 @@ and warn if the selected font is not unique. (list (cons markup #t)))))) -; fixme, how's this supposed to work? -; and why don't we import font-setting from elt? -(define (style-to-font-name sheet style) - (let* ((entry (assoc style style-to-font-alist)) - (qualifiers (if entry (cdr entry) '())) - (font (find-first-font qualifiers sheet)) - (err (current-error-port)) - ) - - (if (equal? font "") - (begin - (display "\ncouldn't find any font satisfying " err) - (write qualifiers err) - "cmr10" - ) - font) ; return the topmost. - )) - -(if #f (begin - (define (test-module) - (display (filter pair? '(1 2 (1 2) (1 .2))) - (display (filter-field 'font-name 'cmbx paper20-style-sheet-alist)) - - (display (style-to-font-name 'paper20 'large))) - ))) - ;;; ascii-script font init (define as-font-sheet-alist '((as5 . (((* * * braces *) . ("as-braces9")) diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index efb0f20d09..dc9f1da69b 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -1405,18 +1405,19 @@ if 1: conversions.append (((1,9,0), conv, """New relative mode, Postfix articulations, new chord syntax.""")) -def conv (str): - str = re.sub ('-\\markup', '@\\markup', str) - str = re.sub (r'-\\', r'\\', str) - str = re.sub (r'-\)', ')', str) - str = re.sub (r'-\(', '(', str) - str = re.sub ('-\[', '[', str) - str = re.sub ('-\]', ']', str) - str = re.sub ('-~', '~', str) - str = re.sub ('@\\markup', r'-\\markup', str) - return str - -conversions.append (((1,9,1), conv, """Remove - before articulation""")) +if 1: + def conv (str): + str = re.sub (r'-\\markup', r'@\\markup', str) + str = re.sub (r'-\\', r'\\', str) + str = re.sub (r'-\)', ')', str) + str = re.sub (r'-\(', '(', str) + str = re.sub ('-\[', '[', str) + str = re.sub ('-\]', ']', str) + str = re.sub ('-~', '~', str) + str = re.sub (r'@\\markup', r'-\\markup', str) + return str + + conversions.append (((1,9,1), conv, """Remove - before articulation""")) ################################ # END OF CONVERSIONS -- 2.39.2