]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/include/file-results.hh (class Input_file_settings):
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 15 Aug 2002 00:16:25 +0000 (00:16 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 15 Aug 2002 00:16:25 +0000 (00:16 +0000)
encapsulate file settings in a class, Input_file_settings.

* lily/scores.cc: new function ly_set_point_and_click_x

38 files changed:
ChangeLog
Documentation/user/refman.itely
Documentation/user/tutorial.itely
input/les-nereides.ly
input/mutopia/F.Schubert/standchen.ly
input/mutopia/J.S.Bach/Petites-Preludes/preludes-1.ly
input/mutopia/J.S.Bach/Petites-Preludes/preludes-2.ly
input/mutopia/J.S.Bach/Petites-Preludes/preludes-3.ly
input/mutopia/J.S.Bach/Petites-Preludes/preludes-4.ly
input/mutopia/J.S.Bach/Petites-Preludes/preludes-5.ly
input/mutopia/J.S.Bach/Petites-Preludes/preludes-6.ly
input/mutopia/J.S.Bach/baerenreiter-sarabande.ly
input/mutopia/J.S.Bach/wtk1-fugue1.ly
input/mutopia/W.A.Mozart/mozart-hrn3-defs.ly
input/regression/pc-mmrest.ly
input/tutorial/miniatures.ly
input/tutorial/os-flute-2.ly
input/tutorial/os-score.ly
lily/grob.cc
lily/include/file-results.hh
lily/include/lily-proto.hh
lily/include/main.hh
lily/include/my-lily-parser.hh
lily/include/paper-def.hh
lily/include/score.hh
lily/lexer.ll
lily/my-lily-lexer.cc
lily/my-lily-parser.cc
lily/paper-def.cc
lily/paper-score.cc
lily/parser.yy
lily/performance.cc
lily/score.cc
lily/scores.cc
lily/system.cc
scm/ps.scm
scm/tex.scm
scripts/convert-ly.py

index 8e8cf6ff687786d9eedd18e1d4882efabed8d962..50370331e3fa23f39e8f25669643f3d8fb5c8e98 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2002-08-15  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * lily/include/file-results.hh (class Input_file_settings):
+       encapsulate file settings in a class, Input_file_settings.
+
+       * lily/scores.cc: new function ly_set_point_and_click_x
+       
+       * Documentation/topdocs/README.texi (Top): add note about xdelta
+
+       * Documentation/topdocs/INSTALL.texi (Top): move kpathsea to problems
+       section.
+       
 2002-08-14  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * scripts/ly2dvi.py: Remove debug printing.
index 8086da140e2864aa7f1ef30af2311428df060f4d..40939ff3c74626bd2d330145b8daf48407c34e9c 100644 (file)
@@ -632,14 +632,20 @@ To use it, you need the following software
   a few versions behind the official Xdvi. To find out which xdvi you
   are running, try @code{xdvi -version} or @code{xdvi.bin -version}.
 @item KDVI.  A dvi viewer for KDE.  You need KDVI from KDE 3.0 or
-newer.  Enablle the menu Settings -> Inverse search. 
+newer.  Enable option @emph{Inverse search} in the menu @emph{Settings}.
 
 @cindex Xdvi
 @cindex KDVI
 @cindex KDE
 
+
+
 @end itemize
-@item An editor with a client/server interface (or a lightweight GUI editor).
+@item An editor with a client/server interface (or a lightweight GUI
+editor).
+
+@cindex editor
+
 @itemize @bullet
 @item Emacs. Emacs is an extensible text-editor.  It is available from
 @uref{http://www.gnu.org/software/emacs/}.  You need version 21 to use
@@ -682,7 +688,7 @@ fonts. Refer to the Xdvi documentation for more information.
 To use point-and-click, add one of these lines to the top of your .ly
 file.
 @example
-#(set! point-and-click line-location)
+#(set-point-and-click! 'line)
 @end example
 @cindex line-location
 
@@ -722,7 +728,7 @@ apply @file{server.el.patch} (version 21.2 and earlier).  At the top
 of the @code{ly} file, replace the @code{set!} line with the following
 line,
 @example
-#(set! point-and-click line-column-location)
+#(set-point-and-click! 'line-column)
 @end example
 @cindex line-colomn-location
 and set @code{XEDITOR} to @code{emacsclient --no-wait +%l:%c %f}.
index 31efc44306bd11d35afd45f17de398500f899b11..7a292eacb3c7568e5213af7f13447bccfb5c2575 100644 (file)
@@ -1573,7 +1573,7 @@ Opus 2.
 For example, consider the following file (@file{miniatures.ly}) 
 
 @example
-\version "1.5.60"
+\version "1.5.72"
 \header @{
   title = "Two miniatures"
   composer = "F. Bar Baz" 
@@ -1706,7 +1706,7 @@ will be at the left.
 
 
 @example
-\version "1.5.60"
+\version "1.5.72"
 \header @{
   title = "Two miniatures"
   composer = "F. Bar Baz" 
@@ -1731,7 +1731,7 @@ will be at the left.
 
 @separate
 @example 
-\version "1.6.0"
+\version "1.5.72"
 @end example 
 Lilypond and its language are still under development, and
 occasionally, details of the syntax are changed. This fragment
@@ -2383,7 +2383,7 @@ conductor's score.
 \include "os-music.ly"
 \include "paper13.ly"
 
-#(set! point-and-click line-column-location)
+#(set-point-and-click! 'line-column)
 #(define text-flat '((font-relative-size . -2)
          (music "accidentals--1")))
 
@@ -2468,12 +2468,12 @@ First, we need to include the music definitions we made in
 
 @separate
 @example
-#(set! point-and-click line-column-location)
+#(set-point-and-click! 'line-column)
 @end example
 
-This piece of Scheme code sets the Scheme variable
-@code{point-and-click} to the value @var{line-column-location} (which
-itself is a Scheme procedure).
+This piece of Scheme code executes the function
+@code{set-point-and-click!}, with the argument @code{line-column}, a
+symbol).
 
 Editing input files can be complicated if you're working with large
 files: if you're digitizing existing music, you have to synchronize
index 63ac72d4461fccc3f3ef1588d68a97189e451a3d..b801e9bfc1ea17dbeb13637728ef17a20203dd4f 100644 (file)
@@ -1,4 +1,4 @@
-\version "1.5.68"
+\version "1.5.72"
 
 \header {
     composer =   "ARTHUR GRAY"
@@ -10,6 +10,7 @@
     description = "Nastiest piece of competition at http://www.orphee.com/comparison/study.html, see http://www.orphee.com/comparison/gray.pdf"
 }
 
+#(set-point-and-click! 'line-column)
 #(set! point-and-click line-column-location)
 
 #(define (make-text-checker text)
index 639d37b5bd8d936b743c1cd1e33452eeaaff7eaf..812702c86b62319c7fe54f54ba74b4afd453ebf9 100644 (file)
@@ -1,5 +1,5 @@
 
-#(set! point-and-click line-column-location)
+#(set-point-and-click! 'line-column)
 
 instrument = "Piano"
 
@@ -41,7 +41,7 @@ instrument = "Piano"
  footer = "Mutopia-2001/04/27-xx"
 } 
 
