瀏覽代碼

Enable limited flex-matching for dynamic collections

Previously, for dynamic collections, ido-cr+ was limited to prefix
matching. Now all the initially availble completion candidates are
retained, and only dynamically-added candidates are limited to prefix
matching.

This isn't going to be sufficient for functions that implementn
fancier completion behaviors. The solution for those is still
blacklisting.
Ryan C. Thompson 8 年之前
父節點
當前提交
9f44c78667
共有 1 個文件被更改,包括 10 次插入3 次删除
  1. 10 3
      ido-completing-read+.el

+ 10 - 3
ido-completing-read+.el

@@ -501,9 +501,16 @@ sets up C-j to be equivalent to TAB in the same situation."
               (def (nth 6 ido-cr+-orig-completing-read-args))
               (predicate (nth 2 ido-cr+-orig-completing-read-args)))
           (setq ido-cur-list
-                (all-completions current-ido-text
-                                 ido-cr+-dynamic-collection
-                                 predicate))
+                (delete-dups
+                 (append
+                  (all-completions
+                   current-ido-text
+                   ido-cr+-dynamic-collection
+                   predicate)
+                  (all-completions
+                   ""
+                   ido-cr+-dynamic-collection
+                   predicate))))
           (unless (listp def)
             (setq def (list def)))
           (when def