From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tassilo Horn 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> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: (Stefan Monnier's message of "Thu, 10 Feb 2011 13:20:22 -0500") 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 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