1 Jun 2008 10:26
bug#342: kill-line sometimes unexpectedly kills invisible text
martin rudalics <rudalics <at> gmx.at>
2008-06-01 08:26:56 GMT
2008-06-01 08:26:56 GMT
> current line is visible, > next line is invisible, > I move to end of visible line, > then type ctrl-k. > I expect it to kill just the visible newline, > and sometimes it does that, > but sometimes it kills the invisible line too. > > what's annoying is, it's inconsistent in an unobvious way. > the behavior depends on what's in the invisible text. > > the underlying problem: > kill-line in that case uses forward-visible-line > to find the end of the kill region. FWIW, your problem is caused by the (unless (bolp) (goto-char opoint)))) checks in `forward-visible-line' which get you back to the position before the invisible text if that text does not end in a newline as with the t2 part of your code. Hence the invisible text won't be killed for t2. In the t1 part the invisible region ends in a newline and kill-line will kill it along with the visible text. I think the behavior of Emacs is consistent here but maybe not very intuitive. On the other hand I'm quite confident that changing that behavior will break something else(Continue reading)![]()
RSS Feed