emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Re: Completing with anything


From: Tassilo Horn
Subject: [O] Re: Completing with anything
Date: Mon, 21 Mar 2011 13:51:45 +0100
User-agent: Gnus/5.110016 (No Gnus v0.16) Emacs/24.0.50 (gnu/linux)

Julien Danjou <address@hidden> 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



reply via email to

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