LEFT | RIGHT |
1 ;;;; This file is part of LilyPond, the GNU music typesetter. | 1 ;;;; This file is part of LilyPond, the GNU music typesetter. |
2 ;;;; | 2 ;;;; |
3 ;;;; Copyright (C) 1998--2015 Jan Nieuwenhuizen <janneke@gnu.org> | 3 ;;;; Copyright (C) 1998--2015 Jan Nieuwenhuizen <janneke@gnu.org> |
4 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 ;;;; | 5 ;;;; |
6 ;;;; LilyPond is free software: you can redistribute it and/or modify | 6 ;;;; LilyPond is free software: you can redistribute it and/or modify |
7 ;;;; it under the terms of the GNU General Public License as published by | 7 ;;;; it under the terms of the GNU General Public License as published by |
8 ;;;; the Free Software Foundation, either version 3 of the License, or | 8 ;;;; the Free Software Foundation, either version 3 of the License, or |
9 ;;;; (at your option) any later version. | 9 ;;;; (at your option) any later version. |
10 ;;;; | 10 ;;;; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 (define (add-session-variable name value) | 119 (define (add-session-variable name value) |
120 (set! lilypond-declarations | 120 (set! lilypond-declarations |
121 (cons (make-session-variable name value) lilypond-declarations))) | 121 (cons (make-session-variable name value) lilypond-declarations))) |
122 `(,add-session-variable ',name ,value)) | 122 `(,add-session-variable ',name ,value)) |
123 | 123 |
124 (defmacro-public define-session-public (name value) | 124 (defmacro-public define-session-public (name value) |
125 "Like @code{define-session}, but also exports @var{name} into parser modules." | 125 "Like @code{define-session}, but also exports @var{name} into parser modules." |
126 (define (add-session-variable name value) | 126 (define (add-session-variable name value) |
127 (set! lilypond-exports | 127 (set! lilypond-exports |
128 (acons name (make-session-variable name value) lilypond-exports))) | 128 (acons name (make-session-variable name value) lilypond-exports))) |
129 `(,add-session-variable ',name ,value)) | 129 `(begin |
| 130 ;; this is a bit icky: we place the variable right into every |
| 131 ;; parser module so that both set! and define will affect the |
| 132 ;; original variable in the (lily) module. However, we _also_ |
| 133 ;; export it normally from (lily) for the sake of other modules |
| 134 ;; not sharing the name space of the parser. |
| 135 (,add-session-variable ',name ,value) |
| 136 (export ,name))) |
130 | 137 |
131 (define (session-terminate) | 138 (define (session-terminate) |
132 (if (ly:undead? lilypond-declarations) | 139 (if (ly:undead? lilypond-declarations) |
133 (begin | 140 (begin |
134 (for-each | 141 (for-each |
135 (lambda (p) (variable-set! (cadr p) (cddr p))) | 142 (lambda (p) (variable-set! (cadr p) (cddr p))) |
136 (ly:get-undead lilypond-declarations)) | 143 (ly:get-undead lilypond-declarations)) |
137 (run-hook after-session-hook)))) | 144 (run-hook after-session-hook)))) |
138 | 145 |
139 (define lilypond-interfaces #f) | 146 (define lilypond-interfaces #f) |
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 (ly:exit 0 #f))))) | 1113 (ly:exit 0 #f))))) |
1107 | 1114 |
1108 (define (gui-no-files-handler) | 1115 (define (gui-no-files-handler) |
1109 (let* ((ly (string-append (ly:effective-prefix) "/ly/")) | 1116 (let* ((ly (string-append (ly:effective-prefix) "/ly/")) |
1110 ;; FIXME: soft-code, localize | 1117 ;; FIXME: soft-code, localize |
1111 (welcome-ly (string-append ly "Welcome_to_LilyPond.ly")) | 1118 (welcome-ly (string-append ly "Welcome_to_LilyPond.ly")) |
1112 (cmd (get-editor-command welcome-ly 0 0 0))) | 1119 (cmd (get-editor-command welcome-ly 0 0 0))) |
1113 (ly:message (_ "Invoking `~a'...\n") cmd) | 1120 (ly:message (_ "Invoking `~a'...\n") cmd) |
1114 (system cmd) | 1121 (system cmd) |
1115 (ly:exit 1 #f))) | 1122 (ly:exit 1 #f))) |
LEFT | RIGHT |