+2005-05-23 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * lily/main.cc (setup_paths)[__MINGW32__]: Normalize LILYPONDPREFIX.
+
+2005-05-21 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * 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 <janneke@gnu.org>
+
+ * 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 <hanwen@xs4all.nl>
* scripts/lilypond-book.py (PREAMBLE_LY): add marker, where people
2005-05-18 Jan Nieuwenhuizen <janneke@gnu.org>
+ * 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 <gperlist@shaw.ca>
@cindex text items, non-empty
@cindex non-empty texts
-It is possible to place arbitrary strings of text or
-@internalsref{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
+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
@end lilypond
The @code{\markup} is described in more detail in
-@internalsref{Text markup}.
+@ref{Text markup}.
@refcommands
@end lilypond
@noindent
-@code{\markup} is primarily used for @internalsref{Text scripts},
+@code{\markup} is primarily used for @internalsref{TextScript}s,
but it can also be used anywhere text is called in lilypond
@lilypond[quote,verbatim]
@cindex fermata on multi-measure rest
Texts can be added to multi-measure rests by using the
-@var{note}-@code{markup} syntax @internalsref{Text markup}.
+@var{note}-@code{markup} syntax @ref{Text markup}.
A variable (@code{\fermataMarkup}) is provided for
adding fermatas
if (scm_is_pair (handle))
return scm_cdr (handle);
- else
- return default_value;
+ return default_value;
}
LY_DEFINE (ly_number2string, "ly:number->string",
{
programming_error (_ ("infinity or NaN encountered while converting Real number"));
programming_error (_ ("setting to zero"));
-
+
r = 0.0;
}
SCM_ASSERT_TYPE (scm_is_integer (wc), wc, SCM_ARG1, __FUNCTION__, "integer");
unsigned wide_char = (unsigned) scm_to_int (wc);
- 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);
- }
+ 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);
+ }
*p = 0;
return scm_makfrom0str (buf);
}
-
+
LY_DEFINE (ly_effective_prefix, "ly:effective-prefix",
0, 0, 0, (),
"Return effective prefix.")
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))
{
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.")
+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_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"));
+ 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;
}
#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");
}
#endif
+#ifdef __MINGW32__
+# include <winbase.h>
+#endif
+
static void
setup_paths (char const* argv0)
{
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));
#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 ("");
}
}
-#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)
{
;; 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))
(define-module (scm editor))
+;; Also for standalone use, so cannot include any lily modules.
(use-modules
- (ice-9 regex))
+ (ice-9 regex)
+ (srfi srfi-13)
+ (srfi srfi-14))
-(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 PLATFORM
+ (string->symbol
+ (string-downcase
+ (car (string-tokenize (vector-ref (uname) 0) char-set:letter)))))
(define (get-editor)
(or (getenv "LYEDITOR")
(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)
(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?)))))
(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)
(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)))