]> git.donarmstrong.com Git - lilypond.git/blob - debian/gui-2.6.patch
Imported Debian patch 2.12.3-1
[lilypond.git] / debian / gui-2.6.patch
1 Index: ChangeLog
2 ===================================================================
3 RCS file: /cvsroot/lilypond/lilypond/ChangeLog,v
4 retrieving revision 1.3836.2.42
5 diff -p -u -r1.3836.2.42 ChangeLog
6 --- ChangeLog   23 Oct 2005 15:58:39 -0000      1.3836.2.42
7 +++ ChangeLog   23 Oct 2005 19:03:38 -0000
8 @@ -1,3 +1,8 @@
9 +2005-10-23  Jan Nieuwenhuizen  <janneke@gnu.org>
10 +
11 +       * scm/lily.scm: Remove horrendous running-from-gui? kludge.
12 +       (lilypond-main): Redirect to gui-main if 'gui is set.
13 +
14  2005-10-23  Erik Sandberg  <mandolaerik@gmail.com>
15  
16         * scripts/lilypond-book.py: Backport bugfix by Mats Bengtsson.
17 Index: lily/lily-parser-scheme.cc
18 ===================================================================
19 RCS file: /cvsroot/lilypond/lilypond/lily/lily-parser-scheme.cc,v
20 retrieving revision 1.16
21 diff -p -u -r1.16 lily-parser-scheme.cc
22 --- lily/lily-parser-scheme.cc  22 Jun 2005 15:06:05 -0000      1.16
23 +++ lily/lily-parser-scheme.cc  23 Oct 2005 19:02:10 -0000
24 @@ -8,15 +8,16 @@
25  
26  #include <unistd.h>
27  
28 +#include "file-name-map.hh"
29  #include "file-name.hh"
30  #include "file-path.hh"
31 -#include "main.hh"
32 -#include "lily-parser.hh"
33 -#include "warn.hh"
34 -#include "source.hh"
35  #include "lily-lexer.hh"
36 +#include "lily-parser.hh"
37  #include "ly-module.hh"
38 -#include "file-name-map.hh"
39 +#include "main.hh"
40 +#include "program-option.hh"
41 +#include "source.hh"
42 +#include "warn.hh"
43  
44  /* Do not append `!' suffix, since 1st argument is not modified. */
45  LY_DEFINE (ly_set_point_and_click, "ly:set-point-and-click",
46 @@ -52,7 +53,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file
47  
48    /* When running from gui, generate output in .ly source directory.  */
49    if (output_name_global.is_empty ()
50 -      && scm_call_0 (ly_lily_module_constant ("running-from-gui?")) == SCM_BOOL_T)
51 +      && ly_get_option (ly_symbol2scm ("gui")) == SCM_BOOL_T)
52      {
53        File_name f (file);
54        f.base_ = "";
55 Index: scm/lily.scm
56 ===================================================================
57 RCS file: /cvsroot/lilypond/lilypond/scm/lily.scm,v
58 retrieving revision 1.367.2.3
59 diff -p -u -r1.367.2.3 lily.scm
60 --- scm/lily.scm        1 Aug 2005 15:14:46 -0000       1.367.2.3
61 +++ scm/lily.scm        23 Oct 2005 19:02:10 -0000
62 @@ -348,6 +348,9 @@ The syntax is the same as `define*-publi
63  (define-public (lilypond-main files)
64    "Entry point for LilyPond."
65  
66 +  (if (ly:get-option 'gui)
67 +      (gui-main files))
68 +
69    (if (null? files)
70        (no-files-handler))
71  
72 @@ -385,29 +388,12 @@ The syntax is the same as `define*-publi
73  
74  (use-modules (scm editor))
75  
76 -(define-public (running-from-gui?)
77 -  (let ((have-tty? (isatty? (current-input-port))))
78 -    ;; If no TTY and not using safe, assume running from GUI.
79 -    (cond
80 -     ((eq? PLATFORM 'windows)
81 -      ;; Always write to .log file.
82 -      (if DOS #t
83 -      ;; This only works for i586-mingw32msvc-gcc -mwindows
84 -      (not (string-match "standard input"
85 -                        (format #f "~S" (current-input-port))))))
86 -     ;; FIXME: using -dgui would be nice, but it does not work
87 -     ((eq? PLATFORM 'foo-windows)
88 -      (ly:get-option 'gui))
89 -     ((eq? PLATFORM 'darwin) #f)
90 -     (else
91 -      (not have-tty?)))))
92 -
93  (define-public (gui-main files)
94    (if (null? files)
95        (gui-no-files-handler))
96    (let* ((base (basename (car files) ".ly"))
97          (log-name (string-append base ".log")))
98 -    (if (not (running-from-gui?))
99 +    (if (not (ly:get-option 'gui))
100         (ly:message (_ "Redirecting output to ~a...") log-name))
101      (ly:stderr-redirect log-name "w")
102      (ly:message "# -*-compilation-*-")
103 @@ -430,7 +416,3 @@ The syntax is the same as `define*-publi
104      (ly:message (_ "Invoking `~a'...") cmd)
105      (system cmd)
106      (exit 1)))
107 -
108 -(or (not (running-from-gui?))
109 -    (ly:get-option 'safe)
110 -    (define lilypond-main gui-main))