From: David Kastrup Date: Sun, 28 Dec 2014 20:30:56 +0000 (+0100) Subject: lilypond-what-beat.el: avoid global assignment to new-duration X-Git-Tag: release/2.19.16-1~2^2~38^2~25 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7639abf194db2ffb55a7caa2075d8b7820715ec5;p=lilypond.git lilypond-what-beat.el: avoid global assignment to new-duration --- diff --git a/elisp/lilypond-what-beat.el b/elisp/lilypond-what-beat.el index 7612138fec..7541a34e4a 100644 --- a/elisp/lilypond-what-beat.el +++ b/elisp/lilypond-what-beat.el @@ -199,11 +199,10 @@ If next note has no duration, returns t" (result '(0 1))) ; 0 in fraction form (if (= measure-start -1) (message "No | before point") - (progn - (goto-char (1+ measure-start)) - (goto-note-begin) - (while (< (point) end) - (setq new-duration (walk-note-duration)) + (goto-char (1+ measure-start)) + (goto-note-begin) + (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]*{")) (skip-good-keywords) @@ -232,10 +231,9 @@ If next note has no duration, returns t" (if (not (eq new-duration t)) (setq duration new-duration)) (setq result (add-fractions result duration))) - (goto-note-begin)) + (goto-note-begin))) - result -)))))) + result))))) (defun LilyPond-what-beat () "Returns how much of a measure lies between last measaure '|' and point.