]> git.donarmstrong.com Git - lilypond.git/commitdiff
* GNUmakefile.in: add dir argument for find command.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 17 Dec 2005 23:13:33 +0000 (23:13 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 17 Dec 2005 23:13:33 +0000 (23:13 +0000)
* lily/parser.yy (bass_figure): set_spot() for bass figures. This
fixes weird line numbers for point & click.

* lily/source-file.cc (get_counts): init line/column/char counts.

ChangeLog
GNUmakefile.in
lily/main.cc
lily/parser.yy
lily/source-file.cc

index 0b1ff6bee39025adc771e7908c33a90131e59bda..9f4575b8dde14c446badb599ac105650526c3c45 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2005-12-18  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * GNUmakefile.in: add dir argument for find command.
+
+       * lily/parser.yy (bass_figure): set_spot() for bass figures. This
+       fixes weird line numbers for point & click.
+
+       * lily/source-file.cc (get_counts): init line/column/char counts.
+
+2005-12-16  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * lily/main.cc: remove ARGV0_RELOCATION, instead use --relocate.
+
 2005-12-16  Graham Percival  <gpermus@gmail.com>
 
        * Documentation/user/basic-notation.itely, advanced-notation.itely:
index 33c9afb21019a2ced36ba952b6dd800850e2963a..3548dc04a5b30ddd89d29b6e6812a7896945f18e 100644 (file)
@@ -81,7 +81,7 @@ local-WWW-post:
        cat $(outdir)/weblist | (cd $(top-build-dir); tar -cf-  -T- ) | \
                tar -C $(outdir)/web-root/ -xf -  
        cd $(outdir)/web-root/ &&  \
-               for a in `find -name out-www`; do \
+               for a in `find -name out-www`; do \
                        mv $$a/* $$a/.. ; \
                        rmdir $$a ; \
                done
index 6fcca99ddfcb6255b24ec5a46e4ebd57c2f0da2d..0a967aa11da6124ba33e4a88c66f05d1b3de975b 100644 (file)
@@ -86,6 +86,16 @@ bool make_preview = false;
 /* Generate printed output.  */
 bool make_print = true;
 
+
+bool relocate_binary =
+#ifdef __MINGW32__  
+  false
+#else
+  true;
+#endif
+  ;
+
+
 /*
  * Miscellaneous global stuff.
  */
@@ -151,6 +161,7 @@ static Long_option_init options_static[]
      for --output-format.  */
   {_i ("FORMATs"), "formats", 'f', _i ("dump FORMAT,...  Also as separate options:")},
   {0, "dvi", 0, _i ("generate DVI (tex backend only)")},
+  {0, "relocate", 0, _i("relocate using path to binary")},
   {0, "pdf", 0, _i ("generate PDF (default)")},
   {0, "png", 0, _i ("generate PNG")},
   {0, "ps", 0, _i ("generate PostScript")},
@@ -192,15 +203,16 @@ dir_info (FILE *out)
 
   fprintf (out, "\nEffective prefix: \"%s\"\n", prefix_directory.to_str0 ());
 
-#if ARGV0_RELOCATION
-  env_var_info (out, "FONTCONFIG_FILE");
-  env_var_info (out, "FONTCONFIG_PATH");
-  env_var_info (out, "GS_FONTPATH");
-  env_var_info (out, "GS_LIB");
-  env_var_info (out, "GUILE_LOAD_PATH");
-  env_var_info (out, "PANGO_RC_FILE");
-  env_var_info (out, "PATH");
-#endif
+  if (relocate_binary)
+    {
+      env_var_info (out, "FONTCONFIG_FILE");
+      env_var_info (out, "FONTCONFIG_PATH");
+      env_var_info (out, "GS_FONTPATH");
+      env_var_info (out, "GS_LIB");
+      env_var_info (out, "GUILE_LOAD_PATH");
+      env_var_info (out, "PANGO_RC_FILE");
+      env_var_info (out, "PATH");
+    }
 }
 
 static void
