Julien Danjou <[email protected]> writes:
Hi Julien,
> To be clear, the things that disturbs me is that this simple test case
> does not work as I would like it to:
>
> #+begin_src emacs-lisp
> (defun jd:completion-at-point-test ()
> (list (point-at-bol) (point) '("Steve" "John")))
> (add-to-list 'completion-at-point-functions 'jd:completion-at-point-test)
> #+end_src
>
> If you run that code into a buffer, and then type in this same buffer:
>
> L
>
> And try to complete that "L" with M-x completion-at-point, it will say
> "No match."
>
> But if you do:
> #+begin_src emacs-lisp
> (defun jd:completion-at-point-test ()
> (list (point-at-bol) (point) '("Lionel" "Steve" "John")))
> (add-to-list 'completion-at-point-functions 'jd:completion-at-point-test)
> #+end_src
>
> And try to complete a "L", it will complete to Lionel. Just because
> completion-at-point is trying to be smarter than my function,
> re-guessing which items from the collection are good candidates.
> Something my function already does (well, not in this example, but in
> real life).
Sorry, but I totally missed the point of the example. :-)
Isn't completion of "L" to "Lionel" at the beginning of a line exactly
what your completion function should enable? With the bzr version of
yesterday, I get these results:
--8<---------------cut here---------------start------------->8---
L<TAB>
Lionel
L<TAB>
;; message: no match
Lionel<TAB>
;; message: sole completion
--8<---------------cut here---------------end--------------->8---
Bye,
Tassilo