From d68d75bb680d874bfa0890dc29940f1db3f03eca Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 28 Dec 2014 21:50:17 +0100 Subject: [PATCH] Issue 4232: lilypond-what-beat.el: Allow \tuplet to work like \times --- elisp/lilypond-what-beat.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/elisp/lilypond-what-beat.el b/elisp/lilypond-what-beat.el index 7541a34e4a..59a4fe1d52 100644 --- a/elisp/lilypond-what-beat.el +++ b/elisp/lilypond-what-beat.el @@ -204,12 +204,15 @@ If next note has no duration, returns t" (while (< (point) end) (let ((new-duration (walk-note-duration))) (if (null new-duration) - (if (not (looking-at "\\\\times[ \t]*\\([1-9]*\\)/\\([1-9]*\\)[ \t\n]*{")) + (if (not (looking-at + (concat "\\\\t\\(?:\\(imes\\)\\|uplet\\)[ \t]*\\([0-9]+\\)/\\([0-9]+\\)\\(?:[ \t\n]" + duration-regex "\\)?[ \t\n]*{"))) (skip-good-keywords) - ; handle \times specially - (let ((numerator (string-to-int (match-string 1))) - (denominator (string-to-int (match-string 2)))) + ; handle \times/\tuplet specially + (let* ((times-p (match-beginning 1)) + (numerator (string-to-int (match-string (if times-p 2 3)))) + (denominator (string-to-int (match-string (if times-p 3 2))))) (goto-char (match-end 0)) (goto-note-begin) (while (and (not (looking-at "}")) -- 2.39.2