branch: master
commit fb1801ff24b09adc816ef763c9db9cd4b1b5d9dd
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>

    Add a work-around for completing topics in the info dir
    
    * 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 |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/ivy.el b/ivy.el
index 6d70fcf..ed96dc9 100644
--- 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

Reply via email to