diff options
author | David Kastrup <dak@gnu.org> | 2013-04-02 15:22:13 +0200 |
---|---|---|
committer | David Kastrup <dak@gnu.org> | 2013-04-09 09:27:35 +0200 |
commit | 6cb2c5ec23dea45f3cba3a03dc0d9128b630742b (patch) | |
tree | 6603389f70c8adfb8fc125b81c192ee2b4ca2efc /scm | |
parent | 77d99c047772da8e897af75c49b00523556da01e (diff) |
Issue 3291: Carry any exports from session initialization over to subsequent sessions
When a .ly file in the session initialization loaded a module, this
module's exports were only available in the first session on the
command line. This patch causes any modules available after first
session initialization to be available in subsequent sessions.
Diffstat (limited to 'scm')
-rw-r--r-- | scm/lily.scm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scm/lily.scm b/scm/lily.scm index c1f8f1fe34..cd7b92964b 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -78,6 +78,8 @@ session has started." (lambda (p) (variable-set! (cadr p) (cddr p))) (ly:get-undead lilypond-declarations)))) +(define lilypond-interfaces #f) + (define-public (session-initialize thunk) "Initialize this session. The first session in a LilyPond run is initialized by calling @var{thunk}, then recording the values of all @@ -96,6 +98,7 @@ variables to their value after the initial call of @var{thunk}." (if (ly:undead? lilypond-declarations) (begin + (module-use-interfaces! (current-module) (reverse lilypond-interfaces)) (for-each (lambda (p) (let ((var (cadr p)) @@ -106,6 +109,9 @@ variables to their value after the initial call of @var{thunk}." (ly:get-undead lilypond-declarations))) (begin (thunk) + (set! lilypond-interfaces + (filter (lambda (m) (eq? 'interface (module-kind m))) + (module-uses (current-module)))) (let ((decl (map! (lambda (v) (cons* #f v (variable-ref v))) lilypond-declarations))) |