ソースを参照

Move unused function out of main file

Ryan C. Thompson 7 年 前
コミット
4d5fab50aa
2 ファイル変更14 行追加13 行削除
  1. 0 13
      ido-completing-read+.el
  2. 14 0
      tests/test-ido-completing-read+.el

+ 0 - 13
ido-completing-read+.el

@@ -884,19 +884,6 @@ result."
    for hare on (cdr x) by #'cddr
    thereis (eq tortoise hare)))
 
-(defun ido-cr+-maybe-chop (items elem)
-  "Like `ido-chop', but a no-op if ELEM is not in ITEMS.
-
-Normal `ido-chop' hangs infinitely in this case."
-  (cl-loop
-   with new-tail = ()
-   for remaining on items
-   for next = (car remaining)
-   if (equal next elem)
-   return (nconc remaining new-tail)
-   else collect next into new-tail
-   finally return items))
-
 (defun ido-cr+-update-dynamic-collection ()
   "Update the set of completions for a dynamic collection.
 

+ 14 - 0
tests/test-ido-completing-read+.el

@@ -7,6 +7,20 @@
 (require 'cl-lib)
 (require 'with-simulated-input)
 
+;; Note: Currently unused, but potentially useful in the future
+(defun ido-cr+-maybe-chop (items elem)
+  "Like `ido-chop', but a no-op if ELEM is not in ITEMS.
+
+Normal `ido-chop' hangs infinitely in this case."
+  (cl-loop
+   with new-tail = ()
+   for remaining on items
+   for next = (car remaining)
+   if (equal next elem)
+   return (nconc remaining new-tail)
+   else collect next into new-tail
+   finally return items))
+
 (defun collection-as-function (collection)
   "Return a function equivalent to COLLECTION.