Hello Filipp, Filipp Gunbin writes: >> [...] >> This reads as if t ("do nothing") vs. 'move ("move to the limit of >> search") should make a difference? A few quick experiments seem to >> indicate that in practice both seem to behave the same though. In this >> light, I'm fine with changing 'move to t. > > Well honestly I was fooled by save-excursion, and didn't notice the > return value of (point), with which the value we're talking about _may_ > matter. However, your regexp will always match, due to \\|^ branch > which will find bol, so you can just do: > > (save-excursion > (re-search-backward "\\([:,]\\|^\\)[ \t]*") > (match-end 0)) I tried without the surrounding save-excursion, and even then I didn't notice any difference in behaviour between t and 'move for NOERROR. Your suggested simplification works just as well, of course. Thanks for pointing out! Updated patch below. >> [...] >> That said, it would probably be desirable for message mode to have >> different values for both, completion-at-point-functions and >> completion-styles, depending on where point is (email header, newsgroup >> header, message body, etc.). But this seems like a wider discussion >> about the architecture of message.el rather than this patch. > > Yes, sounds like another use case for completion-category-overrides. Hadn't come across that one yet; thanks for the pointer. Message.el does this: (add-to-list 'completion-category-defaults '(email (styles substring))) It seems to me you suggest amending that line in message.el, rather than having the setq-local in my capf function? I have included this in the below patch, too. Many thanks and looking forward to your thoughts, --alexander