emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [elpa] master 567ea7e 1/3: Ivy-mode now works better with `find-file


From: Stefan Monnier
Subject: Re: [elpa] master 567ea7e 1/3: Ivy-mode now works better with `find-file'
Date: Sat, 18 Apr 2015 10:12:13 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> This is working, but the problem is that functions are made to return
> the completion part of what you have in minibuffer, and this is
> impossible to handle from 3rd tools.
> Take the example of find-file-at-point, it returns a list of relative
> file names, what should we call to return the same list prefixed by what
> is in minibuffer ?

I have the impression that the question is aimed in my direction, but
I don't understand it enough to answer.  E.g. I don't understand what
you mean by "find-file-at-point returns a list of relative
file names" and how it's relevant to the discussion.

Maybe the answer you're looking for is something like:

   (pcase-let ((`(,start . ,_)
                (completion-boundaries <str> <collection> <pred> ""))
               (compls (all-completions <str> <collection> <pred>)))
     (if (zerop start) compls
       (let ((prefix (substring <str> 0 start)))
         (mapcar (lambda (compl) (concat prefix compl)) compls))))


-- Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]