-\version "1.5.68"
+\version "1.5.72"
 
 dynamicUp = \property Voice.DynamicLineSpanner \override #'direction = #1
 dynamicRevert = \property Voice.DynamicLineSpanner \revert #'direction
index 6929f205db400974311820f6655a61b88596c256..edc1f9b2e4650af71d6afd6447908e8f058328fe 100644 (file)
@@ -1,4 +1,4 @@
-#(set! point-and-click line-column-location)
+#(set-point-and-click! 'line-column)
 
 opus = "BWV 924"
 piece = "1"
@@ -18,7 +18,7 @@ Lemoine puts fermatas on ending bar lines everywhere.
 
 
 
-\version "1.5.68"
+\version "1.5.72"
 
 
 lowstaff =  \translator "Staff" = "lower"
index da564a4ea11b1f3c0328ded5559f7f04d201770d..db203fce4ea6429c22ebd2a77198caaaca1a3d22 100644 (file)
@@ -1,10 +1,10 @@
-#(set! point-and-click line-column-location)
+#(set-point-and-click! 'line-column)
 
 opus= "BWV 939"
 piece = "2"
 
 
-\version "1.5.68"
+\version "1.5.72"
 upper =  \context Staff \notes\relative c{
        \context Voice=i
        \property Voice.TextScript \set #'font-style = #'italic
index 75967087e96c1d87887a882211d41f15a25795a3..45681e07d3000572f2c9d1f2102d835e88c59198 100644 (file)
@@ -1,4 +1,4 @@
-#(set! point-and-click line-column-location)
+#(set-point-and-click! 'line-column)
 
 opus= "BWV 999"
 piece = "3"
@@ -14,7 +14,7 @@ note, some have dotted half notes.
 This file was partly generated using m4.
 %}
 
