瀏覽代碼

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
    for hare on (cdr x) by #'cddr
    thereis (eq tortoise hare)))
    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 ()
 (defun ido-cr+-update-dynamic-collection ()
   "Update the set of completions for a 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 'cl-lib)
 (require 'with-simulated-input)
 (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)
 (defun collection-as-function (collection)
   "Return a function equivalent to COLLECTION.
   "Return a function equivalent to COLLECTION.