From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tassilo Horn Subject: Re: Completing with anything Date: Mon, 21 Mar 2011 13:51:45 +0100 Message-ID: <87lj08fxge.fsf@member.fsf.org> References: <87r5bhysp6.fsf@keller.adm.naquadah.org> <878vxovsym.fsf@keller.adm.naquadah.org> <87k4h7ua23.fsf@member.fsf.org> <87vd0romky.fsf@keller.adm.naquadah.org> <87mxm2na63.fsf@member.fsf.org> <87vd0qfhu3.fsf@member.fsf.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: (Julien Danjou's message of "Mon, 21 Mar 2011 12:23:09 +0100") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org To: Stefan Monnier Cc: emacs-orgmode@gnu.org, emacs-devel@gnu.org List-Id: emacs-orgmode.gnu.org Julien Danjou 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 Lionel L ;; message: no match Lionel ;; message: sole completion --8<---------------cut here---------------end--------------->8--- Bye, Tassilo