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
9 +2005-10-23 Jan Nieuwenhuizen <janneke@gnu.org>
11 + * scm/lily.scm: Remove horrendous running-from-gui? kludge.
12 + (lilypond-main): Redirect to gui-main if 'gui is set.
14 2005-10-23 Erik Sandberg <mandolaerik@gmail.com>
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
28 +#include "file-name-map.hh"
29 #include "file-name.hh"
30 #include "file-path.hh"
32 -#include "lily-parser.hh"
35 #include "lily-lexer.hh"
36 +#include "lily-parser.hh"
37 #include "ly-module.hh"
38 -#include "file-name-map.hh"
40 +#include "program-option.hh"
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
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)
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."
66 + (if (ly:get-option 'gui)
72 @@ -385,29 +388,12 @@ The syntax is the same as `define*-publi
74 (use-modules (scm editor))
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.
80 - ((eq? PLATFORM 'windows)
81 - ;; Always write to .log file.
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)
93 (define-public (gui-main 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)
108 -(or (not (running-from-gui?))
109 - (ly:get-option 'safe)
110 - (define lilypond-main gui-main))