Paper_outputter::close ()
{
if (scm_port_p (file_) == SCM_BOOL_T)
- scm_close_port (file_);
+ {
+ scm_close_port (file_);
+ /*
+ Remove the "warning" definitions for missing stencil
+ expressions so that we start fresh with the next \book
+ block. --pmccarty
+ */
+ SCM proc = ly_lily_module_constant ("remove-stencil-warnings");
+ scm_call_1 (proc, output_module_);
+ }
}
scope)))
(apply string-append (map output-scope scopes)))
+(define missing-stencil-list '())
+
(define-public (backend-testing output-module)
(define (missing-stencil-expression name)
(begin
(map (lambda (x)
(if (not (module-defined? output-module x))
- (module-define! output-module x
- (lambda* (#:optional y . z)
- (missing-stencil-expression x)))))
+ (begin
+ (module-define! output-module x
+ (lambda* (#:optional y . z)
+ (missing-stencil-expression x)))
+ (set! missing-stencil-list (append (list x)
+ missing-stencil-list)))))
(ly:all-stencil-commands)))
+
+(define-public (remove-stencil-warnings output-module)
+ (for-each
+ (lambda (x)
+ (module-remove! output-module x))
+ missing-stencil-list))