Gnus development mailing list
 help / color / mirror / Atom feed
From: Arash Esbati <arash@gnu.org>
To: Julien Cubizolles <j.cubizolles@free.fr>
Cc: ding@gnus.org
Subject: Re: completion no more working with latest HEADs (emacs and bbdb)
Date: Thu, 02 Feb 2023 10:48:27 +0100	[thread overview]
Message-ID: <86r0v8bdp0.fsf@gnu.org> (raw)
In-Reply-To: <878rhieusy.fsf@free.fr> (Julien Cubizolles's message of "Tue, 31 Jan 2023 13:46:05 +0100")

Julien Cubizolles <j.cubizolles@free.fr> writes:

> Arash Esbati <arash@gnu.org> writes:
>
>> (setq eudc-server-hotlist '(("localhost" . bbdb)))
>>
>> (add-hook 'message-mode-hook
>>           (lambda ()
>>             (setq-local completion-at-point-functions
>>                         (delq 'message-completion-function
>>                               completion-at-point-functions))
>>             (add-to-list 'completion-at-point-functions
>>                          #'eudc-capf-complete)))
>
> I noticed that this setup, while working for bbdb completions in the To: field,
> breaks it for completing groups in the Gcc: field.
>
> I get both completions working with:
>
>  (add-hook 'message-mode-hook
>            (lambda ()
>              (add-to-list 'completion-at-point-functions
>                           #'eudc-capf-complete)))

This is by design:

,----[ C-h f eudc-capf-complete RET ]
| eudc-capf-complete is an autoloaded native-compiled Lisp function in
| ‘eudc-capf.el’.
| 
| (eudc-capf-complete)
| 
| Email address completion function for ‘completion-at-point-functions’.
| 
| This function checks whether the current major mode is one of the
| modes listed in ‘eudc-capf-modes’, and whether point is on a line
| with a message header listing email recipients, that is, a line
| whose beginning matches ‘message-email-recipient-header-regexp’,
| and, if the check succeeds, searches for records matching the
| words before point.
| 
| The return value is either nil when no match is found, or a
| completion table as required for functions listed in
| ‘completion-at-point-functions’.
| 
|   Probably introduced at or before Emacs version 29.1.
| 
`----

And in addition:

,----[ C-h v message-email-recipient-header-regexp RET ]
| message-email-recipient-header-regexp is a variable defined in ‘message.el’.
| 
| Its value is
| "^\\([^ :]*-\\)?\\(To\\|B?Cc\\|From\\|Reply-to\\|Mail-Followup-To\\|Mail-Copies-To\\):"
| 
| Regexp matching headers that list email addresses.
| 
|   This variable was introduced, or its default value was changed, in
|   version 29.1 of Emacs.
|   You can customize this variable.
| 
`----

So you have to tweak the regexp to something like this:

  "^\\([^ :]*-\\)?\\(To\\|[BG]?Cc\\|From\\|Reply-to\\|Mail-Followup-To\\|Mail-Copies-To\\):"

Best, Arash


  reply	other threads:[~2023-02-02  9:49 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15 13:29 Peter Münster
2022-11-15 17:04 ` Peter Münster
2022-11-15 21:31 ` Eric Abrahamsen
2022-11-16  7:48 ` Arash Esbati
2022-11-16  8:46   ` Peter Münster
2022-11-16  8:58     ` Arash Esbati
2022-11-16 10:05       ` Peter Münster
2022-11-16 11:43         ` Arash Esbati
2022-11-16 16:17           ` Eric Abrahamsen
2023-01-23  9:34           ` Julien Cubizolles
2023-01-23 14:05             ` Arash Esbati
2023-01-23 15:22               ` Arash Esbati
2023-01-23 23:14                 ` Julien Cubizolles
2023-01-24 12:37                   ` Arash Esbati
2023-01-25 21:09                     ` Julien Cubizolles
2023-01-27  8:42                       ` Arash Esbati
2023-01-27 18:45                         ` Eric Abrahamsen
2023-01-31 12:46                     ` Julien Cubizolles
2023-02-02  9:48                       ` Arash Esbati [this message]
2023-02-03  5:31                         ` Julien Cubizolles
2023-02-03 11:04                           ` Arash Esbati
2023-02-13 17:29                             ` Julien Cubizolles
2023-01-24  8:32                 ` Julien Cubizolles

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86r0v8bdp0.fsf@gnu.org \
    --to=arash@gnu.org \
    --cc=ding@gnus.org \
    --cc=j.cubizolles@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).