[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changes to completing-read
From: |
Stefan Monnier |
Subject: |
Re: Changes to completing-read |
Date: |
Mon, 20 Oct 2008 09:31:41 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
>> The `lambda' is when the function is called by `test-completion'.
>> The `boundaries' is a new functionality, still undocumented.
> Thanks. I guess this will be documented before the release?
Of course.
> Could someone explain the meaning of `boundaries' please?
There's an attempt in the comment at the top of lisp/minibuffer.el.
And here's another attempt:
Consider a completion table such as the one used for file names, where
the string to complete is conceptually divided into several subparts.
In such a case the *Completions* buffer may only want to show the
relevant affected subparts rather than complete copies. I.e. if you
complete /usr/s, all-completions may prefer to return '("sbin" "share" "src")
rather than ("/usr/sbin" "/usr/share" "/usr/src").
In order for the completion functions to be able to know how to
correctly interpret this abbreviated list (e.g. such that when you
middle-click in the *Completions* buffer, the "share" string only
replaces the "s" rather than the whole "/usr/s"), there needs to be
a way to know the position of the boundary between the prefix that's
elided and the subpart whose possible completions are returned by
`all-completions'. Calling the completion table with (boundaries
. SUFFIX) should return that boundary info.
Now "what's this SUFFIX thingy", you'll say. Here's the deal:
all-completions will return all the relevant completions for the
relevant subpart, but the relevant subpart may not be the end of
the completion. E.g. all-completions on "/usr/s" will only return
"share" and not "share/zoneinfo/Canada/Eastern". So calling the
file completion table with (boundary . "e/zoneinfo") will indicate that
the returned values only cover the "e" part of the SUFFIX.
Stefan