Message193986
On 31/07/13 17:14, Larry Hastings wrote:
> IMO the optimal solution is that tab preceded by only whitespace indents, and tab preceded by any non-whitespace character attempts to complete. Can we goad readline into behaving this way?
Yes we can. Attached are a pair of lightweight modules I've used for this for the last 3-4 years, and it works fine in Python 2.4 through 3.3. I put something like this in my startup.py:
import completer
import history
history = history.History()
completer = completer.Completer(
bindings=(r'"\C-xo": overwrite-mode',
r'"\C-xd": dump-functions',
))
Originally they were in a single class, but I was persuaded that it was cleaner to separate them. |
File name |
Uploaded |
completer.py
|
steven.daprano,
2013-07-31.08:04:13
|
history.py
|
steven.daprano,
2013-07-31.08:04:13
|
|
Date |
User |
Action |
Args |
2013-07-31 08:04:15 | steven.daprano | set | recipients:
+ steven.daprano, loewis, ronaldoussoren, mark.dickinson, cben, belopolsky, pitrou, larry, techtonik, giampaolo.rodola, ned.deily, ezio.melotti, eric.araujo, r.david.murray, flox, lesmana, tshepang, python-dev, serhiy.storchaka |
2013-07-31 08:04:14 | steven.daprano | link | issue5845 messages |
2013-07-31 08:04:14 | steven.daprano | create | |
|