emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Re: Completing with anything


From: Tassilo Horn
Subject: [O] Re: Completing with anything
Date: Mon, 21 Mar 2011 15:17:20 +0100
User-agent: Gnus/5.110016 (No Gnus v0.16) Emacs/24.0.50 (gnu/linux)

Julien Danjou <address@hidden> writes:

Hi Julien,

>> Isn't completion of "L" to "Lionel" at the beginning of a line
>> exactly what your completion function should enable?
>
> No. To give a even more concrete application of my example: I'd like
> org-contacts to give completion for email addresses or nicknames. If
> you have a contact entry like:
>
> - Name: Emmett Brown
> - Nickname: doc
> - Email address: address@hidden
>
> What I'd like to do is that if the user enters:
>
>      doc<TAB>
>
> is that it can be completed to
>    "Emmett Brown <address@hidden>"
>
> But if I return such an item in COLLECTION, it just gets ignored
> because "Emmett Brown <address@hidden>" does not match "doc".

Now that is a completely understandable example! :-)

On the one hand, I'm a bit tempted to say that this is no COMPLETION,
but a kind of ABBREV EXPANSION (just like abbrev.el, skeleton.el,
temo.el, yasnippet.el, ...).  On the other hand, I clearly see the
usefulness of such a dynamic "expansion-at-point".

What might be a solution is to allow COLLECTION to contain not only
strings, but also pairs (MATCH . EXPANSION), like ("doc" . "Emmett Brown
<address@hidden>").

But I'm really no expert with the completion code, so I cannot speak on
how much effort that is, and if it would break things.  For example,
with normal completions you can usually cycle thru all completion
possibilities.  Not sure if that would work after an expansion has taken
place.

Bye,
Tassilo



reply via email to

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