emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/anzu 1da06b0717 262/288: Don't use cl-loop for Emacs 27 bu


From: ELPA Syncer
Subject: [nongnu] elpa/anzu 1da06b0717 262/288: Don't use cl-loop for Emacs 27 bug
Date: Thu, 6 Jan 2022 03:58:59 -0500 (EST)

branch: elpa/anzu
commit 1da06b071755984601cd38c910a088da330b2639
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>

    Don't use cl-loop for Emacs 27 bug
---
 anzu.el | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/anzu.el b/anzu.el
index 9ab18f9092..2c43e268e8 100644
--- a/anzu.el
+++ b/anzu.el
@@ -222,11 +222,16 @@
             result))))))
 
 (defun anzu--where-is-here (positions here)
-  (cl-loop for (start . end) in positions
-           for i = 1 then (1+ i)
-           when (and (>= here start) (<= here end))
-           return i
-           finally return 0))
+  ;; don't use loop for emacs 27 bug
+  (let ((poss positions)
+        (index 1)
+        (ret 0))
+    (while poss
+      (let ((pos (car poss)))
+        (if (and (>= here (car pos)) (<= here (cdr pos)))
+            (setq ret index poss nil)
+          (setq poss (cdr poss) index (1+ index)))))
+    ret))
 
 (defun anzu--use-result-cache-p (input)
   (and (eq (anzu--isearch-regexp-function) (car anzu--last-search-state))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]