branch: elpa/sly
commit 7c2faf983c54c48366e4fe0c2a1f821ad1811c5e
Author: Christian Schafmeisterr <[email protected]>
Commit: AndrĂ© A. Gomes <[email protected]>

    Fix LOOP macro in search-for-recording-1
    
    The search-for-recording-1 function depended on nonconforming behavior
    of the LOOP macro.
---
 contrib/slynk-stickers.lisp | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/contrib/slynk-stickers.lisp b/contrib/slynk-stickers.lisp
index 9cc4615e803..d8d467abcd3 100644
--- a/contrib/slynk-stickers.lisp
+++ b/contrib/slynk-stickers.lisp
@@ -242,7 +242,7 @@ after.")
                                       increment)
   "Return two values: a RECORDING and its position in *RECORDINGS*.
 Start searching from position FROM, an index in *RECORDINGS* which is
-successibely increased by INCREMENT before using that to index
+successively increased by INCREMENT before using that to index
 *RECORDINGS*."
   (loop for starting-position in `(,from ,(if (plusp increment)
                                               -1
@@ -250,14 +250,16 @@ successibely increased by INCREMENT before using that to 
index
         ;; this funky scheme has something to do with rollover
         ;; semantics probably
         ;;
-        for inc in `(,increment ,(if (plusp increment) 1 -1))
+        for inc in `(,increment ,(if (plusp from) 1 -1))
         for (rec idx) = (loop for cand-idx = (incf starting-position
                                                    inc)
-                              while (< -1 cand-idx (length *recordings*))
-                              for recording = (aref *recordings* cand-idx)
-                              for sid = (id-of (sticker-of recording))
-                              unless (funcall ignore-p sid)
-                                return (list recording cand-idx))
+                              if (< -1 cand-idx (length *recordings*))
+                                do (let* ((recording (aref *recordings* 
cand-idx))
+                                          (sid (id-of (sticker-of recording))))
+                                     (unless (funcall ignore-p sid)
+                                       (return (list recording cand-idx))))
+                              else
+                                do (return (list nil cand-idx)))
         when rec
           return (values rec idx)))
 

Reply via email to