emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: moving point over invisible and intangible text


From: Stefan Monnier
Subject: Re: moving point over invisible and intangible text
Date: 16 Oct 2003 13:44:03 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> Do you mean "not to use `intangible' in combination with `invisible'"
> or do you mean "not to use `intangible', period"?

The latter.

>    It's a pretty sure way to get into odd problems (the problem being that
>    `intangible' works at a very low-level and leads to really unexpected
>    behavior such as (goto-char N) not going to position N).
>    Just using `invisible' is usually sufficient.

> Yes, but what if one wants to use `intangible' without using
> `invisible'?  You seem to imply that the changes you made to the
> treatment of the invisibility property mean that Elisp authors now can
> rest assured that (goto-char N) is _definitely_ going to go to
> position N.

No.  I only said that `intangible' changes the behavior of `goto-char'
(and many other operations) in unexpected ways.
My change just provides in a safer way one of the behaviors that used to
"require" `intangible'.  And as a matter of fact, even for those uses,
setting line-move-ignore-invisible to t was often sufficient.

> Of course not.  People can still use the intangibility
> property and, moreover, there are other reasons why (goto-char N) will
> not necessarily go to position N (narrowing, size of buffer and so
> on).

Yes, but those exceptions have existed since Emacs-18 at least, so most/all
packages are well prepared to deal with them.  Not so with `intangible'
which is moreover much less predictable: it can happen anywhere and
requires constant probing of the `intangible' property.  And to make things
worse, the behavior of the `intangible' property is fairly complex, so even
if you know it's there, it requires a good bit of care to handle it
correctly (witness the mess in line-move).

> Why is the fact that (goto-char N) does not unconditionally go
> to position N "really unexpected"?  It happens all the time.

Actually no, it rather unusal: most of the time, N is known to be within
point-min...point-max.


        Stefan


PS: My change also has some of the same problems as `intangible', of course.
    But they are much less severe because they only happen at the end of
    a command, so they never change the behavior within a command: they can
    only confuse the user, but not an elisp package.




reply via email to

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