From: David Kastrup Date: Sat, 27 Jun 2015 11:34:36 +0000 (+0200) Subject: Issue 4474/5: Provide with-location macro X-Git-Tag: release/2.19.23-1~10 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=873f9fd2771a59c1f24d37b389d2e98107fd109d;p=lilypond.git Issue 4474/5: Provide with-location macro --- diff --git a/scm/lily.scm b/scm/lily.scm index 90e85c8db1..ff5d66dfed 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -51,6 +51,9 @@ ;; No public setters: should not get overwritten in action (define-public (*parser*) (fluid-ref %parser)) (define-public (*location*) (fluid-ref %location)) +;; but properly scoped location should be fine +(defmacro-public with-location (loc . body) + `(with-fluids ((,%location ,loc)) ,@body)) ;; It would be nice to convert occurences of parser/location to ;; (*parser*)/(*location*) using the syncase module but it is utterly