GNU bug report logs - #59314
29.0.50; EUDC and message-mode header completion

Previous Next

Package: emacs;

Reported by: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Date: Wed, 16 Nov 2022 18:06:02 UTC

Severity: normal

Found in version 29.0.50

Full log


Message #68 received at 59314 <at> debbugs.gnu.org (full text, mbox):

From: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>
To: Alexander Adolf <alexander.adolf <at> condition-alpha.com>
Cc: Eric Abrahamsen <eric <at> ericabrahamsen.net>, 59314 <at> debbugs.gnu.org
Subject: Re: bug#59314: 29.0.50; EUDC and message-mode header completion
Date: Thu, 01 Dec 2022 21:50:45 -0500
Hi Alexander,

Alexander Adolf <alexander.adolf <at> condition-alpha.com> writes:

> Hello Eric,
>
> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> [...]
>> In fact this whole message-mode thing is an impossible tangle, burritos
>> within burritos, and it would be great to get rid of it altogether.
>> [...]
>> So I need to clobber `message-expand-name' altogether.
>>
>> And EUDC having a function on `completion-at-point-functions' is
>> wrapping yet another burrito outside the existing burritos, because now
>> EUDC has a completion function both inside and outside message-mode's
>> own completion machinery.
>>
>> In fact the docstring of `eudc-capf-message-expand-name' makes it sound
>> like it thinks it's being called as part of `message-expand-name', but
>> now it isn't -- it's being called as part of the capf machinery. Or
>> rather, it could potentially be called in both places.
>>
>> I think a half-stick of dynamite is the only real solution.
>> [...]
>
> Perhaps we can be slightly more CONstructive that this. ;-)))
>
> I am preparing a patch to message.el which refactors
> `message-completion-alist` along the lines of this:

[...]

The eventual message.el refactoring could work.  But for now, for Emacs
29.1, let's focus on what's already in message.el, which is a lot!

In particular, I'm trying to make this recipe do something useful, with
a minimal patch to message.el.

1. Build Emacs master tip.

2. Install and configure BBDB:

mkdir -p test/.emacs.d
cat >test/.emacs.d/bbdb <<EOF
;; -*- mode: Emacs-Lisp; coding: utf-8; -*-
;;; file-format: 9
["Emacs" "ERT3" nil nil nil nil nil ("emacs-ert-test-3 <at> bbdb.gnu.org") ((notes . " ")) "c8bd3a63-3a83-48a7-a95b-be118a923e00" "2022-11-19 16:36:04 +0000" "2022-11-19 16:36:04 +0000" nil]
["Emacs" "ERT4" nil nil nil nil nil ("emacs-ert-test-4 <at> bbdb.gnu.org") ((notes . " ")) "5a93c3c5-9270-4e10-8b28-d28cfa2562cf" "2022-11-19 16:47:49 +0000" "2022-11-19 16:47:49 +0000" nil]
EOF
HOME=`pwd`/test emacs
M-x list-packages
(install BBDB from GNU ELPA)
exit Emacs

HOME=`pwd`/test emacs
C-: (eudc-set-server "localhost" 'bbdb t)
C-x m
emacs-ertTAB

When I try this, a bunch of stuff happens, then, uselessly, 3 spaces are
inserted after "emacs-ert".  During "bunch of stuff",
eudc-query-with-words is called and gets expansion results.  Why are
they not presented as possible completions?  What code is dropping them?

There is so much EUDC handling code in message.el and apparently none of
it works.  And most of this code predates the addition of
eudc-capf-complete, but its addition didn't fix this basic usage.
That's why the recommendation in the EUDC manual has always been to just
clobber "TAB" in message mode and assign eudc-expand-inline (now
eudc-expand-try-all) to it.

Before rewriting completion in message.el, before Emacs 29.1, can we
please make the logic that was there already actually work?  Please try
the above recipe; maybe I'm missing something.  If you can make it work,
let me know, or send a minimal patch to make it work.

Thanks,
Thomas




This bug report was last modified 2 years and 128 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.