From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Monnier Subject: Re: Completing with anything Date: Fri, 18 Mar 2011 14:16:38 -0400 Message-ID: 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 "Fri, 18 Mar 2011 16:00:18 +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: Tassilo Horn Cc: emacs-orgmode@gnu.org, emacs-devel@gnu.org List-Id: emacs-orgmode.gnu.org >> For more complex cases, there is also the issue of what to do when some >> parts of the completion are case-sensitive and other parts aren't >> (e.g. completion of case-sensitive envvars in case-insensitive file >> names), although this is less important for completion-at-point than >> for minibuffer completion since you don't have to return a table that >> covers the completion of the whole field (composed of file names and >> env-vars, for example), and instead you can just limit the completion to >> the particular subfield. > There's still something wrong to me in the solution provided by Tassilo. > It works fine, but it is returning a function to bypass the usual > completion code completion code. Ignoring case, like doing smarter > completion (e.g. where the typed prefix does not match the returned > choices at all) is something that is very useful. > Therefore I wonder if we should either: > - Edit `completion-at-point-functions' docstring to remove the word > "discouraged" in that sentence: > "or a function of no argument to perform completion (discouraged),"; There's a misunderstanding: AFAIK the patch sent by Tassilo does not make the completion-at-point-function return a "function that performs completion" but does properly return completion data (i.e. region start, region end, and completion table), part of which happens to be represented by a function. I.e. this is not one of the discouraged cases. > - Make completing code allows to replace the region being completed with > somethig that does not match at all. AFAIK that's already the case, tho it depends on lots of factors, such as what you mean by "completing code". Stefan