* completion no more working with latest HEADs (emacs and bbdb)
@ 2022-11-15 13:29 Peter Münster
2022-11-15 17:04 ` Peter Münster
` (2 more replies)
0 siblings, 3 replies; 23+ messages in thread
From: Peter Münster @ 2022-11-15 13:29 UTC (permalink / raw)
To: ding
Hi,
When trying to complete the destination address in message-mode with the
TAB-key, instead of completion I get the following message:
Loading eudcb-ecomplete...done
Loading eudcb-mailabbrev...done
No match
And after changing the value of eudc-server-hotlist to '(("localhost" .
bbdb)), I get:
Loading eudcb-bbdb...done
Parsing BBDB file ‘~/.emacs.d/bbdb’...done
Outdated usage of ‘bbdb-search’
And still no match.
What is the right way, to get completion in message-mode now with the
latest emacs master branch please?
TIA for any help,
--
Peter
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2022-11-15 13:29 completion no more working with latest HEADs (emacs and bbdb) 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
2 siblings, 0 replies; 23+ messages in thread
From: Peter Münster @ 2022-11-15 17:04 UTC (permalink / raw)
To: ding
Hi,
Since my message was not visible on Gmane for several hours, I've tried
to send it again once or twice. Please ignore copies of this message,
I'm sorry for the noise.
Kind regards,
--
Peter
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2022-11-15 13:29 completion no more working with latest HEADs (emacs and bbdb) 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
2 siblings, 0 replies; 23+ messages in thread
From: Eric Abrahamsen @ 2022-11-15 21:31 UTC (permalink / raw)
To: ding
Peter Münster <pm@a16n.net> writes:
> Hi,
>
> When trying to complete the destination address in message-mode with the
> TAB-key, instead of completion I get the following message:
>
> Loading eudcb-ecomplete...done
> Loading eudcb-mailabbrev...done
> No match
>
> And after changing the value of eudc-server-hotlist to '(("localhost" .
> bbdb)), I get:
>
> Loading eudcb-bbdb...done
> Parsing BBDB file ‘~/.emacs.d/bbdb’...done
> Outdated usage of ‘bbdb-search’
>
> And still no match.
>
> What is the right way, to get completion in message-mode now with the
> latest emacs master branch please?
Completion has stopped working for EBDB, as well. I assume the work on
EUDC has broken something, but I don't understand how it's broken EBDB,
since there we just clobber all the message-mode completion stuff
altogether. I'll float this on emacs.devel.
Eric
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2022-11-15 13:29 completion no more working with latest HEADs (emacs and bbdb) 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
2 siblings, 1 reply; 23+ messages in thread
From: Arash Esbati @ 2022-11-16 7:48 UTC (permalink / raw)
To: Peter Münster; +Cc: ding
Peter Münster <pm@a16n.net> writes:
> And after changing the value of eudc-server-hotlist to '(("localhost" .
> bbdb)), I get:
>
> Loading eudcb-bbdb...done
> Parsing BBDB file ‘~/.emacs.d/bbdb’...done
> Outdated usage of ‘bbdb-search’
>
> And still no match.
>
> What is the right way, to get completion in message-mode now with the
> latest emacs master branch please?
I faced this issue as well and my solution was this:
(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))))
I don't think this is the right way, but it works for now (I use corfu).
Best, Arash
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2022-11-16 7:48 ` Arash Esbati
@ 2022-11-16 8:46 ` Peter Münster
2022-11-16 8:58 ` Arash Esbati
0 siblings, 1 reply; 23+ messages in thread
From: Peter Münster @ 2022-11-16 8:46 UTC (permalink / raw)
To: ding
On Wed, Nov 16 2022, Arash Esbati wrote:
> I don't think this is the right way, but it works for now (I use corfu).
It does not work for me. Perhaps because I use bbdb (latest version)...
--
Peter
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2022-11-16 8:46 ` Peter Münster
@ 2022-11-16 8:58 ` Arash Esbati
2022-11-16 10:05 ` Peter Münster
0 siblings, 1 reply; 23+ messages in thread
From: Arash Esbati @ 2022-11-16 8:58 UTC (permalink / raw)
To: Peter Münster; +Cc: ding
Peter Münster <pm@a16n.net> writes:
> On Wed, Nov 16 2022, Arash Esbati wrote:
>
>> I don't think this is the right way, but it works for now (I use corfu).
>
> It does not work for me. Perhaps because I use bbdb (latest version)...
I also use BBDB (latest version from MELPA), corfu is the in-buffer
completion UI I use.
Best, Arash
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2022-11-16 8:58 ` Arash Esbati
@ 2022-11-16 10:05 ` Peter Münster
2022-11-16 11:43 ` Arash Esbati
0 siblings, 1 reply; 23+ messages in thread
From: Peter Münster @ 2022-11-16 10:05 UTC (permalink / raw)
To: ding
On Wed, Nov 16 2022, Arash Esbati wrote:
> I also use BBDB (latest version from MELPA), corfu is the in-buffer
> completion UI I use.
If you can confirm, that you use also latest emacs-master, then I'll try
corfu too.
--
Peter
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
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
0 siblings, 2 replies; 23+ messages in thread
From: Arash Esbati @ 2022-11-16 11:43 UTC (permalink / raw)
To: Peter Münster; +Cc: ding
Peter Münster <pm@a16n.net> writes:
> If you can confirm, that you use also latest emacs-master, then I'll try
> corfu too.
emacs-version: 29.0.50
emacs-repository-version: 277504584d4cf7b3d67cd4a8cae1849b6cc700fc
My corfu config is:
(setq corfu-auto t)
(setq corfu-echo-documentation nil)
(setq corfu-quit-at-boundary nil)
(setq corfu-quit-no-match t)
(global-corfu-mode)
(corfu-indexed-mode)
(keymap-set corfu-map "M-d" #'corfu-doc-toggle)
Best, Arash
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2022-11-16 11:43 ` Arash Esbati
@ 2022-11-16 16:17 ` Eric Abrahamsen
2023-01-23 9:34 ` Julien Cubizolles
1 sibling, 0 replies; 23+ messages in thread
From: Eric Abrahamsen @ 2022-11-16 16:17 UTC (permalink / raw)
To: ding
Arash Esbati <arash@gnu.org> writes:
> Peter Münster <pm@a16n.net> writes:
>
>> If you can confirm, that you use also latest emacs-master, then I'll try
>> corfu too.
>
> emacs-version: 29.0.50
> emacs-repository-version: 277504584d4cf7b3d67cd4a8cae1849b6cc700fc
>
> My corfu config is:
>
> (setq corfu-auto t)
> (setq corfu-echo-documentation nil)
> (setq corfu-quit-at-boundary nil)
> (setq corfu-quit-no-match t)
> (global-corfu-mode)
> (corfu-indexed-mode)
> (keymap-set corfu-map "M-d" #'corfu-doc-toggle)
I've got Thomas Fitzsimmons' attention and am opening a bug report for
this, so I hope it will be fixed in short order (the workarounds are
helpful to see, though!).
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
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
1 sibling, 1 reply; 23+ messages in thread
From: Julien Cubizolles @ 2023-01-23 9:34 UTC (permalink / raw)
To: ding
Arash Esbati <arash@gnu.org> writes:
> Peter Münster <pm@a16n.net> writes:
>
>> If you can confirm, that you use also latest emacs-master, then I'll try
>> corfu too.
>
> emacs-version: 29.0.50
> emacs-repository-version: 277504584d4cf7b3d67cd4a8cae1849b6cc700fc
>
> My corfu config is:
>
> (setq corfu-auto t)
> (setq corfu-echo-documentation nil)
> (setq corfu-quit-at-boundary nil)
> (setq corfu-quit-no-match t)
> (global-corfu-mode)
> (corfu-indexed-mode)
> (keymap-set corfu-map "M-d" #'corfu-doc-toggle)
It's not working in GNU Emacs 30.0.50 in emacs -Q with this setup and
your recipe:
--8<---------------cut here---------------start------------->8---
(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))))
--8<---------------cut here---------------end--------------->8---
Pressing TAB after typing the beginning of a name in the To: field only
inserts a tabulation, whereas (bbdb-complete-mail) finds several
matches.
--
Julien Cubizolles
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2023-01-23 9:34 ` Julien Cubizolles
@ 2023-01-23 14:05 ` Arash Esbati
2023-01-23 15:22 ` Arash Esbati
0 siblings, 1 reply; 23+ messages in thread
From: Arash Esbati @ 2023-01-23 14:05 UTC (permalink / raw)
To: Julien Cubizolles; +Cc: ding, Thomas Fitzsimmons
Julien Cubizolles <j.cubizolles@free.fr> writes:
> It's not working in GNU Emacs 30.0.50 in emacs -Q with this setup and
> your recipe:
>
> (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))))
>
> Pressing TAB after typing the beginning of a name in the To: field only
> inserts a tabulation, whereas (bbdb-complete-mail) finds several
> matches.
Thanks for reminding me; I can confirm this behavior and didn't look at
it again back then. FTR, I have an entry for `eudc-capf-complete' in my
`completion-at-point-functions' in message-mode. `eudc-capf-complete'
calls `eudc-capf-message-expand-name' which is defined like this:
--8<---------------cut here---------------start------------->8---
(defun eudc-capf-message-expand-name ()
"Email address completion function for `message-completion-alist'.
[...]"
(if (or eudc-server eudc-server-hotlist)
(progn
(let* ((beg (save-excursion
(re-search-backward "\\([:,]\\|^\\)[ \t]*")
(match-end 0)))
;; ^^^^^^^^
(end (point))
(prefix (save-excursion (buffer-substring-no-properties beg end))))
(let ((result
(eudc-query-with-words (split-string prefix "[ \t]+") t)))
(when result
(list beg end
(completion-table-with-cache
(lambda (_) result) t))))))))
--8<---------------cut here---------------end--------------->8---
While searching back, it picks up the `match-end' which will not work
for the case where you the beginning of the name in your BBDB database.
A change like this should fix it:
--8<---------------cut here---------------start------------->8---
(defun eudc-capf-message-expand-name ()
"Email address completion function for `message-completion-alist'.
[...]"
(if (or eudc-server eudc-server-hotlist)
(progn
(let* ((beg (save-excursion
;; change follows:
(if (member (char-before) '(?, ?: ?\s))
(progn
(re-search-backward "\\([:,]\\|\\^\\)[ \t]*")
(match-end 0))
(skip-chars-backward "[:alnum:]"
(line-beginning-position))
(point))))
(end (point))
(prefix (buffer-substring-no-properties beg end)))
(let ((result
(eudc-query-with-words (split-string prefix "[ \t]+") t)))
(when result
(list beg end
(completion-table-with-cache
(lambda (_) result) t))))))))
--8<---------------cut here---------------end--------------->8---
@Thomas: Can you please have a look at this issue? I think this is
still related to bug#59314. TIA.
Best, Arash
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2023-01-23 14:05 ` Arash Esbati
@ 2023-01-23 15:22 ` Arash Esbati
2023-01-23 23:14 ` Julien Cubizolles
2023-01-24 8:32 ` Julien Cubizolles
0 siblings, 2 replies; 23+ messages in thread
From: Arash Esbati @ 2023-01-23 15:22 UTC (permalink / raw)
To: Julien Cubizolles; +Cc: ding, Thomas Fitzsimmons
Arash Esbati <arash@gnu.org> writes:
> Julien Cubizolles <j.cubizolles@free.fr> writes:
>
>> It's not working in GNU Emacs 30.0.50 in emacs -Q with this setup and
>> your recipe:
>>
>> (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))))
>>
>> Pressing TAB after typing the beginning of a name in the To: field only
>> inserts a tabulation, whereas (bbdb-complete-mail) finds several
>> matches.
>
> Thanks for reminding me; I can confirm this behavior and didn't look at
> it again back then. FTR, I have an entry for `eudc-capf-complete' in my
> `completion-at-point-functions' in message-mode. `eudc-capf-complete'
> calls `eudc-capf-message-expand-name' which is defined like this:
Sorry for the confusion, but I have to take back my last proposal;
`eudc-capf-message-expand-name' works as expected, it is just
case-sensitive when it comes to TAB-completion. `bbdb-complete-mail'
seems to be case-insensitive.
Julien, can you try it again and start typing names exactly as you have
them in your bbdb file and then hit TAB?
Best, Arash
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2023-01-23 15:22 ` Arash Esbati
@ 2023-01-23 23:14 ` Julien Cubizolles
2023-01-24 12:37 ` Arash Esbati
2023-01-24 8:32 ` Julien Cubizolles
1 sibling, 1 reply; 23+ messages in thread
From: Julien Cubizolles @ 2023-01-23 23:14 UTC (permalink / raw)
To: ding
Arash Esbati <arash@gnu.org> writes:
> Sorry for the confusion, but I have to take back my last proposal;
> `eudc-capf-message-expand-name' works as expected, it is just
> case-sensitive when it comes to TAB-completion. `bbdb-complete-mail'
> seems to be case-insensitive.
>
> Julien, can you try it again and start typing names exactly as you have
> them in your bbdb file and then hit TAB?
I did several tests, all starting from emacs -Q.
First of all by default 'completion-at-point-functions is set to
(message-completion-function t). With that, TAB completes correctly
incomplete names from bbdb, case insensitive, and offers several
candidates:
with point after "fan" in the To: field, TAB completes to "fanton", and
a second TAB offers to choose between several bbdb entries with the
surname fanton.
In that case the completion is done by 'bbdb-complete-name not
'eudc-expand-inline.
With (setq eudc-server-hotlist '(("localhost" . bbdb)))
fan TAB displays "Multiple matches found: choose one", TAB then offers to
choose between all the bbdb entries with "fan" either in the name, the
email adress. This time, it's 'eudc-expand-inline doing.
The previous attempts were without corfu. With:
--8<---------------cut here---------------start------------->8---
(package-initialize)
(use-package corfu)
(global-corfu-mode)
--8<---------------cut here---------------end--------------->8---
it gets weird. Both 'eudc-expand-inline and 'bbdb-complete-name act as
they did previously but somehow TAB doesn't execute either of them, even
though it's bound to 'message-tab' (according to 'describe-key) and
'message-tab does execute 'bbdb-complete-name' or 'eudc-expand-inline'
as it should.
I checked the value of completion-at-point-functions in message-mode,
and it's set to (message-completion-function t), with no mention of
eudc-capf-message-expand-name.
Following your recipe, I tried:
--8<---------------cut here---------------start------------->8---
(add-hook 'message-mode-hook
(lambda ()
(setq-local completion-at-point-functions
(delq 'message-completion-function
completion-at-point-functions)
)))
--8<---------------cut here---------------end--------------->8---
and:
--8<---------------cut here---------------start------------->8---
(add-hook 'message-mode-hook
(lambda ()
(setq-local completion-at-point-functions
(append '(eudc-capf-message-expand-name) (delq 'message-completion-function
completion-at-point-functions)
))))
--8<---------------cut here---------------end--------------->8---
The first one sets completion-at-point-functions to t, and the second
one sets it to (eudc-capf-message-expand-name t). Both fail to use a
corfu completion menu when using TAB on "fan" and go back to the
dialogues previously provided if I'm using (bbdb-complete-name) or
(eudc-expand-inline).
I hope these tests are what you had in mind and can be of use to
you. Please let me know what else I can try.
Thanks for your help
--
Julien Cubizolles
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2023-01-23 15:22 ` Arash Esbati
2023-01-23 23:14 ` Julien Cubizolles
@ 2023-01-24 8:32 ` Julien Cubizolles
1 sibling, 0 replies; 23+ messages in thread
From: Julien Cubizolles @ 2023-01-24 8:32 UTC (permalink / raw)
To: ding
Arash Esbati <arash@gnu.org> writes:
> Julien, can you try it again and start typing names exactly as you have
> them in your bbdb file and then hit TAB?
Another thing maybe worth mentioning, completion at point by corfu works
perfectly out of the box for the Gcc: header line.
--
Julien Cubizolles
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2023-01-23 23:14 ` Julien Cubizolles
@ 2023-01-24 12:37 ` Arash Esbati
2023-01-25 21:09 ` Julien Cubizolles
2023-01-31 12:46 ` Julien Cubizolles
0 siblings, 2 replies; 23+ messages in thread
From: Arash Esbati @ 2023-01-24 12:37 UTC (permalink / raw)
To: Julien Cubizolles; +Cc: ding
Julien Cubizolles <j.cubizolles@free.fr> writes:
> The first one sets completion-at-point-functions to t, and the second
> one sets it to (eudc-capf-message-expand-name t). Both fail to use a
> corfu completion menu when using TAB on "fan" and go back to the
> dialogues previously provided if I'm using (bbdb-complete-name) or
> (eudc-expand-inline).
I can more or less reproduce what you described about
`bbdb-complete-name' and others. With Corfu, this is my entire
configuration:
(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)))
Note that the function is called `eudc-capf-complete' which in return
calls `eudc-capf-message-expand-name' after some checks. With this
setup, Corfu works here and I can hit TAB to get in-buffer completion
for names from BBDB. The only thing I have to do is being
case-sensitive reg. the names I'm typing.
I hope this helps you get your system running as well.
Best, Arash
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2023-01-24 12:37 ` Arash Esbati
@ 2023-01-25 21:09 ` Julien Cubizolles
2023-01-27 8:42 ` Arash Esbati
2023-01-31 12:46 ` Julien Cubizolles
1 sibling, 1 reply; 23+ messages in thread
From: Julien Cubizolles @ 2023-01-25 21:09 UTC (permalink / raw)
To: Arash Esbati; +Cc: ding
Arash Esbati <arash@gnu.org> writes:
> I can more or less reproduce what you described about
> `bbdb-complete-name' and others. With Corfu, this is my entire
> configuration:
>
> (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)))
>
> Note that the function is called `eudc-capf-complete' which in return
> calls `eudc-capf-message-expand-name' after some checks. With this
> setup, Corfu works here and I can hit TAB to get in-buffer completion
> for names from BBDB. The only thing I have to do is being
> case-sensitive reg. the names I'm typing.
It's also working for me with this setup. Thanks a lot for your
help. However it doesn't seem to match against the mail-alias fields
like bbdb-complete-name does. I tried adding (mail-alias) to
eudc-inline-query-format but it didn't help.
--
Julien Cubizolles
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2023-01-25 21:09 ` Julien Cubizolles
@ 2023-01-27 8:42 ` Arash Esbati
2023-01-27 18:45 ` Eric Abrahamsen
0 siblings, 1 reply; 23+ messages in thread
From: Arash Esbati @ 2023-01-27 8:42 UTC (permalink / raw)
To: Julien Cubizolles; +Cc: ding
Julien Cubizolles <j.cubizolles@free.fr> writes:
> It's also working for me with this setup. Thanks a lot for your
> help.
You're welcome. Glad we have this sorted out.
> However it doesn't seem to match against the mail-alias fields like
> bbdb-complete-name does. I tried adding (mail-alias) to
> eudc-inline-query-format but it didn't help.
I'm not sure about the best way forward here. Maybe BBDB should provide
a function similar to `bbdb-complete-mail' which works as a capf? Do
you want to raise this feature request on BBDB list?
Best, Arash
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2023-01-27 8:42 ` Arash Esbati
@ 2023-01-27 18:45 ` Eric Abrahamsen
0 siblings, 0 replies; 23+ messages in thread
From: Eric Abrahamsen @ 2023-01-27 18:45 UTC (permalink / raw)
To: ding
Arash Esbati <arash@gnu.org> writes:
> Julien Cubizolles <j.cubizolles@free.fr> writes:
>
>> It's also working for me with this setup. Thanks a lot for your
>> help.
>
> You're welcome. Glad we have this sorted out.
>
>> However it doesn't seem to match against the mail-alias fields like
>> bbdb-complete-name does. I tried adding (mail-alias) to
>> eudc-inline-query-format but it didn't help.
>
> I'm not sure about the best way forward here. Maybe BBDB should provide
> a function similar to `bbdb-complete-mail' which works as a capf? Do
> you want to raise this feature request on BBDB list?
My understanding is that all this is a bit of a work in progress on the
Emacs master branch (you're all using master, right?), so it might be
better to chime in on the relevant discussions, on bug#59314, and there
might be something on the emacs.devel list, maybe this one? https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg00472.html
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2023-01-24 12:37 ` Arash Esbati
2023-01-25 21:09 ` Julien Cubizolles
@ 2023-01-31 12:46 ` Julien Cubizolles
2023-02-02 9:48 ` Arash Esbati
1 sibling, 1 reply; 23+ messages in thread
From: Julien Cubizolles @ 2023-01-31 12:46 UTC (permalink / raw)
To: ding
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:
--8<---------------cut here---------------start------------->8---
(add-hook 'message-mode-hook
(lambda ()
(add-to-list 'completion-at-point-functions
#'eudc-capf-complete)))
--8<---------------cut here---------------end--------------->8---
--
Julien Cubizolles
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2023-01-31 12:46 ` Julien Cubizolles
@ 2023-02-02 9:48 ` Arash Esbati
2023-02-03 5:31 ` Julien Cubizolles
0 siblings, 1 reply; 23+ messages in thread
From: Arash Esbati @ 2023-02-02 9:48 UTC (permalink / raw)
To: Julien Cubizolles; +Cc: ding
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
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2023-02-02 9:48 ` Arash Esbati
@ 2023-02-03 5:31 ` Julien Cubizolles
2023-02-03 11:04 ` Arash Esbati
0 siblings, 1 reply; 23+ messages in thread
From: Julien Cubizolles @ 2023-02-03 5:31 UTC (permalink / raw)
To: Arash Esbati; +Cc: ding
Arash Esbati <arash@gnu.org> writes:
>> 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)))
>
> So you have to tweak the regexp to something like this:
>
> "^\\([^ :]*-\\)?\\(To\\|[BG]?Cc\\|From\\|Reply-to\\|Mail-Followup-To\\|Mail-Copies-To\\):"
I understand that this would attempt to use eudc-capf-complete in the
Gcc field but it wouldn't get a match with the gnus group name since
it's supposed to look for email addresses, right ?
Also, do you need to remove 'message-completion-function from
completion-at-point-functions to get eudc-capf-completion to work ? In
my case this is not necessary.
--
Julien Cubizolles
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2023-02-03 5:31 ` Julien Cubizolles
@ 2023-02-03 11:04 ` Arash Esbati
2023-02-13 17:29 ` Julien Cubizolles
0 siblings, 1 reply; 23+ messages in thread
From: Arash Esbati @ 2023-02-03 11:04 UTC (permalink / raw)
To: Julien Cubizolles; +Cc: ding
Julien Cubizolles <j.cubizolles@free.fr> writes:
> Arash Esbati <arash@gnu.org> writes:
>
>> So you have to tweak the regexp to something like this:
>>
>> "^\\([^ :]*-\\)?\\(To\\|[BG]?Cc\\|From\\|Reply-to\\|Mail-Followup-To\\|Mail-Copies-To\\):"
>
> I understand that this would attempt to use eudc-capf-complete in the
> Gcc field but it wouldn't get a match with the gnus group name since
> it's supposed to look for email addresses, right ?
I didn't test the suggestion above, so chances are high that it breaks
other things.
> Also, do you need to remove 'message-completion-function from
> completion-at-point-functions to get eudc-capf-completion to work ? In
> my case this is not necessary.
The main reason for me to remove `message-completion-function' was that
it kicked in without asking (i.e., hitting TAB and such) and raised a
completion buffer where I wanted in-buffer completion. I didn't dig
deeper to find out why. I just removed it and it worked for me.
In summary, I think the behavior of `eudc-capf-complete' was improved in
the bug report mentioned by Eric, and the original problem is solved.
But I still have to keep my setup because of the other issue mentioned
above.
Best, Arash
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: completion no more working with latest HEADs (emacs and bbdb)
2023-02-03 11:04 ` Arash Esbati
@ 2023-02-13 17:29 ` Julien Cubizolles
0 siblings, 0 replies; 23+ messages in thread
From: Julien Cubizolles @ 2023-02-13 17:29 UTC (permalink / raw)
To: ding
Arash Esbati <arash@gnu.org> writes:
> The main reason for me to remove `message-completion-function' was that
> it kicked in without asking (i.e., hitting TAB and such)
I don't have this problem, my setup must different from yours in that
respect.
Thanks for your help.
--
Julien Cubizolles
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2023-02-13 17:29 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-15 13:29 completion no more working with latest HEADs (emacs and bbdb) 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
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
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).