]> code.delx.au - gnu-emacs-elpa/commitdiff
Add a work-around for completing topics in the info dir
authorOleh Krehel <ohwoeowho@gmail.com>
Sat, 18 Apr 2015 16:13:05 +0000 (18:13 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Sat, 18 Apr 2015 16:15:06 +0000 (18:15 +0200)
* ivy.el (ivy-read): Weirdly, the topic names need to be wrapped in
  "(...)". Also, `all-completions' returns nothing for "", but returns
  stuff for "(". Also, `all-completions' for "(" returns plenty of
  duplicates.

ivy.el

diff --git a/ivy.el b/ivy.el
index 6d70fcf576108f62149f2c160565194d3fcaaf82..ed96dc94ab5a5dd050b92ade27ee54737730036f 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -254,7 +254,15 @@ the ones that match INITIAL-INPUT.
 
 UPDATE-FN is called each time the current candidate(s) is changed."
   (setq ivy--directory nil)
-  (cond ((eq collection 'read-file-name-internal)
+  (cond ((eq collection 'Info-read-node-name-1)
+         (if (equal Info-current-file "dir")
+             (setq collection
+                   (mapcar (lambda (x) (format "(%s)" x))
+                           (cl-delete-duplicates
+                            (all-completions "(" collection predicate)
+                            :test 'equal)))
+           (setq collection (all-completions "" collection predicate))))
+        ((eq collection 'read-file-name-internal)
          (setq ivy--directory default-directory)
          (setq initial-input nil)
          (setq collection