Open GoogleCodeExporter opened 9 years ago
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.
Original comment by dmho...@gmail.com
on 18 Jul 2008 at 9:29
Attachments:
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.
Original comment by dmho...@gmail.com
on 25 Jul 2008 at 9:37
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.
Original comment by dmho...@gmail.com
on 31 Jul 2008 at 1:22
Attachments:
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.)
Original comment by dmho...@gmail.com
on 31 Jul 2008 at 1:23
Thanks for your patch, dmhouse. It doesn't work quite as I expect, though,
because I'm used to TAB still indenting the current line, even if it does
(back-to-indentation). Here's the fix I'm using:
http://github.com/ramen/emacs-starter-kit/commit/bbaceecf35404dc1022809571a609f6
8b2b33c69
Regards,
Dave
Original comment by dave.ben...@gmail.com
on 28 Sep 2010 at 10:53
Original issue reported on code.google.com by
rib...@gmail.com
on 20 Jun 2008 at 4:11