From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel,gmane.emacs.orgmode 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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1300711926 8035 80.91.229.12 (21 Mar 2011 12:52:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 21 Mar 2011 12:52:06 +0000 (UTC) Cc: emacs-orgmode@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 21 13:52:02 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q1eaX-0000NT-SC for ged-emacs-devel@m.gmane.org; Mon, 21 Mar 2011 13:52:02 +0100 Original-Received: from localhost ([127.0.0.1]:32981 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1eaW-0001WD-W2 for ged-emacs-devel@m.gmane.org; Mon, 21 Mar 2011 08:52:01 -0400 Original-Received: from [140.186.70.92] (port=53589 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1eaL-0001V0-F6 for emacs-devel@gnu.org; Mon, 21 Mar 2011 08:51:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q1eaJ-00044I-TU for emacs-devel@gnu.org; Mon, 21 Mar 2011 08:51:48 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:16674) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q1eaJ-000447-Lh; Mon, 21 Mar 2011 08:51:47 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 35ED47815617; Mon, 21 Mar 2011 13:51:46 +0100 (CET) Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 32424-01; Mon, 21 Mar 2011 13:51:45 +0100 (CET) X-CHKRCPT: Envelopesender noch tassilo@member.fsf.org Original-Received: from thinkpad (tsdh.uni-koblenz.de [141.26.67.142]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 483EE78155CA; Mon, 21 Mar 2011 13:51:45 +0100 (CET) In-Reply-To: (Julien Danjou's message of "Mon, 21 Mar 2011 12:23:09 +0100") User-Agent: Gnus/5.110016 (No Gnus v0.16) Emacs/24.0.50 (gnu/linux) X-Virus-Scanned: amavisd-new at uni-koblenz.de X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 141.26.64.15 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-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 Xref: news.gmane.org gmane.emacs.devel:137468 gmane.emacs.orgmode:39871 Archived-At: 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