msg99159 - (view) |
Author: zhou wei (lilaboc) |
Date: 2010-02-10 08:19 |
When I use rlcompleter in interactive Python mode, I think it will be more convenient if autocomplete produce a real tab when text-to-autocomplete is empty. For example: >>> def test(): ... will give: Display all 182 possibilities? (y or n) instead of a real tab So, when indentation is needed, 4 times of spacebar pressing are required. That's why I think it will make more sense to just return a tab character when there is nothing to autocomplete. This behavior is similar to autocompletion in ipython |
|
|
msg99161 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-02-10 11:51 |
On the one hand, it makes sense for the common case of completing using the Tab key. On the other hand, it will appear quite bizarre to people who have another, dedicated key for auto-completion. By the way, rather than inserting a tab character, it should probably insert 4 spaces instead. |
|
|
msg99613 - (view) |
Author: zhou wei (lilaboc) |
Date: 2010-02-20 06:28 |
Pitrou, I think you are right on "On the other hand, it will appear quite bizarre to people who have another, dedicated key for auto-completion." If I assign another key for auto-completion, the behavior becomes really strange. It happens in ipython too. But I guess most people just use tab as the default key for auto-completion, and the readline module document say:" get_begidx( ) Get the beginning index of the readline tab-completion scope. get_endidx( ) Get the ending index of the readline tab-completion scope. set_completer_delims( string) Set the readline word delimiters for tab-completion. get_completer_delims( ) Get the readline word delimiters for tab-completion. " And now, I think the problem becomes:convenience for the majority or protection for the minority. If we decide to protect the minority, I think I can submit another patch for the readline module document, to make the document constant, so, the document looks like: get_endidx( ) Get the ending index of the readline auto-completion scope. PS: Is there a way to find out the current key-binding on auto-completion? If we can find this, I think we can "if else" this behavior to satisfy everybody. |
|
|
msg184526 - (view) |
Author: Thomas Fenzl (Thomas Fenzl) * |
Date: 2013-03-18 21:19 |
It's not (easily) possible to get the invoked character that caused the completion function. Multiple keys can be bound to complete and the bindable function rl_complete provided in libreadline does not forward the invoking key to rl_complete_internal, through which Completer.complete is eventually called. |
|
|
msg184528 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2013-03-18 21:24 |
Thomas's analysis is that in order to make this work, changes would be required in libreadline. That being the case, and given that changing this without being able to special case tab would break things for people using other complete characters, I'm going to close this issue. |
|
|