CVSROOT:        /cvsroot/lilypond
Module name:    lilypond
Branch:         
Changes by:     Jan Nieuwenhuizen <[EMAIL PROTECTED]>   05/05/23 19:18:58

Modified files:
        scripts        : lilypond-invoke-editor.scm 
        scm            : lily.scm editor.scm backend-library.scm 
        lily           : main.cc general-scheme.cc 
        Documentation/user: advanced-notation.itely 
        .              : ChangeLog 

Log message:
        * lily/main.cc (setup_paths)[__MINGW32__]: Normalize LILYPONDPREFIX.
        
        * lily/general-scheme.cc (ly:stderr-redirect): Rename from
        ly:port-move.  Needs to be stderr-specific on mingw.
        Run fixcc.
        
        * lily/general-scheme.cc (ly:port-move): Remove.
        
        * scm/backend-library.scm (postscript->pdf): Remove -dSAFER in
        windows.
        
        * lily/main.cc (setup_paths) [ARGV0_RELOCATION]: Reinstate GS_*
        variables.  This eliminates the need for a gs.bat wrapper, which
        opens a console.
        
        * scripts/lilypond-invoke-editor.scm (running-from-gui?):
        * scm/lily.scm (running-from-gui?):
        * lily/main.cc[MINGW]: Remove isatty inversion, this is an
        artifact of not compiling with -mwindows.
        
        * scm/editor.scm: Define PLATFORM.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scripts/lilypond-invoke-editor.scm.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/lily.scm.diff?tr1=1.341&tr2=1.342&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/editor.scm.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/backend-library.scm.diff?tr1=1.28&tr2=1.29&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/main.cc.diff?tr1=1.255&tr2=1.256&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/general-scheme.cc.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/Documentation/user/advanced-notation.itely.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.3648&tr2=1.3649&r1=text&r2=text

Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.3648 lilypond/ChangeLog:1.3649
--- lilypond/ChangeLog:1.3648   Sun May 22 23:30:46 2005
+++ lilypond/ChangeLog  Mon May 23 19:18:58 2005
@@ -1,3 +1,31 @@
+2005-05-23  Jan Nieuwenhuizen  <[EMAIL PROTECTED]>
+
+       * lily/main.cc (setup_paths)[__MINGW32__]: Normalize LILYPONDPREFIX.
+
+2005-05-21  Jan Nieuwenhuizen  <[EMAIL PROTECTED]>
+
+       * lily/general-scheme.cc (ly:stderr-redirect): Rename from
+       ly:port-move.  Needs to be stderr-specific on mingw.
+       Run fixcc.
+
+2005-05-20  Jan Nieuwenhuizen  <[EMAIL PROTECTED]>
+
+       * lily/general-scheme.cc (ly:port-move): Remove.
+
+       * scm/backend-library.scm (postscript->pdf): Remove -dSAFER in
+       windows.
+
+       * lily/main.cc (setup_paths) [ARGV0_RELOCATION]: Reinstate GS_*
+       variables.  This eliminates the need for a gs.bat wrapper, which
+       opens a console.
+
+       * scripts/lilypond-invoke-editor.scm (running-from-gui?): 
+       * scm/lily.scm (running-from-gui?): 
+       * lily/main.cc[MINGW]: Remove isatty inversion, this is an
+       artifact of not compiling with -mwindows.
+
+       * scm/editor.scm: Define PLATFORM.
+
 2005-05-23  Han-Wen Nienhuys  <[EMAIL PROTECTED]>
 
        * scripts/lilypond-book.py (PREAMBLE_LY): add marker, where people
@@ -78,6 +106,11 @@
 
 2005-05-18  Jan Nieuwenhuizen  <[EMAIL PROTECTED]>
 
+       * Documentation/user/advanced-notation.itely (Text scripts):
+       Change nonexisting @internalsref{Text markup} to @ref{Text
+       markup}.  Change @internalsref{Text script} to
+       @internalsref{TextScript}.
+
        * lily/main.cc (setup_paths): Bugfix: pangorc is not pango.modules.
 
 2005-05-17  Graham Percival  <[EMAIL PROTECTED]>
Index: lilypond/Documentation/user/advanced-notation.itely
diff -u lilypond/Documentation/user/advanced-notation.itely:1.25 
lilypond/Documentation/user/advanced-notation.itely:1.26
--- lilypond/Documentation/user/advanced-notation.itely:1.25    Fri May 20 
11:42:13 2005
+++ lilypond/Documentation/user/advanced-notation.itely Mon May 23 19:18:58 2005
@@ -49,11 +49,10 @@
 @cindex text items, non-empty
 @cindex non-empty texts
 
-It is possible to place arbitrary strings of text or
[EMAIL PROTECTED] markup} above or below notes by using a string
[EMAIL PROTECTED]"text"}.  By default, these indications do not influence the
-note spacing, but by using the command @code{\fatText}, the widths
-will be taken into account
+It is possible to place arbitrary strings of text or @ref{Text markup}
+above or below notes by using a string @code{c^"text"}.  By default,
+these indications do not influence the note spacing, but by using the
+command @code{\fatText}, the widths will be taken into account
 
 @lilypond[quote,fragment,raggedright,verbatim,relative=1]
 c4^"longtext" \fatText c4_"longlongtext" c4
@@ -66,7 +65,7 @@
 @end lilypond
 
 The @code{\markup} is described in more detail in
[EMAIL PROTECTED] markup}.
[EMAIL PROTECTED] markup}.
 
 
 @refcommands
@@ -200,7 +199,7 @@
 @end lilypond
 
 @noindent
[EMAIL PROTECTED] is primarily used for @internalsref{Text scripts},
[EMAIL PROTECTED] is primarily used for @internalsref{TextScript}s,
 but it can also be used anywhere text is called in lilypond
 
 @lilypond[quote,verbatim]
@@ -474,7 +473,7 @@
 @cindex fermata on multi-measure rest
 
 Texts can be added to multi-measure rests by using the
[EMAIL PROTECTED]@code{markup} syntax @internalsref{Text markup}.
[EMAIL PROTECTED]@code{markup} syntax @ref{Text markup}.
 A variable (@code{\fermataMarkup}) is provided for
 adding fermatas
 
Index: lilypond/lily/general-scheme.cc
diff -u lilypond/lily/general-scheme.cc:1.20 
lilypond/lily/general-scheme.cc:1.21
--- lilypond/lily/general-scheme.cc:1.20        Tue May 10 21:58:45 2005
+++ lilypond/lily/general-scheme.cc     Mon May 23 19:18:58 2005
@@ -143,8 +143,7 @@
 
   if (scm_is_pair (handle))
     return scm_cdr (handle);
-  else
-    return default_value;
+  return default_value;
 }
 
 LY_DEFINE (ly_number2string, "ly:number->string",
@@ -166,7 +165,7 @@
          {
            programming_error (_ ("infinity or NaN encountered while converting 
Real number"));
            programming_error (_ ("setting to zero"));
-                              
+
            r = 0.0;
          }
 
@@ -248,28 +247,35 @@
 
   SCM_ASSERT_TYPE (scm_is_integer (wc), wc, SCM_ARG1, __FUNCTION__, "integer");
   unsigned wide_char = (unsigned) scm_to_int (wc);
-  char * p = buf;
+  char *p = buf;
 
-  if (wide_char < 0x0080) {
-    *p++ = (char)wide_char;
-  } else if (wide_char < 0x0800) {
-    *p++ = (char)(((wide_char >>  6)       ) | 0xC0);
-    *p++ = (char)(((wide_char      ) & 0x3F) | 0x80);
-  } else if (wide_char < 0x10000) {
-    *p++ = (char)(((wide_char >> 12)       ) | 0xE0);
-    *p++ = (char)(((wide_char >>  6) & 0x3F) | 0x80);
-    *p++ = (char)(((wide_char      ) & 0x3F) | 0x80);
-  } else {
-    *p++ = (char)(((wide_char >> 18)       ) | 0xF0);
-    *p++ = (char)(((wide_char >> 12) & 0x3F) | 0x80);
-    *p++ = (char)(((wide_char >>  6) & 0x3F) | 0x80);
-    *p++ = (char)(((wide_char      ) & 0x3F) | 0x80);
-  }
+  if (wide_char < 0x0080)
+    {
+      *p++ = (char)wide_char;
+    }
+  else if (wide_char < 0x0800)
+    {
+      *p++ = (char) (((wide_char >> 6)) | 0xC0);
+      *p++ = (char) (((wide_char) & 0x3F) | 0x80);
+    }
+  else if (wide_char < 0x10000)
+    {
+      *p++ = (char) (((wide_char >> 12)) | 0xE0);
+      *p++ = (char) (((wide_char >> 6) & 0x3F) | 0x80);
+      *p++ = (char) (((wide_char) & 0x3F) | 0x80);
+    }
+  else
+    {
+      *p++ = (char) (((wide_char >> 18)) | 0xF0);
+      *p++ = (char) (((wide_char >> 12) & 0x3F) | 0x80);
+      *p++ = (char) (((wide_char >> 6) & 0x3F) | 0x80);
+      *p++ = (char) (((wide_char) & 0x3F) | 0x80);
+    }
   *p = 0;
 
   return scm_makfrom0str (buf);
 }
-         
+
 LY_DEFINE (ly_effective_prefix, "ly:effective-prefix",
           0, 0, 0, (),
           "Return effective prefix.")
@@ -279,8 +285,9 @@
 
 LY_DEFINE (ly_chain_assoc_get, "ly:chain-assoc-get",
           2, 1, 0, (SCM key, SCM achain, SCM dfault),
-          "Return value for @var{key} from a list of alists @var{achain}. 
Return @var{dfault} "
-          "if no entry is found, or #f if not specified. ")
+          "Return value for @var{key} from a list of alists @var{achain}.  "
+          "If no if no entry is found, return DFAULT, "
+          "or #f if no DFAULT not specified.")
 {
   if (scm_is_pair (achain))
     {
@@ -290,17 +297,20 @@
       else
        return ly_chain_assoc_get (key, scm_cdr (achain), dfault);
     }
-  else
-    return dfault == SCM_UNDEFINED ? SCM_BOOL_F : dfault;
+  return dfault == SCM_UNDEFINED ? SCM_BOOL_F : dfault;
 }
 
-LY_DEFINE (ly_port_move, "ly:port-move",
-          2, 0, 0, (SCM fd, SCM port),
-          "Move file descriptor FD to PORT.")
-{
-  SCM_ASSERT_TYPE (scm_port_p (port), port, SCM_ARG1, __FUNCTION__, "port");
-  SCM_ASSERT_TYPE (scm_integer_p (fd), fd, SCM_ARG1, __FUNCTION__, "fd");
-  freopen (ly_scm2newstr (scm_port_filename (port), 0), "a",
-          fdopen (scm_to_int (fd), "a"));
+LY_DEFINE (ly_stderr_redirect, "ly:stderr-redirect",
+          1, 1, 0, (SCM file_name, SCM mode),
+          "Redirect stderr to FILE-NAME, opened with MODE.")
+{
+  SCM_ASSERT_TYPE (scm_string_p (file_name), file_name, SCM_ARG1,
+                  __FUNCTION__, "file_name");
+  char const* m = "w";
+  if (mode != SCM_UNDEFINED && scm_string_p (mode))
+    m = ly_scm2newstr (mode, 0);
+  /* dup2 and (fileno (current-error-port)) do not work with mingw'c
+     gcc -mwindows.  */
+  freopen (ly_scm2newstr (file_name, 0), m, stderr);
   return SCM_UNSPECIFIED;
 }
Index: lilypond/lily/main.cc
diff -u lilypond/lily/main.cc:1.255 lilypond/lily/main.cc:1.256
--- lilypond/lily/main.cc:1.255 Thu May 19 22:18:40 2005
+++ lilypond/lily/main.cc       Mon May 23 19:18:58 2005
@@ -190,6 +190,8 @@
 #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");
@@ -285,6 +287,10 @@
 }
 #endif
 
+#ifdef __MINGW32__
+#  include <winbase.h>
+#endif
+
 static void
 setup_paths (char const* argv0)
 {
@@ -305,6 +311,14 @@
       prefix_directory = datadir + "/lilypond/" TOPLEVEL_VERSION;
 
       sane_putenv ("FONTCONFIG_FILE", sysconfdir + "/fonts/fonts.conf", false);
+#ifdef __MINGW32__
+      char font_dir[PATH_MAX];
+      ExpandEnvironmentStrings ("%windir%/fonts", font_dir, sizeof (font_dir));
+      prepend_env_path ("GS_FONTPATH", font_dir);
+#endif
+      prepend_env_path ("GS_FONTPATH", datadir + "/gs/fonts");
+      prepend_env_path ("GS_LIB", datadir + "/gs/Resource");
+      prepend_env_path ("GS_LIB", datadir + "/gs/lib");
       prepend_env_path ("GUILE_LOAD_PATH", datadir
                        + to_string ("/guile/%d.%d",
                                     SCM_MAJOR_VERSION, SCM_MINOR_VERSION));
@@ -316,7 +330,13 @@
 #endif /* ARGV0_RELOCATION */
     
   if (char const *env = getenv ("LILYPONDPREFIX"))
-    prefix_directory = env;
+    {
+#ifdef __MINGW32__
+      /* Normalize file name.  */
+      env = File_name (env).to_string ().get_copy_str0 ();
+#endif
+      prefix_directory = env;
+    }
 
   global_path.append ("");
 
@@ -659,12 +679,6 @@
     }
 }
 
