[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using ido-completions in other packages
From: |
Andrea Crotti |
Subject: |
Re: Using ido-completions in other packages |
Date: |
Fri, 04 Jun 2010 16:41:32 +0200 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (darwin) |
Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
>
> I don't know what is senator-jump, but i guess this function use a
> simple read-string. To have completion you need a *-completing-read with a
> collection as arg.
Here is the part of the code that I think is in charge for showing me
the list of possibilities.
It does use completing-read, but maybe using apply it doesn't work?
(Just wild guessing).
--8<---------------cut here---------------start------------->8---
(let*
...
(completing-read-args
(list (if (and context (car context))
(format "%s(default: %s) " prompt (car context))
prompt)
(setq senator-jump-completion-list
(senator-completion-list in-context))
nil
require-match
""
'semantic-read-symbol-history)))
(list
(apply #'completing-read
(if (and context (car context))
(append completing-read-args context)
completing-read-args))
in-context no-default)))
--8<---------------cut here---------------end--------------->8---
>
> ,----
> | (defun dvc-completing-read (&rest args)
> | "Read a string in the minibuffer, with completion.
> | Set `dvc-completing-read-function' to determine which function to use.
> |
> | See `completing-read' for a description of ARGS."
> | ;; Initialize dvc-completing-read-function on the first invocation of
> dvc-completing-read
> | ;; This allows to enable ido-mode after loading DVC
> | (when (eq dvc-completing-read-function 'auto)
> | (setq dvc-completing-read-function (if (and (boundp 'ido-mode) ido-mode)
> | 'ido-completing-read
> | 'completing-read)))
> | (apply dvc-completing-read-function args))
> `----
>
>
Thanks a lot this looks alos cleaner...
Re: Using ido-completions in other packages, William Xu, 2010/06/08