emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] EUDC email addresses via completion-at-point in message-mode


From: Alexander Adolf
Subject: Re: [PATCH] EUDC email addresses via completion-at-point in message-mode
Date: Fri, 15 Apr 2022 23:23:28 +0200

Hello Thomas,

Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:

> [...]
> It looks like the default binding for TAB in message-mode-map is
> message-tab; so I tested by rebinding TAB to message-tab.  It worked,
> except I was expecting case sensitive results.  Can you please change
> `completion-ignore-case' to nil?  And figure out what to do with
> `completion-table-with-cache''s IGNORE-CASE argument accordingly, if
> necessary?

Ah, well spotted! Thanks for noticing; consider it fixed. "Thou shalt
not impose your will on users more than necessary." ;-)

I have simply removed completion-ignore-case from the setq-local call,
as it shouldn't have been there (probably a left-over from the first
attempts when I was still trying to force things).

The IGNORE-CASE argument to completion-table-with-cache should stay at
t, as it signals whether the function being called
(eudc-query-with-words) is case sensitive (it is not).

> I had to run (message-tab) repeatedly to get the final result if
> multiple results were available, whereas with eudc-expand-try-all bound
> to TAB, I get a "Multiple matches found; choose one:" prompt.  I guess
> that's just a different UI style for completion-at-point?  FWIW, I think
> I prefer eudc-expand-try-all's behaviour.

Does changing the value of the variable message-expand-name-standard-ui
change anything for you? There are a couple of completion-specific
variables changing the behaviour [1], and 3rd party packages might have
an effect, too.

[1] 
https://www.gnu.org/software/emacs/manual/html_node/emacs/Completion-Options.html

That said, the patch leaves it entirely to the user to configure the
user interface and its behaviour.

> I have one bbdb entry and one LDAP server in the hotlist.  It seems like
> the LDAP operation happens every time I call (message-tab).  Is that
> expected? 

Yes.

> Is the completion table caching meant to prevent this? 

Yes.

> I don't like the idea that hitting TAB several times per email address
> will result in several calls to the LDAP server. Can
> completion-at-point be made to have the same behaviour as
> eudc-expand-try-all, which only results in each backend being queried
> once?
> [...]

That's what I had hoped would be the result of using the function
completion-table-with-cache. From the docstring: "...saves the last
argument-result pair from FUN, so that several lookups with the same
argument (or with an argument that starts with the first one) only need
to call FUN once." The thing is, I cannot control how many times the
function completion-at-point calls functions on
completion-at-point-functions, nor how often completion-at-point is
called itself, which is determined by the user-interface on top of
completion-at-point.

If anyone gas further insight, any hints are highly appreciated.


  --alexander



reply via email to

[Prev in Thread] Current Thread [Next in Thread]