diff options
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | flower/file-name.cc | 6 | ||||
-rw-r--r-- | lily/lily-parser-scheme.cc | 11 | ||||
-rw-r--r-- | scm/editor.scm | 4 | ||||
-rw-r--r-- | scm/lily.scm | 2 | ||||
-rw-r--r-- | scm/ps-to-png.scm | 16 |
6 files changed, 46 insertions, 5 deletions
@@ -1,3 +1,15 @@ +2005-06-09 Jan Nieuwenhuizen <janneke@gnu.org> + + * flower/file-name.cc: Bugfix: only append DIRSEP if BASE_ + or EXT_ components non-empty. + +2005-06-08 Jan Nieuwenhuizen <janneke@gnu.org> + + * scm/lily.scm (running-from-gui?): Export. + + * lily/lily-parser-scheme.cc (ly:parse-file): Use it to generate + output in .ly source directory. + 2005-06-09 Han-Wen Nienhuys <hanwen@xs4all.nl> * ttftool/util.c (surely_lseek): more verbosity. diff --git a/flower/file-name.cc b/flower/file-name.cc index 1763a546c0..ea36d4802b 100644 --- a/flower/file-name.cc +++ b/flower/file-name.cc @@ -68,7 +68,11 @@ File_name::to_string () const if (!root_.is_empty ()) s = root_ + ::to_string (ROOTSEP); if (!dir_.is_empty ()) - s += dir_ + ::to_string (DIRSEP); + { + s += dir_; + if (!base_.is_empty () || !ext_.is_empty ()) + s += ::to_string (DIRSEP); + } s += base_; if (!ext_.is_empty ()) s += ::to_string (EXTSEP) + ext_; diff --git a/lily/lily-parser-scheme.cc b/lily/lily-parser-scheme.cc index 093c9c3ae6..07ad5f7b7d 100644 --- a/lily/lily-parser-scheme.cc +++ b/lily/lily-parser-scheme.cc @@ -55,8 +55,19 @@ LY_DEFINE (ly_parse_file, "ly:parse-file", out_file_name.root_ = ""; out_file_name.dir_ = ""; + /* When running from gui, generate output in .ly source directory. */ + if (output_name_global.is_empty () + && scm_call_0 (ly_lily_module_constant ("running-from-gui?")) == SCM_BOOL_T) + { + File_name f (file); + f.base_ = ""; + f.ext_ = ""; + output_name_global = f.to_string (); + } + if (!output_name_global.is_empty ()) { + /* Interpret --output=DIR to mean --output=DIR/BASE. */ if (is_dir (output_name_global)) { char cwd[PATH_MAX]; diff --git a/scm/editor.scm b/scm/editor.scm index 82923aa7b4..af62e7c3b3 100644 --- a/scm/editor.scm +++ b/scm/editor.scm @@ -9,8 +9,8 @@ ;; Also for standalone use, so cannot include any lily modules. (use-modules (ice-9 regex) - (srfi srfi-13) - (srfi srfi-14)) + (srfi srfi-13) + (srfi srfi-14)) (define PLATFORM (string->symbol diff --git a/scm/lily.scm b/scm/lily.scm index 339217d3f1..66bedac613 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -336,7 +336,7 @@ The syntax is the same as `define*-public'." (use-modules (scm editor)) -(define (running-from-gui?) +(define-public (running-from-gui?) (let ((have-tty? (isatty? (current-input-port)))) ;; If no TTY and not using safe, assume running from GUI. (cond diff --git a/scm/ps-to-png.scm b/scm/ps-to-png.scm index d9c406acbc..0908ffe9c8 100644 --- a/scm/ps-to-png.scm +++ b/scm/ps-to-png.scm @@ -10,13 +10,20 @@ (ice-9 optargs) (ice-9 regex) (ice-9 rw) - (srfi srfi-1)) + (srfi srfi-1) + (srfi srfi-13) + (srfi srfi-14)) ;; gettext wrapper for guile < 1.7.2 (if (defined? 'gettext) (define-public _ gettext) (define-public (_ x) x)) +(define PLATFORM + (string->symbol + (string-downcase + (car (string-tokenize (vector-ref (uname) 0) char-set:letter))))) + (define (re-sub re sub string) (regexp-substitute/global #f re string 'pre sub 'post)) @@ -105,6 +112,13 @@ (begin (format (current-error-port) (_ "Invoking `~a'...") cmd) (newline (current-error-port))))) + (baz + ;; The wrapper on windows cannot handle `=' signs, + ;; gs has a workaround with #. + (if (eq? PLATFORM 'windows) + (begin + (set! cmd (re-sub "=" "#" cmd)) + (set! cmd (re-sub "-dSAFER " "" cmd))))) (status (system cmd))) (if (not (= status 0)) (begin |