From: Stephen Berman <Stephen.Berman@gmx.net>
To: emacs-devel@gnu.org
Cc: emacs-pretest-bug@gnu.org
Subject: Re: invisible
Date: Fri, 23 Nov 2007 19:19:30 +0100 [thread overview]
Message-ID: <87k5o8q0y5.fsf@escher.local.home> (raw)
In-Reply-To: 4746E2CF.4010604@gmx.at
On Fri, 23 Nov 2007 15:25:19 +0100 martin rudalics <rudalics@gmx.at> wrote:
>> With (forward-line -1) there is also no line skipping,
>> but this is also the case without setting the rear-nonsticky property to
>> t, i.e., I see no difference, in contrast to C-p. The value of
>> track-eol is nil (the default). So I am not sure what problems you
>> mean.
>
> Assigning the rear-sticky property affects where `point' is set by
> scan_newline which does the line-end serching in `forward-line'. Not
> setting the rear-nonsticky property skips the line ends with the
> invisible property, at least on my system. Since `previous-line' and
> `next-line' both rely on `forward-line' to skip lines, I can't imagine
> how you do not see the problem with the latter. Please try again.
I cannot see a difference with forward-line. I did this:
1. I inserted the following lines into each of the buffers a and b:
line1
line2
line3
line4
line5
line6
line7
2. In buffer a I did
M-: (progn (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))
3. In buffer b I did
M-: (progn (add-text-properties 6 7 '(invisible t rear-nonsticky t))
(add-text-properties 12 13 '(invisible t rear-nonsticky t))
(add-text-properties 18 19 '(invisible t rear-nonsticky t))
(add-text-properties 24 25 '(invisible t rear-nonsticky t))
(add-text-properties 30 31 '(invisible t rear-nonsticky t)))
4. Via Customize I toggled line-move-ignore-invisible off and set it for
the current session. I left track-eol at its default value nil.
5. In buffer a with point at (point-max), repeatedly typing C-p goes
like this, with `^' marking successive positions of the cursor:
line1line2line3line4line5line6
^ ^ ^ ^
line7
^
6. In buffer b with point at (point-max), repeatedly typing C-p goes
like this:
line1line2line3line4line5line6
^ ^ ^ ^ ^ ^
line7
^
7. In both buffer a and buffer b with point at (point-max), repeatedly
typing 'M-: (forward-line -1)' goes like in 6:
line1line2line3line4line5line6
^ ^ ^ ^
line7
^
Set track-eol to t does not make any difference for 5, 6, 7. Setting
line-move-ignore-invisible to t makes C-p move point from the beginning
of line 7 to the beginning of line 1 in both buffers a and b, while 'M-:
(forward-line -1)' continues to behave as in 7.
>>>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).
>>>
>>>This seems like a bug in `line-move-finish', please try the attached
>>>patch (untested).
>>
>>
>> With your patch typing C-p, with the cursor at any position in line 3
>> but the beginning of the line, moves the cursor to the beginning of line
>> 3, i.e., does the same thing as C-a. I think I would have expected it
>> to put the cursor on line 1. (At the beginning of line 3 the behavior
>> is as before, C-p goes to the beginning of line 1.)
>
> Did you assign the rear-nonsticky property? It won't work without that
> property due to the behavior of the point setting mechanism.
I inserted the following lines into buffer c:
line1
line2
line3
line4
and typed `M-: (add-text-properties 7 13 '(invisible t rear-nonsticky
t))'. Then I evalled line-move-finish with your patch applied. With
line-move-ignore-invisible set to nil I get the behavior I described
(C-p on line 3 behaving like C-a except at the beginning of the line).
(The value of track-eol makes no difference here.)
>> Summarizing, it appears that rear-nonsticky should be set to t when a
>> position is given the invisible property. In particular,
>> facemenu-set-invisible should be changed accordingly, otherwise the menu
>> choice Edit->Text Properties->Special Properties->Invisible admits the
>> observed motion misbehavior. (But I don't know if there are other cases
>> where facemenu-set-invisible should leave the invisible position
>> rear-sticky.) This still does not fix the problem with C-p at positions
>> other than the beginning of the line after an invisible line, but your
>> patch for that also results in unexpected behavior.
>
> Setting rear-nonsticky is _not_ sufficient, you have to do something as
> in my patch in order to handle `line-move-ignore-invisible' correctly.
> Please try again (1) with the property set, (2) with and without my
> patch applied, and (3) with both values for `line-move-ignore-invisible'
> and `track-eol'.
I hope my descriptions above are clear enough.
On Fri, 23 Nov 2007 15:37:28 +0100 martin rudalics <rudalics@gmx.at> wrote:
>> Setting rear-nonsticky is _not_ sufficient, you have to do something as
>> in my patch in order to handle `line-move-ignore-invisible' correctly.
>> Please try again (1) with the property set, (2) with and without my
>> patch applied, and (3) with both values for `line-move-ignore-invisible'
>> and `track-eol'.
>
> Forgot to say (4) starting C-p / C-n at line-beginnings and -ends in
> order to test the "track-eol" behavior.
The only difference I see is in buffer a when the cursor is at the end
of line 7 (actually, anywhere but at the beginning), then typing C-p
repeatedly does not skip any lines. This is regardless of the setting
of track-eol.
Steve Berman
next prev parent reply other threads:[~2007-11-23 18:19 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040225.150142.12214540.kazu@iijlab.net>
[not found] ` <q5gvfluxljk.fsf@lucent.com>
[not found] ` <200402282128.i1SLSuY15359@raven.dms.auburn.edu>
[not found] ` <200402290224.i1T2Oip15705@raven.dms.auburn.edu>
2007-11-09 21:59 ` invisible Stephen Berman
2007-11-18 0:35 ` invisible Stephen Berman
2007-11-18 15:27 ` invisible martin rudalics
2007-11-23 12:24 ` invisible Stephen Berman
2007-11-23 14:25 ` invisible martin rudalics
2007-11-23 18:19 ` Stephen Berman [this message]
2007-11-23 19:59 ` invisible martin rudalics
2007-11-23 20:31 ` invisible Stephen Berman
2007-11-23 21:52 ` invisible martin rudalics
2007-11-23 23:04 ` invisible Stephen Berman
2007-11-24 9:33 ` invisible martin rudalics
2007-11-24 10:11 ` invisible Johan Bockgård
2007-11-24 10:30 ` invisible martin rudalics
2007-11-24 10:34 ` invisible martin rudalics
2007-11-24 19:50 ` invisible Stephen Berman
2007-11-24 22:26 ` invisible martin rudalics
2007-11-26 3:25 ` invisible Stefan Monnier
2007-11-26 8:02 ` invisible martin rudalics
2007-11-26 15:17 ` invisible Stefan Monnier
2007-11-26 19:10 ` invisible martin rudalics
2007-11-26 20:19 ` invisible Stefan Monnier
2007-11-26 3:20 ` invisible Stefan Monnier
2007-11-26 7:59 ` invisible martin rudalics
2007-11-26 15:29 ` invisible Stefan Monnier
2007-11-26 19:09 ` invisible martin rudalics
2007-11-26 20:16 ` invisible Stefan Monnier
2007-11-27 13:11 ` invisible martin rudalics
2007-11-27 18:46 ` invisible martin rudalics
2007-11-27 22:44 ` invisible Stefan Monnier
2007-11-28 9:16 ` invisible martin rudalics
2007-11-28 19:20 ` invisible Stefan Monnier
2007-11-28 22:41 ` invisible martin rudalics
2007-11-28 23:23 ` invisible Stephen Berman
2007-11-29 10:15 ` invisible martin rudalics
2007-11-29 16:13 ` invisible Stefan Monnier
2007-11-29 1:04 ` invisible Richard Stallman
2007-11-29 10:26 ` invisible martin rudalics
2007-11-29 15:57 ` invisible Stefan Monnier
2007-11-29 16:36 ` invisible martin rudalics
2007-11-29 18:53 ` invisible Stefan Monnier
2007-11-29 19:55 ` invisible martin rudalics
2007-11-30 17:19 ` invisible martin rudalics
2007-11-30 18:59 ` invisible Stefan Monnier
2007-11-30 22:09 ` invisible martin rudalics
2007-12-01 3:11 ` invisible Stefan Monnier
2007-12-01 9:44 ` invisible martin rudalics
2007-12-01 20:41 ` invisible Stefan Monnier
2007-12-02 1:15 ` invisible Johan Bockgård
2007-12-02 9:47 ` invisible martin rudalics
2007-11-23 14:37 ` invisible martin rudalics
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k5o8q0y5.fsf@escher.local.home \
--to=stephen.berman@gmx.net \
--cc=emacs-devel@gnu.org \
--cc=emacs-pretest-bug@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).