emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: invisible


From: Stephen Berman
Subject: Re: invisible
Date: Sun, 18 Nov 2007 01:35:04 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

RMS requested that I post a reminder about the following.  I append to
it a status report of a related bug report.

On Fri, 09 Nov 2007 22:59:08 +0100 Stephen Berman <address@hidden> wrote:

> On Sat, 28 Feb 2004 20:24:44 -0600 (CST) Luc Teirlinck
> <address@hidden> wrote: 
>
>> ===File ~/invlines==========================================
>> line1
>> line2
>> line3
>> line4
>> line5
>> line6
>> line7
>> ============================================================
>>
>> No trailing whitespace but with final newline.
>>
>> Visit using emacs -q
>>
>> (put-text-property 6 7 `invisible t)
>> (put-text-property 12 13 `invisible t)
>> (put-text-property 18 19 `invisible t)
>> (put-text-property 24 25 `invisible t)
>> (put-text-property 30 31 `invisible t)
>>
>> Result:
>>
>> line1line2line3line4line5line6
>> line7
>>
>> line-move-ignore-invisible is now nil.
>>
>> With point at beginning of buffer keep doing C-n.  Everything goes at
>> expected.  We arrive at the end of the buffer, the newline after line7.
>>
>> C-p beginning of line7. OK.
>> C-p beginning of line6.  OK.
>> C-p beginning of line4.  Why did we skip line5?
>> C-p beginning of line2.  Skipped line3.
>
> This behavior still exists in GNU Emacs 23.0.50.4 (i686-pc-linux-gnu,
> GTK+ Version 2.12.0) of 2007-11-09 on escher.[1]  In addition, starting
> with the cursor at (point-min), the line number indicator in the mode
> line displays L1, and it continues to display L1 as you advance either
> by C-n or by C-f until it reaches the `l' of `line7', then it changes to
> L7.  From there if you type C-b moving point to just after `6', the mode
> line displays L6.  Now continuing backwards either by C-p or C-b the
> mode line usually continues to display L6, even at (point-min).  Typing
> C-b again here then changes the display to L1.
>
> Steve Berman
>
> Footnotes: 
> [1] But the behavior seems to be unstable: sometimes line2 is skipped
> advancing by C-n, sometimes line6 is skipped receding by C-p (then the
> mode line displays L5 and doesn't change as you continue to
> (point-min)).

=======================================================================
Here's a status report of a related bug report.  I tested the following
with -Q in GNU Emacs 23.0.50.2 (i686-pc-linux-gnu, GTK+ Version 2.12.0)
of 2007-11-13 on escher.

On Fri, 29 Oct 2004 12:07:10 +0900 (JST) Kazu Yamamoto (山本和彦)
<address@hidden> wrote: 

> Hello,
>
> This is the third trial to ask to fix bugs related to the "invisible"
> property. I'm really suffering from these bugs.
>
> Consider the following content (without invisible text) of a buffer:
>
> ---
> line1
> line2
> line3
> line4
> ---
>
> At the beginning of line N, C-n goes to the beginning of line N+1.
> At the beginning of line N, C-p goes to the beginning of line N-1.
> At the end of line N, C-n goes to the end of line N+1.
> At the end of line N, C-p goes to the end of line N-1.
>
> This is the right behavior.
>
> Then put the invisible property onto line 2 including "\n".
>
> ---
> line1
> line3
> line4
> ---
>
> (1) If line-move-ignore-invisible is nil:
>
> At the beginning of line 3, C-n goes to "i" in line 3.
>       (should go to the beginning of line 4)

The undesired behavior still obtains.

> At the end of line 3, C-p goes to the beginning of line 3.
>       (should go to the end of line 2)

In current development Emacs, the cursor stays put, i.e., C-p is a no-op
here; the same goes for every position in line 3, except the beginning
of the line: here C-p goes to the beginning of line 1 (the parenthetical
comment doesn't make sense, unless it is a typo for line 1, or maybe he
means the mode line should display L2 instead of L3, even though the
cursor stays put).

> At the beginning of line 3, C-e goes to "i" in line 3.
>       (should go to the end of line 3)

In current development Emacs, the cursor goes to the end of line 1
(anywhere else on line 3, C-e goes to the end of line 3).  On the other
hand, C-a at the beginning of line 3 goes to "i" in line 3 (elsewhere it
goes to the beginning of the line, so that repeatedly typing C-a
starting from the beginning of line 3 makes the cursor oscillate between
the first and second columns of the line).

> (2) If line-move-ignore-invisible is t:
>
> At the end of line 1, C-n goes to the beginning of line 3.
>       (should go to the end of line 3)
> At the end of line 4, C-p goes to the beginning of line 3.
>       (should go to the end of line 3)
> At the beginning of the line 3, C-e goes to "i" in line 3.
>       (should go to the end of line 3)

In current development Emacs, the desired behavior (expressed in the
parentheses) obtains.

> I guess the best solution is removing the line-move-ignore-invisible
> variable and behaving as if the invisible text does not exist.
>
> If this is not possible, Emacs should behave as if the invisible text
> does not exist when line-move-ignore-invisible is non-nil.
>
> --Kazu Yamamoto

Steve Berman





reply via email to

[Prev in Thread] Current Thread [Next in Thread]