[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Questions on completion
From: |
Roland Winkler |
Subject: |
Re: Questions on completion |
Date: |
Tue, 31 Oct 2017 22:19:00 -0500 |
On Mon Oct 30 2017 Basil L. Contovounesios wrote:
> I keep records with full names (titles, middle names, etc.)
> in multiple scripts (Latin and Greek), but in emails I
> prefer to use abbreviated Latinised names, as they both are
> more universal and look better in my MUA. I found the
> mail-name xfield to be a convenient place to store these.
Thank you, I see your point. (I might do a similar thing in your
situation.)
> and advise bbdb-complete-mail to first pass the candidates it
> offers through bbdb-mua-summary-unify.
How does this go? Is there a hook I overlooked?
(bbdb-complete-mail is not the most userfriendly piece of code if
you want to achieve something that is not yet implemented as an
option.)
> The only missing aspect of this approach is offering Latinised
> mail-names as completion candidates.
This can be implemented:
mail-name becomes another element of bbdb-completion-list.
Then these mail names must be hashed in bbdb-hashtable so that they
become available for completion.
(Please give me some time.)
> AFAICT, Emacs now provides two standard, high-level and
> configurable interfaces to arbitrary completion: in-buffer
> completion via completion-at-point/completion-in-region and
> minibuffer completion via completing-read.
>
> At first glance, bbdb-complete-mail seems to emulate some of
> the work completion-at-point/completion-in-region
> could/should be doing, e.g. managing the *Completions*
> buffer. Though I am not particularly familiar with the
> code, I have a feeling that bbdb-complete-mail could be
> simplified if it were refactored to use one of these
> built-in functions instead.
The general problem I see is that bbdb-complete-mail (and likewise
bbdb-completing-read-mails) is not performing ordinary completion.
In that sense, you could call these function names misnomers. You
can type "Joh" to get John Smith's email address in BBDB
"address@hidden". So what you type and what you get in the end can
be very different stories. Also, bbdb-complete-mail provides
"cycling": if you already have "address@hidden" and you run
bbdb-cmplete-mail again (because John Smith has multiple email
addresses in his BBDB record), you may get "address@hidden".
I am not aware of other emacs functions providing such behavior, nor
am I aware of other scenarios where such a behavior would be useful,
nor do I know how such behavior could be combined with other
completion frontends. (I do not know anything about the frontends
you mentioned.)
Roland