Stefan Monnier <monn...@iro.umontreal.ca> writes:

Hi Stefan,

>> Typing 'a' complete to 'aA' (instead of 'Anne <mailaddress>') 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 <monn...@iro.umontreal.ca>, a<tab>

in this message buffer, his function returns

  (376 377 (#("Andreas XXX <xxx@xxx.invalid>" 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<tab>" 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

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to