]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4232: lilypond-what-beat.el: Allow \tuplet to work like \times
authorDavid Kastrup <dak@gnu.org>
Sun, 28 Dec 2014 20:50:17 +0000 (21:50 +0100)
committerDavid Kastrup <dak@gnu.org>
Mon, 5 Jan 2015 18:55:14 +0000 (19:55 +0100)
elisp/lilypond-what-beat.el

index 7541a34e4a9ef14c15c9d9567badef55da6563d9..59a4fe1d526dea64d84c14c05a067d95027d9f94 100644 (file)
@@ -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 "}"))