| Issue 83: | indent-for-tab-command broken | |
| 2 people starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem? 1. Move the point to the whitespace at the beginning of a line 2. Press TAB What is the expected output? What do you see instead? Point should move to first non-whitespace character. Instead it doesn't move. The documentation for indent-for-tab-command says: If initial point was within line's indentation, position after the indentation. Else stay at same point in text. What version of the product are you using? On what operating system? Please provide any additional information below. |
|
,
Jul 18, 2008
In other words, if we're in the indentation, and we press TAB, we should jump to the end of the indentation before we begin bounce-indenting to agree with indent-for-tab-command's docstring. Here's a patch to do that. |
|
,
Jul 25, 2008
Incidentally, modes derived from cc-mode also behave in this way. E.g. (! represents point): M-x c-mode int foo(); ! bar(); } TAB int foo(); !bar(); } However, TAB runs c-indent-command, rather than indent-for-tab-command, so they're not violating any documentation. |
|
,
Jul 31, 2008
Also worth noting: haskell-mode, which also does bounce-indenting (and has TAB bound to indent-for-tab-command), behaves as follows: 1. If the current line is indented to one of the valid indent stops for this line, and the point is in the indentation, call (back-to-indentation). 2. If the current line is indented to one of the valid indent stops for this line, but the point isn't in the indentation, bounce indent. 3. If the current line is not indented to one of the valid indent stops for this line, (back-to-indentation) and bounce indent. So this policy is another option. |
|
,
Jul 31, 2008
Oh, typo in my comment #2: I of course meant:
int foo() {
! bar();
}
TAB
int foo() {
!bar();
}
(I have c-basic-offset set to 2, by the way.)
|
|
|
|