@@ -363,50 +375,50 @@ setup_paths (char const *argv0)
 {
   prefix_directory = LILYPOND_DATADIR;
 
-#if ARGV0_RELOCATION
-
-  if (getenv ("LILYPOND_VERBOSE"))
-    be_verbose_global = true;
+  if (relocate_binary)
+    {
+      if (getenv ("LILYPOND_VERBOSE"))
+       be_verbose_global = true;
 
-  /* Find absolute ARGV0 name, using PATH.  */
-  File_path path;
-  path.parse_path (getenv ("PATH"));
+      /* Find absolute ARGV0 name, using PATH.  */
+      File_path path;
+      path.parse_path (getenv ("PATH"));
 
 #if defined (__CYGWIN__) || defined (__MINGW32__)
-  String s = argv0;
-  s.substitute ('\\', '/');
-  argv0 = s.to_str0 ();
+      String s = argv0;
+      s.substitute ('\\', '/');
+      argv0 = s.to_str0 ();
 #endif /* __CYGWIN__ || __MINGW32__ */
 
 #ifndef __MINGW32__
-  String argv0_abs = path.find (argv0);
+      String argv0_abs = path.find (argv0);
 #else /* __MINGW32__ */
-  char const *ext[] = {"exe", "", 0 };
-  String argv0_abs = path.find (argv0, ext);
+      char const *ext[] = {"exe", "", 0 };
+      String argv0_abs = path.find (argv0, ext);
 #endif /* __MINGW32__ */
 
-  if (argv0_abs.is_empty ())
-    {
-      File_name name (argv0);
-      /* If NAME contains slashes and its DIR is not absolute, it can
-        only be referenced from CWD.  */
-      if (name.to_string ().index ('/') >= 0 && name.dir_[0] != '/')
+      if (argv0_abs.is_empty ())
        {
-         char cwd[PATH_MAX];
-         getcwd (cwd, PATH_MAX);
-         argv0_abs = String (cwd) + "/" + argv0;
+         File_name name (argv0);
+         /* If NAME contains slashes and its DIR is not absolute, it can
+            only be referenced from CWD.  */
+         if (name.to_string ().index ('/') >= 0 && name.dir_[0] != '/')
+           {
+             char cwd[PATH_MAX];
+             getcwd (cwd, PATH_MAX);
+             argv0_abs = String (cwd) + "/" + argv0;
+           }
+         else
+           programming_error ("can't find absolute argv0");
        }
-      else
-       programming_error ("can't find absolute argv0");
-    }
     
-  String bindir = dir_name (argv0_abs);
-  String argv0_prefix = dir_name (bindir);
-  if (argv0_prefix != dir_name (dir_name (dir_name (prefix_directory))))
-    set_relocation (bindir, argv0_prefix);
-#else
-  (void) argv0;
-#endif /* ARGV0_RELOCATION */
+      String bindir = dir_name (argv0_abs);
+      String argv0_prefix = dir_name (bindir);
+      if (argv0_prefix != dir_name (dir_name (dir_name (prefix_directory))))
+       set_relocation (bindir, argv0_prefix);
+    }
+  else
+    (void) argv0;
 
   /* FIXME: use LILYPOND_DATADIR.  */
   if (char const *env = getenv ("LILYPONDPREFIX"))
@@ -674,6 +686,8 @@ parse_argv (int argc, char **argv)
            make_preview = true;
          else if (String (opt->longname_str0_) == "no-pages")
            make_print = false;
+         else if (String (opt->longname_str0_) == "relocate")
+           relocate_binary = true;
          break;
 
        case 'd':
@@ -788,12 +802,12 @@ int
 main (int argc, char **argv)
 {
   setup_localisation ();
-  setup_paths (argv[0]);
-  setup_guile_env ();
   parse_argv (argc, argv);
   if (isatty (STDIN_FILENO))
     identify (stderr);
 
+  setup_paths (argv[0]);
+  setup_guile_env ();
   scm_boot_guile (argc, argv, main_with_guile, 0);
 
   /* Only reachable if GUILE exits.  That is an error.  */
index 81a8f810828fac52dbc474de935d50147922a2f3..a34c8a07784908ae3b6466a0057ad834d7d89c60 100644 (file)
@@ -2062,6 +2062,7 @@ bass_figure:
                Music *bfr = MY_MAKE_MUSIC ("BassFigureEvent");
                $$ = bfr->self_scm ();
                bfr->unprotect ();
+               bfr->set_spot (@1);
        }
        | bass_number  {
                Music *bfr = MY_MAKE_MUSIC ("BassFigureEvent");
@@ -2073,6 +2074,7 @@ bass_figure:
                        bfr->set_property ("text", $1);
 
                bfr->unprotect ();
+               bfr->set_spot (@1);
        }
        | bass_figure ']' {
                $$ = $1;
index 65fe47c0645f9938afb0365bf1fa14aa355a2e68..2fdeb9fd280f6fb8485ac25bf1a386c81c83ba01 100644 (file)
@@ -237,6 +237,10 @@ Source_file::get_counts (char const *pos_str0,
                         int *line_char,
                         int *column) const
 {
+  *line_number = 0;
+  *line_char = 0;
+  *column = 0;
+    
   if (!contains (pos_str0))
     return;