]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-what-beat.el: avoid global assignment to new-duration
authorDavid Kastrup <dak@gnu.org>
Sun, 28 Dec 2014 20:30:56 +0000 (21:30 +0100)
committerDavid Kastrup <dak@gnu.org>
Mon, 5 Jan 2015 18:55:13 +0000 (19:55 +0100)
elisp/lilypond-what-beat.el

index 7612138fec174c9f7b79951d936314d2c4546f46..7541a34e4a9ef14c15c9d9567badef55da6563d9 100644 (file)
@@ -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.