[vimpulse] Bug: TAB doesn't autocomplete in minibuffer.

Vegard Øye vegard_oye at hotmail.com
Fri Jul 2 16:55:04 CEST 2010


On 2010-07-02 14:17, Alessandro Piras wrote:

> vimpulse-misc-keybindings:564
> ---
> (global-set-key [tab] (or (key-binding [tab]) (key-binding "\C-i")))
> ---
> I guess this doesn't take into account mode changes, i.e., it sets
> the tab key and when the binding changes (when changing to a minor
> or major mode that sets the tab key) the tab key still does what it
> was set to with the global set key.

It depends. If the mode does indeed bind the Tab /key/ (i.e., [tab],
as in (define-key map [tab] 'cmd), it will work as expected. But if
the mode binds the Tab /character/ (i.e., C-i, also known as "\t"),
only the C-i key is bound, because the code above breaks the bond
between [tab] and C-i.

In the words of the Emacs manual (my emphasis):

    <TAB>, <RET>, <BS>, <LFD>, <ESC> and <DEL> started out as names
    for certain ASCII control characters, used so often that they have
    special keys of their own. For instance, <TAB> was another name
    for C-i. [...] If you do not want to distinguish between (for
    example) <TAB> and C-i, make just one binding, for the ASCII
    character <TAB> (octal code 011). IF YOU DO WANT TO DISTINGUISH,
    MAKE ONE BINDING FOR THIS ASCII CHARACTER, AND ANOTHER FOR THE
    "FUNCTION KEY" TAB.

http://www.gnu.org/software/emacs/manual/html_node/emacs/Named-ASCII-Chars.html

Before the distinction is made, one can bind Tab by binding C-i.
After the distinction is made, one can bind Tab only by binding [tab].

Minibuffer completion breaks because it binds Tab the first way.
Commit [ee2d1f9527] fixes this.

-- 
Vegard



More information about the implementations-list mailing list