From 94c0a1343826f84fc78006d07f6ed92e82b6ec02 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 6 May 2012 20:53:51 +0200 Subject: [PATCH] Make \footnote a post-event --- ly/music-functions-init.ly | 2 +- python/convertrules.py | 19 +++++++++++++++++++ scm/define-music-types.scm | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index 59a11264f7..842da9ace6 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -342,7 +342,7 @@ featherDurations= argument)) footnote = -#(define-music-function (parser location text offset grob-name footnote) +#(define-event-function (parser location text offset grob-name footnote) ((markup?) number-pair? (symbol? '()) markup?) (_i "Attach @var{text} at @var{offset} with @var{text} referring to @var{footnote}. If @var{text} is given as @code{\\default}, use diff --git a/python/convertrules.py b/python/convertrules.py index 5c94c59e1f..acabe0237e 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -3346,6 +3346,25 @@ def conv (str): sub_tempo, str) return str +@rule((2, 15, 39), r"\footnote -> <>\footnote, -\footnote -> \footnote") +def conv (str): + def not_first (s): + def match_fun (m): + if m.group (1): + return m.group (0) + return m.expand (s) + return match_fun + str = re.sub ("(" + matchmarkup + ")|" + + r"(?\3"), str) + str = re.sub ("(" + matchmarkup + ")|" + + r"(?