-\version "1.5.68"
+\version "1.5.72"
 
 
 upper =   \notes \transpose c'' {
index 8fbe892a5fd310fce436a88795dbc136f91aa1f0..7fd814331ac65f6b1e27a7760e4b400ec7e158fc 100644 (file)
@@ -1,9 +1,9 @@
-#(set! point-and-click line-column-location)
+#(set-point-and-click! 'line-column)
 
 opus = "BWV 925"
 piece = "4"
 
-\version "1.5.68"
+\version "1.5.72"
 
 %{
 
index 9ba8f523e2c8d005d88d139c129d4ec59ef9cc34..a1b45db8f2666c72183077ec9f3c1176a980df65 100644 (file)
@@ -1,9 +1,9 @@
-#(set! point-and-click line-column-location)
+#(set-point-and-click! 'line-column)
 
 piece = "5"
 opus = "BWV 926"
 
-\version "1.5.68"
+\version "1.5.72"
 
 upper =  \context Staff \notes\relative c
        \context Voice=i {
index c9ae424b197cf3fd41723c61d9ac9b2bc56ccfda..d678d0b14ff8f721406b8097689d11d016ba12f0 100644 (file)
@@ -1,9 +1,9 @@
-#(set! point-and-click line-column-location)
+#(set-point-and-click! 'line-column)
 
 opus = "BWV 940"
 piece = "6"
 
-\version "1.5.68"
+\version "1.5.72"
 
 
 
index 2f00f25f85c612c13a3b88e0dcbf294949333d16..0c8172b9df159838f30947b00effe8070404e62f 100644 (file)
@@ -1,6 +1,6 @@
-\version "1.5.68"
+\version "1.5.72"
 
-#(set! point-and-click line-column-location)
+#(set-point-and-click! 'line-column)
 
 forcedBreak = \notes { }
 %%forcedBreak = \notes { \break }
index 896656baf6b46ece564b6202f02baf66b27a8935..0a6303a8526ad21453e0202ed0877b9423f0f2e7 100644 (file)
@@ -19,9 +19,9 @@ enteredby =    "Shay Rojansky"
 %{
 TODO: use autobeaming. 
 %}
-\version "1.5.68"
+\version "1.5.72"
 
-% #(set! point-and-click line-column-location)
+% #(set-point-and-click! 'line-column)
 
 tenor = 
        \context Voice  = tenor  \notes \relative c' {
index d5ae59b1b81a2a21f52eedab0ebcbc5ff181affa..5378aab22605afbef8d95b53feb8b6856a310418 100644 (file)
@@ -1,12 +1,12 @@
 
 
-% #(set! point-and-click line-column-location)
+% #(set-point-and-click! 'line-column)
 
 longgrace = \property Voice.Stem \override #'flag-style = #'()
 endlonggrace = \property Voice.Stem \revert #'flag-style
 ritenuto = \textscript #'(italic  "rit.")
 
-\version "1.5.68"
+\version "1.5.72"
 
 #(define italic-bf '((font-shape . italic) (font-series . bold)))
 
index f29a3b878ae05a7947292509f1e29b83bd124bac..48a3a13a4028cf3a9a7c43d90b34a9bcbc2e124f 100644 (file)
@@ -1,10 +1,10 @@
-\version "1.5.68"
+\version "1.5.72"
 \header {
 texidoc="Multi measure rests of second voice should not disappear."
 }
 
 
-#(set! point-and-click line-column-location)
+#(set-point-and-click! 'line-column)
 one = \notes\relative c'' {
 
        f4 \!e-.\f r2|
index 6150bb2b30b3ff146c3245749b0193eb34dc2c96..c7d27f5f1d1b39619aac3c8cb9da13fa230e75d8 100644 (file)
@@ -1,10 +1,10 @@
-\version "1.5.68"
+\version "1.5.72"
 \header {
   title = "Two miniatures"
   tagline = "Small is beatiful"
 }
 
-#(set! point-and-click line-column-location)
+#(set-point-and-click! 'line-column)
 
 \paper { linewidth = -1.0 }
 
index fe890a021fe8646df9ac65b7ed05fcbae3fae15f..8586e975895a9d7cd162802abc6b3836a0dbee6d 100644 (file)
@@ -1,4 +1,4 @@
-\version "1.5.68"
+\version "1.5.72"
 
 \include "os-music.ly"
 \include "paper16.ly"
@@ -26,4 +26,4 @@
 
 % switch off settings of -score file, so the rest of the
 % tutorial isn't \special
-#(set! point-and-click #f)
+#(set-point-and-click! 'none)
index bab0b5270d00d565fe6d82a17bbd778f5bbd7c00..2d923dad799ae861798b96396e4d35a046ec9b1d 100644 (file)
@@ -1,10 +1,10 @@
 
-\version "1.5.68"
+\version "1.5.72"
 
 \include "os-music.ly"
 \include "paper13.ly"
 
-#(set! point-and-click line-column-location)
+#(set-point-and-click! 'line-column)
 #(define text-flat '((font-relative-size . -2) (music "accidentals--1")))
 
 \score {
index 883b0ce04608286df841a3881668b3cb7dfe44b3..9c8833f8f38dac3aec37551bffbf72afc02b813c 100644 (file)
@@ -260,14 +260,15 @@ Grob::get_uncached_molecule ()const
     {
       SCM origin = ly_symbol2scm ("no-origin");
       
-      if (store_locations_global_b){
-       SCM cause = get_grob_property ("cause");
-       if (Music*m = unsmob_music (cause))
-         {
-           SCM music_origin = m->get_mus_property ("origin");
-           if (unsmob_input (music_origin))
-             origin = music_origin;
-         }
+      if (store_locations_global_b)
+       {
+         SCM cause = get_grob_property ("cause");
+         if (Music*m = unsmob_music (cause))
+           {
+             SCM music_origin = m->get_mus_property ("origin");
+             if (unsmob_input (music_origin))
+               origin = music_origin;
+           }
       }
 
       // ugr.
index af58d0d2a49900249d5060584d172ddca1ddb932..890dedaa1388b508189f1213109e29ca6e2374da 100644 (file)
@@ -9,15 +9,31 @@
 
 #ifndef FILE_RESULTS_HH
 #define FILE_RESULTS_HH
-#include "flower-proto.hh"
+
+#include "lily-proto.hh"
+#include "source.hh"
+#include "parray.hh"
+#include "scm-hash.hh"
+
+class Input_file_settings
+{
+public:
+  Sources sources_;
+  Array<String> inclusion_names_;
+  Array<String> target_strings_;
+  Link_array<Score> scores_;
+  Scheme_hash_table * global_header_;
+
+  void do_deps( );
+  void do_scores();
+
+  Input_file_settings (String file,String init);
+  ~Input_file_settings();
+};
+
+extern Input_file_settings* global_input_file;
 
 void do_one_file (String init_string, String file_string);
-extern Scheme_hash_table *global_header;
-extern Array<String> target_string_globals;
-extern Array<String> inclusion_globals;
-extern Link_array<Score> score_globals;
-void do_scores ();
-void clear_scores ();
 
 
 #endif /* FILE_RESULTS_HH */
index a73992fe2b8fff877a6b9e013fe19b2a960b7402..e09de5f1f62896543dba3b628a4cea148b59af75 100644 (file)
@@ -68,6 +68,7 @@ class Hara_kiri_line_group_engraver;
 class Hyphen_req;
 
 class Includable_lexer;
+class Input_file_settings;
 class Input;
 class Item;
 class Key_change_req;
index 4d7cb1c00297b42cdc5ce29ff0f37087038f946d..8c1e55d19c2474cfb4c297b6f9161aa811315995 100644 (file)
@@ -42,6 +42,5 @@ extern All_font_metrics *all_fonts_global;
 extern int exit_status_global;
 extern File_path global_path;
 extern int score_count_global;
-extern Sources* source_global;
 
 #endif /* MAIN_HH */
index c30fca5742b5fc0a1a6adba7cfb72ee56bc005f8..38d39ac4c327624a11d3ead95d92c2f2fd764ba2 100644 (file)
@@ -30,7 +30,7 @@
 class My_lily_parser 
 {
 public:
-  My_lily_parser (Sources * sources);
+  My_lily_parser (Input_file_settings * sources);
   ~My_lily_parser ();
 
   void do_init_file ();
@@ -42,7 +42,7 @@ public:
   Scheme_hash_table *default_header_;
 
   int fatal_error_;
-  Sources * source_;
+  Input_file_settings * input_file_;
   int error_level_;
 
   My_lily_lexer * lexer_;
index 2744224538f9e9c447046386cb9985212854e482..b434c92759346c5c8768e568ad1fb97525c683ea 100644 (file)
@@ -48,8 +48,9 @@ class Paper_def : public Music_output_def
 protected:
   VIRTUAL_COPY_CONS (Music_output_def);
 
-
 public:    
+  Paper_outputter* get_paper_outputter () ;
+
   SCM font_descriptions ()const;
   virtual ~Paper_def ();
   static int score_count_;
@@ -70,7 +71,6 @@ public:
   virtual int get_next_score_count () const;
   static void reset_score_count ();
   void output_settings (Paper_outputter*) const;
-  Paper_outputter* get_paper_outputter () ;
 
   Font_metric * find_font (SCM name, Real mag);
   
index ff0a311243157aa952729c6a00967586389d5e5a..c401c57f73e8387f5640d1619ecf83322cf4904d 100644 (file)
@@ -23,7 +23,8 @@ public:
   Link_array<Music_output_def> defs_;
   SCM music_;
   Scheme_hash_table * header_;
-
+  Input_file_settings* input_file_;
+  
   int errorlevel_;
     
   /// construction
index c1451847d1234a28d8e8864d37c25ae3ef47ea95..e02376b9836000cde89a527f38aa10f5a78de2d8 100644 (file)
@@ -34,7 +34,7 @@
 #include "string.hh"
 #include "string-convert.hh"
 #include "my-lily-lexer.hh"
-#include "array.hh"
+#include "file-results.hh"
 #include "interval.hh"
 #include "lily-guile.hh"
 #include "parser.hh"
@@ -199,7 +199,7 @@ HYPHEN              --
        String s (YYText ()+1);
        s = s.left_string (s.index_last ('"'));
 
-       new_input (s,source_global);
+       new_input (s, &global_input_file->sources_ );
        yy_pop_state ();
 }
 <incl>\\{BLACK}*;?{WHITE} { /* got the include identifier */
@@ -210,7 +210,7 @@ HYPHEN              --
 
        SCM sid = lookup_identifier (s);
        if (gh_string_p (sid)) {
-               new_input (ly_scm2string (sid), source_global);
+               new_input (ly_scm2string (sid), &global_input_file->sources_);
                yy_pop_state ();
        } else { 
            String msg (_f ("wrong or undefined identifier: `%s'", s ));
index 538729df9df57e0d5f0ef40c7b869fc184e476be..121d676de18fe92cb5c3367d089de19de2db11ba 100644 (file)
@@ -13,7 +13,7 @@
 #include "lily-proto.hh"
 #include "scm-hash.hh"
 #include "interval.hh"
-
+#include "file-results.hh"
 #include "lily-guile.hh"
 #include "parser.hh"
 #include "keyword.hh"
@@ -126,7 +126,7 @@ My_lily_lexer::lookup_identifier (String s)
 void
 My_lily_lexer::start_main_input ()
 {  
-  new_input (main_input_string_, source_global);
+  new_input (main_input_string_, &global_input_file->sources_);
   allow_includes_b_ = allow_includes_b_ &&  ! (safe_global_b);
 }
 
index f79fee66601b413950fe7abd674a4ddada87ccb6..ee06d6bf3fd18565c3582dacc36e619b6760d63c 100644 (file)
@@ -15,9 +15,9 @@
 #include "file-results.hh"
 #include "scm-hash.hh"
 
-My_lily_parser::My_lily_parser (Sources * source)
+My_lily_parser::My_lily_parser (Input_file_settings * source)
 {
-  source_ = source;
+  input_file_ = source;
   lexer_ = 0;
   default_duration_ = Duration (2,0);
   error_level_ = 0;
@@ -44,7 +44,7 @@ My_lily_parser::parse_file (String init, String s)
   progress_indication (_ ("Parsing..."));
 
   set_yydebug (0);
-  lexer_->new_input (init, source_);
+  lexer_->new_input (init, &input_file_->sources_);
   do_yyparse ();
 
   progress_indication ("\n");
@@ -55,7 +55,7 @@ My_lily_parser::parse_file (String init, String s)
       error_level_ = 1;
     }
 
-  inclusion_globals = lexer_->filename_strings_;
+  input_file_->inclusion_names_ = lexer_->filename_strings_;
 
   error_level_ = error_level_ | lexer_->errorlevel_; // ugh naming.
 }
index 1dae6c8f721508b4aedf8def1569099dcbd542b4..03a4b322f88aacd4edb36b9ad6705913289b70ee 100644 (file)
@@ -122,7 +122,7 @@ Paper_def::get_paper_outputter ()
   progress_indication (_f ("paper output to `%s'...",
                           outname == "-" ? String ("<stdout>") : outname));
 
-  target_string_globals.push (outname);
+  global_input_file->target_strings_.push (outname);
   Paper_outputter * po = new Paper_outputter (outname);
   Path p = split_path (outname);
   p.ext = "";
index fc0c5933b549c266dbc6d1315543b952f4eaa279..eb30b41a8155b6c2bfcc23c2024b8baaeb47044f 100644 (file)
@@ -6,6 +6,7 @@
   (c) 1996--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
+#include "score.hh"
 #include "main.hh"
 #include "warn.hh"
 #include "font-metric.hh"
@@ -92,18 +93,17 @@ Paper_score::process ()
   system_->break_into_pieces (breaking);
   
   outputter_ = paper_->get_paper_outputter ();
-;
   outputter_->output_header ();
   outputter_->output_version ();
 
   progress_indication ("\n");
 
-  if (global_header)
+  if (global_input_file->global_header_)
     {
-
-      outputter_->output_scope (global_header, "lilypond");
-      outputter_->write_header_fields_to_file (global_header);
+      outputter_->output_scope (global_input_file->global_header_, "lilypond");
+      outputter_->write_header_fields_to_file (global_input_file->global_header_);
     }
+  
   if (header_)
     {
       outputter_->output_scope (header_, "lilypond");
index 73e7d917214717c3d17a101648a237433d672629..9c1cee4c1787443c498931f9dd576e96e5859ad4 100644 (file)
@@ -349,12 +349,12 @@ toplevel_expression:
                THIS->lexer_->chordmodifier_tab_  = $1;
        }
        | lilypond_header {
-               if (global_header)
-                       scm_gc_unprotect_object (global_header->self_scm ());
-               global_header = $1;
+               if (THIS->input_file_->global_header_)
+                       scm_gc_unprotect_object (THIS->input_file_->global_header_->self_scm ());
+               THIS->input_file_->global_header_ = $1;
        }
        | score_block {
-               score_globals.push ($1);
+               THIS->input_file_->scores_.push ($1);
        }
        | output_def {
                if (dynamic_cast<Paper_def*> ($1))
index bbaadb50daa008a66414522d46a62c2767b2edee..f47aaa78d2b0e2ec95dd481b68789ef453f519d4 100644 (file)
@@ -167,7 +167,8 @@ Performance::process ()
   
   Midi_stream midi_stream (out);
   progress_indication (_f ("MIDI output to `%s'...", out));
-  target_string_globals.push (out);
+
+  global_input_file->target_strings_.push (out);
 
   output (midi_stream);
   progress_indication ("\n");
index 4f203c8033811ea92eb2a6ca87c9e3a2bed095a9..1c0956d8572fc77f7e6c2e20214ee56bc6bf836d 100644 (file)
@@ -29,6 +29,7 @@
 Score::Score ()
   : Input ()
 {
+  input_file_ = 0;
   header_ = 0;
   music_ = SCM_EOL;
   errorlevel_ = 0;
@@ -82,8 +83,6 @@ Score::~Score ()
 void
 Score::run_translator (Music_output_def *odef)
 {
-
-
 #ifdef PARANOIA
   if (verbose_global_b)
     {
@@ -150,14 +149,8 @@ Score::run_translator (Music_output_def *odef)
 
   progress_indication ("\n");
   output->process ();
+  
   delete output ;
-
-  /*
-    force GC. At this point, GUILE may give back mallocated area to
-    the system.
-  */
-    
-  scm_gc ();
 }
 
 void
@@ -166,7 +159,6 @@ Score::process ()
   if (!unsmob_music (music_))
     return;
 
-
   for (int i=0; i < defs_.size (); i++)
     {
       if (no_paper_global_b 
@@ -177,8 +169,6 @@ Score::process ()
 }
 
 
-
-
 void
 Score::add_output (Music_output_def *pap)
 {
index 4680cd2a0be3d8df07b6e8c66bbb586d49e65b58..6f9e679ee619e034e2d82df118498d4743b2fda4 100644 (file)
 #include "lily-version.hh"
 #include "scm-hash.hh"
 
-Sources* source_global = 0;
-Array<String> inclusion_globals;
-Array<String> target_string_globals;
-Link_array<Score> score_globals;
-Scheme_hash_table * global_header;
 
+LY_DEFINE(ly_set_point_and_click_x, "set-point-and-click!", 1, 0, 0,
+         (SCM what),
+         "Set the options for Point-and-click source specials output. The
+argument is a symbol.  Possible options are @code{none} (no source specials),
+@code{line} and @code{line-column}")
+{
+  /*
+    UGH.
+   */
+  SCM val = SCM_BOOL_F;
+  if (ly_symbol2scm ("line-column") == what)
+    val = gh_eval_str ("line-column-location");
+  else if (what == ly_symbol2scm ("line"))
+    val = gh_eval_str ("line-location");
+
+  /*
+    UGH.
+
+    How do you do set! from C ? 
+   */
+  scm_primitive_eval (scm_list_n (ly_symbol2scm ("set!"),
+                                 ly_symbol2scm ("point-and-click"), val, SCM_UNDEFINED));
+  return SCM_UNSPECIFIED;
+}
 
-void write_dependency_file (String fn, Array<String> targets,
-                           Array<String> deps)
+void
+write_dependency_file (String fn,
+                      Array<String> targets,
+                      Array<String> deps)
 {
   const int WRAPWIDTH = 65;
 
@@ -79,29 +100,32 @@ void write_dependency_file (String fn, Array<String> targets,
   fprintf (f, "%s\n",  out.to_str0 ());
 }
 
+
 void
-do_deps ()
+Input_file_settings::do_deps ()
 {
   if (dependency_global_b)
     {
       Path p = split_path (output_name_global);
       p.ext = "dep";
       write_dependency_file (p.string (),
-                            target_string_globals,
-                            inclusion_globals);
+                            target_strings_,
+                            inclusion_names_);
     }
 }
 
 
 void
-do_scores ()
+Input_file_settings::do_scores ()
 {
-  if (!global_header)
-    global_header = new Scheme_hash_table;
-  for (int i=0; i < score_globals.size (); i++)
-    {
-      Score* is = score_globals[i];
+  if (!global_header_)
+    global_header_ = new Scheme_hash_table;
 
+  for (int i=0; i < scores_.size (); i++)
+    {
+      Score* is = scores_[i];
+      is->input_file_ = this;
+      
       if (is->errorlevel_)
        {
          is->warning (_ ("Score contains errors; will not process it"));
@@ -115,24 +139,49 @@ do_scores ()
   do_deps ();
 }
 
-void
-clear_scores ()
+Input_file_settings::~Input_file_settings ()
+{
+  for (int i=0; i < scores_.size (); i++)
+    scm_gc_unprotect_object (scores_[i]->self_scm ());
+  scores_.clear ();
+  
+  inclusion_names_.clear ();
+  if (global_header_)
+    scm_gc_unprotect_object (global_header_ ->self_scm ());
+
+  global_input_file =0;
+}
+
+
+Input_file_settings* global_input_file;
+
+Input_file_settings::Input_file_settings (String init_string, String file_string)
 {
-  for (int i=0; i < score_globals.size (); i++)
-    scm_gc_unprotect_object (score_globals[i]->self_scm ());
-  score_globals.clear ();
+  global_input_file = this;
+  ly_set_point_and_click_x (SCM_BOOL_F);
+  
+  sources_.set_path (&global_path);
+  
+  My_lily_parser parser (this);
+
+  progress_indication (_f ("Now processing: `%s'", file_string.to_str0 ()));
+  progress_indication ("\n");
+  parser.parse_file (init_string, file_string);
+  
+  if (parser.error_level_)
+    {
+      exit_status_global  = 1;
+    }
+  else
+    do_scores ();
   
-  inclusion_globals.clear ();
-  if (global_header)
-    scm_gc_unprotect_object (global_header ->self_scm ());
-  global_header =0; 
 }
 
 
 void
-do_one_file (String init_string, String file_string)
+do_one_file (String init_string, String file_string) 
 {
-  if (init_string.length () && global_path.find (init_string).empty_b ())
+   if (init_string.length () && global_path.find (init_string).empty_b ())
     {
       warning (_f ("can't find file: `%s'", init_string));
       warning (_f ("(search path: `%s')", global_path.string ().to_str0 ()));
@@ -144,24 +193,5 @@ do_one_file (String init_string, String file_string)
       return;
     }
 
-  Sources sources;
-  source_global = &sources;
-  source_global->set_path (&global_path);
-  {
-    My_lily_parser parser (source_global);
-
-    progress_indication (_f ("Now processing: `%s'", file_string.to_str0 ()));
-    progress_indication ("\n");
-    parser.parse_file (init_string, file_string);
-
-    if (parser.error_level_)
-      {
-       exit_status_global  = 1;
-      }
-    else
-      do_scores ();
-    clear_scores ();
-  }
-  source_global = 0;
+  Input_file_settings inp_file(init_string, file_string);
 }
-
index 6731500db600efec6be0adda4488b8d824e389ea..f1994d21296532758be50914c34ae1b69f56647a 100644 (file)
@@ -290,7 +290,6 @@ System::output_molecule (SCM expr, Offset o)
        {
          Input * ip = unsmob_input (head);
       
-
          pscore_->outputter_->output_scheme (scm_list_n (ly_symbol2scm ("define-origin"),
                                                           scm_makfrom0str (ip->file_string ().to_str0 ()),
                                                           gh_int2scm (ip->line_number ()),
index 423c3326ada24ccb10afddb1cc01444cfa74e15d..ab2520e3b1f35a3c80b28ebc7f6df4a161e79e05 100644 (file)
    " {exch pop //systemdict /run get exec} "
    (ly-gulp-file "music-drawing-routines.ps")
    "{ exch pop //systemdict /run get exec } "
-;; ps-testing is broken: global module
-   (if (defined? 'ps-testing) "\n /testing true def" "")
-;;   "\n /testing true def"
+
+;; ps-testing wreaks havoc when used with lilypond-book.
+;;   (if (defined? 'ps-testing) "\n /testing true def" "")
+
+
+   ;;   "\n /testing true def"
    ))
 
 (define (lily-def key val)
index 4df648dd0b77833fbe098db6553342ab6e240399..4f997945c4831e90e319c231383f17a6e752eabf 100644 (file)
        (regexp-substitute/global #f "\n"
                                 (ly-gulp-file "music-drawing-routines.ps") 'pre " %\n" 'post)
        (ly-gulp-file "music-drawing-routines.ps"))
-   (if (defined? 'ps-testing) "/testing true def%\n" "")
+;   (if (defined? 'ps-testing) "/testing true def%\n" "")
    "}"
    "\\input lilyponddefs \\outputscale=\\lilypondpaperoutputscale \\lilypondpaperunit"
    "\\turnOnPostScript"))
   "}\\vss}")
 
 (define (filledbox breapth width depth height)
-  (if (defined? 'ps-testing)
+  (if (and #f (defined? 'ps-testing))
       (embedded-ps
        (string-append (numbers->string (list breapth width depth height))
                      " draw_box" ))
index 61ea65b0f744958f94c3cddc4ea9af975d9ed1a7..b571c8330b4dc850686e630fa903202a7e0d5e7d 100644 (file)
@@ -953,6 +953,19 @@ if 1:
        conversions.append (((1,5,71), conv, 'extent-[XY] -> [XY]-extent'))
 
 
+if 1:
+       def conv (str):
+               str = re.sub ("""#\(set! +point-and-click +line-column-location\)""",
+                             """#(set-point-and-click! \'line-column)""", str)
+               str = re.sub ("""#\(set![ \t]+point-and-click +line-location\)""",
+                             '#(set-point-and-click! \'line)', str)
+               str = re.sub ('#\(set! +point-and-click +#f\)',
+                             '#(set-point-and-click! \'none)', str)
+               return str
+       
+       conversions.append (((1,5,72), conv, 'set! point-and-click -> set-point-and-click!'))
+
+
 ################################
 #      END OF CONVERSIONS      
 ################################