[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#342: kill-line sometimes unexpectedly kills invisible text
From: |
martin rudalics |
Subject: |
bug#342: kill-line sometimes unexpectedly kills invisible text |
Date: |
Sun, 01 Jun 2008 10:26:56 +0200 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
> 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 :-(
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#342: kill-line sometimes unexpectedly kills invisible text,
martin rudalics <=