or EXT_ components non-empty.
+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.
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_;
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];
;; 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
(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
(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))
(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