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: [Orgmode] Re: Announcing org-contacts, a bbdb-like contact manager for Org Date: Fri, 11 Feb 2011 11:21:56 +0100 Message-ID: <87mxm2na63.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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1297419826 1911 80.91.229.12 (11 Feb 2011 10:23:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 11 Feb 2011 10:23:46 +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 Fri Feb 11 11:23:41 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 1PnqA8-0004CA-0z for ged-emacs-devel@m.gmane.org; Fri, 11 Feb 2011 11:23:41 +0100 Original-Received: from localhost ([127.0.0.1]:38042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnqA6-0008CD-LX for ged-emacs-devel@m.gmane.org; Fri, 11 Feb 2011 05:23:38 -0500 Original-Received: from [140.186.70.92] (port=45397 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pnq8V-0007L9-Pb for emacs-devel@gnu.org; Fri, 11 Feb 2011 05:22:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pnq8U-0004iG-Cb for emacs-devel@gnu.org; Fri, 11 Feb 2011 05:21:59 -0500 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:19142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pnq8U-0004iC-3X; Fri, 11 Feb 2011 05:21:58 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 361D67814ECA; Fri, 11 Feb 2011 11:21:57 +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 09049-02; Fri, 11 Feb 2011 11:21:56 +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 493007814EC4; Fri, 11 Feb 2011 11:21:56 +0100 (CET) In-Reply-To: (Stefan Monnier's message of "Thu, 10 Feb 2011 13:20:22 -0500") User-Agent: Gnus/5.110011 (No Gnus v0.11) 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:135885 gmane.emacs.orgmode:37423 Archived-At: Stefan Monnier writes: Hi Stefan, >> Typing 'a' complete to 'aA' (instead of 'Anne ') and >> then does nothing since aA is not valid. > >> I'm not sure completion-at-point-functions is correctly usable in >> this same condition as message/bbdb completion was. The latter used >> to return a function which is marked as decouraged in >> `completion-at-point-functions' docstring. So org-contacts does not >> use it. OTOH, returning a (START END COLLECTION) triplet is not very >> usable since if you return a collection that start with a different >> character set than (buffer-substring start end), it does not work. > > I don't fully understand what you're saying, probably for lack of > context, but at least it's not true that "if you return a collection > that start with a different character set than (buffer-substring start > end), it doesn't work". That simply depends on completion-styles (and > completion-ignore-case of course). I've just edebugged Juliens function, and if I try to complete To: Stefan Monnier , a in this message buffer, his function returns (376 377 (#("Andreas XXX " 0 12 (org-category "contacts" fontified nil)))) which is correct. Case didn't get accounted, and that's the only possible completion. However, what gets inserted after the "a" is only a TAB character. The value of `completion-styles' in the current message buffer is (basic initials partial-completion), which should be ok for that kind of completion. But the global value of completion-ignore-case is nil. So the problem seems to be that Julien's completion at point functions respects the value of his own `org-contacts-completion-ignore-case' variable when *calculating* completions, but it is not considered anymore when the completion style *applies* the completions. When I do (set (make-local-variable 'completion-ignore-case) t) in the current message buffer and try again, then "a" is correctly completed to the Andreas Julien's function calculated. However, I want case insensitive completion only for contact completion in the headers, but not in the message body. So the question is: how can the completion-ignore-case value be propagated from the completion gathering function in `completion-at-point-functions' to the function that actually applies this completion, without having to modify the global or buffer local value of `completion-ignore-case'? Bye, Tassilo