From 2a42ed162649920caf54eaee1f41563ecfe3b4e2 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Thu, 4 Aug 2011 16:11:00 +0200 Subject: [PATCH] GUILE debug: Revert part of 52bea08ef73a55ee, so the file of an error is shown When debug is set to #f, a guile error, like for example (cdr '()) will only show the error message itself, but no indication whatsoever where the error occured. This makes debugging scheme bugs in our lilypond code basically impossible. This patch properly fixes the debug settings, by either setting 'debug for guile <2.0 or setting the finer-grained debug options for guile >=2.0. That's also the correct fix that Ian Hulin suggest in a private mail. Not tested with guile 2.0, though. --- scm/lily.scm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scm/lily.scm b/scm/lily.scm index 17c8d1776b..e8fb65d4f4 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -27,7 +27,16 @@ (defmacro-public _i (x) x) +;;; Boolean thunk - are we integrating Guile V2.0 or higher with LilyPond? +(define-public (guile-v2) + (string>? (version) "1.9.10")) + (read-enable 'positions) +(if (not (guile-v2)) + (debug-enable 'debug) + (begin + (debug-enable 'backtrace) + (debug-enable 'show-file-name))) (define-public PLATFORM (string->symbol @@ -195,10 +204,6 @@ messages into errors.") ;;(set-debug-cell-accesses! 1000) -;;; Boolean thunk - are we integrating Guile V2.0 or higher with LilyPond? -(define-public (guile-v2) - (string>? (version) "1.9.10")) - (use-modules (ice-9 regex) (ice-9 safe) (ice-9 format) @@ -226,8 +231,7 @@ messages into errors.") (use-modules (ice-9 curried-definitions))) (else (if (ly:get-option 'verbose) - (ly:message - (_ "Guile 1.8\n"))))) + (ly:message (_ "Guile 1.8\n"))))) ;; TODO add in modules for V1.8.7 deprecated in V2.0 and integrated ;; into Guile base code, like (ice-9 syncase). -- 2.39.2