浏览代码

Replace choices with collection

ido-completing-read uses "choices" instead of "collection", and ido-cr+
uses the completing-read convention now, so some code that rpeviously
referred to "choices" now needs to refer to "collection" instead.

Fixes #75.
Ryan C. Thompson 10 年之前
父节点
当前提交
d4d65970d9
共有 1 个文件被更改,包括 9 次插入9 次删除
  1. 9 9
      ido-completing-read+.el

+ 9 - 9
ido-completing-read+.el

@@ -167,13 +167,13 @@ completion for them."
                     (format
                      "there are more than %i items in COLLECTION (see `ido-cr+-max-items')"
                      ido-cr+-max-items)))
-          ;; ido doesn't natively handle DEF being a list. If DEF is
-          ;; a list, prepend it to CHOICES and set DEF to just the
+          ;; ido doesn't natively handle DEF being a list. If DEF is a
+          ;; list, prepend it to COLLECTION and set DEF to just the
           ;; car of the default list.
           (when (and def (listp def))
-            (setq choices
+            (setq collection
                   (append def
-                          (nreverse (cl-set-difference choices def)))
+                          (nreverse (cl-set-difference collection def)))
                   def (car def)))
           ;; Work around a bug in ido when both INITIAL-INPUT and
           ;; DEF are provided.
@@ -185,11 +185,11 @@ completion for them."
             (when (and def initial
                        (stringp initial)
                        (not (string= initial "")))
-              ;; Both default and initial input were provided. So
-              ;; keep the initial input and preprocess the choices
-              ;; list to put the default at the head, then proceed
-              ;; with default = nil.
-              (setq choices (cons def (remove def choices))
+              ;; Both default and initial input were provided. So keep
+              ;; the initial input and preprocess the collection list
+              ;; to put the default at the head, then proceed with
+              ;; default = nil.
+              (setq collection (cons def (remove def collection))
                     def nil)))
           ;; Ready to do actual ido completion
           (prog1