On 3/27/15 10:44 AM, Ulf Magnusson wrote:
> Hello,
>
> I noticed that rl_bind_key('\t', rl_complete) causes completion to
> break even though rl_complete is already the default binding for '\t'.
> As a trivial example, pressing TAB multiple times will not list all
> the matches when doing
>
> rl_bind_key('\t', rl_complete);
> readline(">");
>
> I think the issue is this comparison in complete.c:
>
> else if (rl_last_func == rl_complete && !completion_changed_buffer)
>
> When libreadline.so.6 is loaded at startup, rl_complete in the client
> refers to a dynamic library trampoline in the PLT that in turn calls
> the "real" rl_complete. Within the library, rl_complete always refers
> to the real function. Therefore, they do not compare equal.
There's not a lot we can do about this; it's the fault of the dynamic
linker.
I am surprised that rl_complete doesn't bind to the library's version
(the `real' function) by the time rl_last_func is set, but I suppose it
just uses whatever's in the keymap.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/
_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline