[issue23441] rlcompleter: tab on empty prefix => insert spaces

2015-11-19 Thread Yury Selivanov
Yury Selivanov added the comment: Please see my patch for Issue 25660 -- instead of returning '\t' from the completion function, I use readline API to modify the input buffer directly. -- ___ Python tracker

[issue23441] rlcompleter: tab on empty prefix => insert spaces

2015-11-18 Thread Martin Panter
Martin Panter added the comment: The fix here doesn’t work perfectly with the Editline (libedit) version of Readline; see Issue 25660. -- ___ Python tracker

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-27 Thread Yury Selivanov
Yury Selivanov added the comment: Berker, the patch looks good to me. Please commit. Larry, is it possible we can include this in 3.5.0? -- nosy: +yselivanov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23441

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-27 Thread Ned Deily
Ned Deily added the comment: Berker, the part of the patch for test_rlcompleter.py does not apply cleanly. Here's an updated version of it. Both the fix and the test seem to work as advertised on current 3.5 tip. It would be nice to fix this finally. -- nosy: +ned.deily Added file:

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 82ccdf2df5ac by Berker Peksag in branch '3.4': Issue #23441: rcompleter now prints a tab character instead of displaying https://hg.python.org/cpython/rev/82ccdf2df5ac New changeset d55bdd2dc45e by Berker Peksag in branch '3.5': Issue #23441:

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thank you Berker for putting an end to this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23441 ___ ___

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-27 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the patch Martin and thank you all for testing and reviewing patches! -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-26 Thread David Beazley
David Beazley added the comment: It's still broken on Python 3.5b4. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23441 ___ ___

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-26 Thread Berker Peksag
Berker Peksag added the comment: Here is a patch with a simple test case. -- nosy: +berker.peksag stage: commit review - patch review versions: +Python 3.6 Added file: http://bugs.python.org/file40032/issue23441.diff ___ Python tracker

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: My weak preference is with Martin’s simpler patch and relying on the Readline and the terminal to handle questions of tab stops and copied text. Fair enough. Still, it would be nice to add a test to test_rlcompleter. Does someone want to do this?

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-09 Thread David Beazley
David Beazley added the comment: Wanted to add: I see this as being about the same as having a broken window pane on the front of Python 3. Maybe there are awesome things inside, but it makes a bad first impression on anyone who dares to use the interactive console. --

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-09 Thread David Beazley
David Beazley added the comment: Frivolity aside, I really wish this issue would get more traction and a fix. Indentation is an important part of the Python language (obviously). A pretty standard way to indent is to hit tab in whatever environment you're using to edit Python code. Yet, at

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-07 Thread R. David Murray
R. David Murray added the comment: No, that's what I said when I marked this one as a release blocker: the other one *hadn't been*, which is why it didn't get in to 3.4. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23441

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-07 Thread Larry Hastings
Larry Hastings added the comment: This issue was created 2015/02/11. Python 3.4 was released on 2014/03/16. Is there an earlier duplicate issue for this problem that was marked release blocker for 3.4? -- ___ Python tracker rep...@bugs.python.org

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-07 Thread Martin Panter
Martin Panter added the comment: There are currently two patches proposed, and I presume either patch would satisfy the likes of David Beazley. The first patch is more complex (extending the Completer constructor), while the second is simple. Perhaps it is okay to commit either one, and then

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-07 Thread David Beazley
David Beazley added the comment: This is a problem that will never be fixed. Sure, it was a release blocker in Python 3.4. It wasn't fixed. It is a release blocker in Python 3.5. It won't be fixed. They'll just tell you to indent using the spacebar as generations of typists have done for

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-07 Thread David Beazley
David Beazley added the comment: For what it's worth, I'm kind of tired having to hack site.py every time I upgrade Python in order to avoid being shown 6000 choices when hitting tab on an empty line. It is crazy annoying. -- ___ Python tracker

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, there is a patch, and I think a couple core developers interested in this, so I wouldn't bet on this never getting fixed. Just leave them a bit more time. -- ___ Python tracker rep...@bugs.python.org

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-07-04 Thread Larry Hastings
Changes by Larry Hastings la...@hastings.org: -- priority: release blocker - deferred blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23441 ___

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-04-30 Thread R. David Murray
R. David Murray added the comment: Per the discussion in issue 5845, I'm setting this to release blocker to make sure it gets committed before the next release. I'm also adding 3.4 as I think this is a bug. Any objections to that? -- nosy: +larry priority: normal - release blocker

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-03-18 Thread Martin Sekera
Martin Sekera added the comment: But tab characters are rendered by the terminal into spaces. During stdout processing, when the term encounters a \t (0x09), it inserts (into the term buffer that is displayed to the user) as many spaces (0x20) as needed to move the cursor to the nearest

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-03-18 Thread Martin Panter
Martin Panter added the comment: I think it would really depend on the particular terminal. Sakura (a Unix terminal using the VTE library, like Gnome Terminal) copied the tab literally: $ printf 'tab\ttab|sp sp\n' tab tab|sp sp == COPIED $ hexdump -C tab tab|sp sp == PASTED

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-03-17 Thread R. David Murray
R. David Murray added the comment: The CLI is a UI. We're using readline facilities (ie: the terminal) to improve it. And people cut and paste from the interactive terminal, so I think the presence of tab characters is a negative from that perspective as well. --

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-03-16 Thread R. David Murray
R. David Murray added the comment: No program that I work with (and I use cli all the time) outputs a tab when I press the tab key. Now, true, I think I had to configure vi so that that was the case, but nothing else that I remember. Of course, most of those programs use readline and come

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-03-16 Thread Martin Sekera
Martin Sekera added the comment: Copy that. Would the patch be acceptable if the '\t' was simply changed to 4 spaces? To discuss further, it is my opinion that the interpreter should output a \t character when the TAB key is pressed, as this is the behavior of nearly every shell and

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-03-16 Thread Martin Sekera
Martin Sekera added the comment: In the end it doesn't matter what characters end up on the terminal. What matters is the UX of not having to press backspace several times to unindent. That's sloppy design. The issue of forcing a custom indent width on a user who might have their tab stops

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-03-14 Thread Ezio Melotti
Ezio Melotti added the comment: +1 for 4 spaces. Smart backspace would be nice too, but I agree it's a separate issue (unless it's trivial to implement). Deeply-nested code in the interactive interpreter is uncommon, and the lack of smart backspace never bothered me. -- nosy:

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-03-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: 4 spaces is the recommended indent width in PEP 8. That's what most Python users will expect. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23441 ___

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-03-14 Thread Martin Sekera
Martin Sekera added the comment: Is it necessary to force a predefined tab width (4) onto the user here? I prefer 2-character tabs for example, and have all my terminals set up accordingly (setterm --regtabs 2). I presume many people prefer 8-column tabs, hence the default width in most

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-02-19 Thread R. David Murray
R. David Murray added the comment: Looks good to me. I prefer 4 space indent as well, and since we have essentially deprecated the use of tabs for spacing in Python, I'd rather not reintroduce it here for the (minor) benefit of making backspacing easier. Just think about the copy and paste

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-02-11 Thread Armin Rigo
Armin Rigo added the comment: Ah, thanks, I missed there was already an issue. The patch's logic is as follows: when pressing tab anywhere in the line, if the word to complete is empty (which might be for any number of reasons, like the cursor is after another space or a non-word character),

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-02-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks a lot for doing this. I think it's a good improvement. I prefer 4 spaces myself (tabs usually insert 8 spaces, which is too wide), but I'm open to other opinions. -- nosy: +pitrou, r.david.murray stage: - patch review versions: -Python 3.6

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-02-11 Thread Armin Rigo
New submission from Armin Rigo: In the interactive prompt: if 1: ... press tab here Pressing tab here should just insert 4 spaces. It makes no sense to display all 500 possible completions of the empty word, and using tab to indent is a very common feature of any editor with a Python mode.

[issue23441] rlcompleter: tab on empty prefix = insert spaces

2015-02-11 Thread Martin Panter
Martin Panter added the comment: Main bug report: Issue 22086. Can you say if this works when the cursor is not at the start of the entry? E.g. after an existing tab (Ctrl-V Tab on GNU readline) or space, or after an embedded newline (Ctrl-V Enter). What happens if you press backspace after