-#ifdef __MINGW32__
-/* If no TTY and not using safe, assume running from GUI.
-   For mingw, the test must be inverted.  */
-#  define isatty(x) (!isatty (x))
-#endif
-
 int
 main (int argc, char **argv)
 {
Index: lilypond/scm/backend-library.scm
diff -u lilypond/scm/backend-library.scm:1.28 
lilypond/scm/backend-library.scm:1.29
--- lilypond/scm/backend-library.scm:1.28       Wed May 18 09:56:14 2005
+++ lilypond/scm/backend-library.scm    Mon May 23 19:18:58 2005
@@ -53,7 +53,9 @@
     ;; The wrapper on windows cannot handle `=' signs,
     ;; gs has a workaround with #.
     (if (eq? PLATFORM 'windows)
-       (set! cmd (string-regexp-substitute "=" "#" cmd)))
+       (begin
+         (set! cmd (string-regexp-substitute "=" "#" cmd))
+         (set! cmd (string-regexp-substitute "-dSAFER " "" cmd))))
 
     (if (access? pdf-name W_OK)
        (delete-file pdf-name))
Index: lilypond/scm/editor.scm
diff -u lilypond/scm/editor.scm:1.7 lilypond/scm/editor.scm:1.8
--- lilypond/scm/editor.scm:1.7 Tue May 17 14:36:19 2005
+++ lilypond/scm/editor.scm     Mon May 23 19:18:58 2005
@@ -6,16 +6,16 @@
 
 (define-module (scm editor))
 
+;; Also for standalone use, so cannot include any lily modules.
 (use-modules
- (ice-9 regex))
-
-(define editor-command-template-alist
-  '(("emacs" .  "emacsclient --no-wait +%(line)s:%(column)s %(file)s")
-    ("gvim" . "gvim --remote +:%(line)s:norm%(column)s %(file)s")
-    ("nedit" . "nc -noask +%(line)s %(file)s")
-    ("gedit" . "gedit +%(line)s %(file)s")
-    ("jedit" . "jedit %(file)s +line:%(line)s")
-    ("lilypad" . "lilypad +%(line)s:%(column)s %(file)s")))
+ (ice-9 regex)
+  (srfi srfi-13)
+  (srfi srfi-14))
+
+(define PLATFORM
+  (string->symbol
+   (string-downcase
+    (car (string-tokenize (vector-ref (uname) 0) char-set:letter)))))
 
 (define (get-editor)
   (or (getenv "LYEDITOR")
@@ -29,6 +29,14 @@
        (else
         "emacs"))))
 
+(define editor-command-template-alist
+  '(("emacs" .  "emacsclient --no-wait +%(line)s:%(column)s %(file)s")
+    ("gvim" . "gvim --remote +:%(line)s:norm%(column)s %(file)s")
+    ("nedit" . "nc -noask +%(line)s %(file)s")
+    ("gedit" . "gedit +%(line)s %(file)s")
+    ("jedit" . "jedit %(file)s +line:%(line)s")
+    ("lilypad" . "lilypad +%(line)s:%(column)s %(file)s")))
+
 (define (get-command-template alist editor)
   (define (get-command-template-helper)
     (if (null? alist)
Index: lilypond/scm/lily.scm
diff -u lilypond/scm/lily.scm:1.341 lilypond/scm/lily.scm:1.342
--- lilypond/scm/lily.scm:1.341 Wed May 18 14:19:41 2005
+++ lilypond/scm/lily.scm       Mon May 23 19:18:58 2005
@@ -375,12 +375,12 @@
 
 (define (running-from-gui?)
   (let ((have-tty? (isatty? (current-input-port))))
-    
     ;; If no TTY and not using safe, assume running from GUI.
-    ;; For mingw, the test must be inverted.
-
     (cond
-     ((eq? PLATFORM 'windows) have-tty?)
+     ((eq? PLATFORM 'windows)
+      ;; This only works for i586-mingw32msvc-gcc -mwindows
+      (not (string-match "standard input"
+                        (format #f "~S" (current-input-port)))))
      ((eq? PLATFORM 'darwin) #f)
      (else
       (not have-tty?)))))
@@ -388,11 +388,10 @@
 (define-public (gui-main files)
   (if (null? files) (gui-no-files-handler))
   (let* ((base (basename (car files) ".ly"))
-        (log-name (string-append base ".log"))
-        (log-file (open-file log-name "w")))
+        (log-name (string-append base ".log")))
     (if (not (running-from-gui?))
        (ly:message (_ "Redirecting output to ~a...") log-name))
-    (ly:port-move (fileno (current-error-port)) log-file)
+    (ly:stderr-redirect log-name "w")
     (ly:message "# -*-compilation-*-")
     (let ((failed (lilypond-all files)))
       (if (pair? failed)
Index: lilypond/scripts/lilypond-invoke-editor.scm
diff -u lilypond/scripts/lilypond-invoke-editor.scm:1.5 
lilypond/scripts/lilypond-invoke-editor.scm:1.6
--- lilypond/scripts/lilypond-invoke-editor.scm:1.5     Mon May 16 23:25:37 2005
+++ lilypond/scripts/lilypond-invoke-editor.scm Mon May 23 19:18:58 2005
@@ -106,9 +106,7 @@
 (define (running-from-gui?)
   (let ((have-tty? (isatty? (current-input-port))))
     ;; If no TTY and not using safe, assume running from GUI.
-    ;; for mingw, the test must be inverted.
-    (if (eq? PLATFORM 'windows)
-       have-tty? (not have-tty?))))
+    (not have-tty?)))
 
 (define (main args)
   (let ((files (parse-options args)))


_______________________________________________
Lilypond-cvs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-cvs

Reply via email to