summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorDavid Kastrup <dak@gnu.org>2014-12-29 15:20:57 +0100
committerDavid Kastrup <dak@gnu.org>2015-01-05 19:51:06 +0100
commitdba880a1cff16f6c000b9cef39e012c79a264b22 (patch)
tree6a70b70b27f23bd95244ea49f9cc91bd8726202e /elisp
parenta9866cda4bfaa7c12a118131ed94e837f0f3a536 (diff)
Issue 4234: lilypond-what-beat.el: heed stand-alone durations in music lengths
Diffstat (limited to 'elisp')
-rw-r--r--elisp/lilypond-what-beat.el17
1 files changed, 7 insertions, 10 deletions
diff --git a/elisp/lilypond-what-beat.el b/elisp/lilypond-what-beat.el
index dae02d53d2..3f11b843c1 100644
--- a/elisp/lilypond-what-beat.el
+++ b/elisp/lilypond-what-beat.el
@@ -92,18 +92,15 @@
))
(defun walk-note-duration ()
-"Returns duration of next note, moving point past note.
+ "Returns duration of next note, moving point past note.
If point is not before a note, returns nil
If next note has no duration, returns t"
- (if (not (looking-at pitch-regex))
- nil
- (progn
+ (let ((have-pitch (looking-at pitch-regex)))
+ (if have-pitch (goto-char (match-end 0)))
+ (if (not (looking-at duration-regex))
+ have-pitch
(goto-char (match-end 0))
- (if (not (looking-at duration-regex))
- t
- (progn
- (goto-char (match-end 0))
- (parse-duration (match-string 0)))))))
+ (parse-duration (match-string 0)))))
; returns nil if not at a comment
(defun skip-comment ()
@@ -161,7 +158,7 @@ If next note has no duration, returns t"
(skip-quotation)
(skip-sexp)))
; Now skip anything that isn't alphanum or \. And skip comments or quotations
- (while (or (< 0 (skip-chars-forward "^A-Za-z<%}#=\""))
+ (while (or (< 0 (skip-chars-forward "^A-Za-z1-9<%}#=\""))
(skip-comment)
(skip-quotation)
(skip-sexp)))