emacs-devel
[Top][All Lists]
Advanced

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

invisible text and point


From: Luc Teirlinck
Subject: invisible text and point
Date: Sun, 25 May 2003 23:37:37 -0500 (CDT)

There has been a relatively recent change in the treatment of point
near invisible text.  That change can be very confusing to the user
and apparently also to the Emacs code.  I noticed several bugs which
seem to be related to the change in question.  I have the impression
that they all could be undone by reverting the change.

Do the following both in Emacs-21.3 and Emacs-21.3.50.

C-h i m cvs RETURN

Put point on the * of

* CVS commands::                CVS commands share some things

C-u C-x = shows that in Emacs-21.3 we are where we think we are, on
the *, but in 21.3.50, we are on an invisible -.  The consequences
are:

try m

In Emacs-21.3, our default is "CVS commands" (what else), but in
21.3.50, it is Special Files.

C-g.  Now try RETURN.

In Emacs-21.3, we go to the expected place, but in 21.3.50, we get an
error message.

Reverting the change would automatically get rid of these bugs.  It
would also be easy to fix these bugs without reverting the change.
However, I have the impression that if one went on a bug hunt one
could find tons of similar bugs.  For instance, with point in
invisible text, one could easily get extremely strange defaults for
C-h f, C-h v, M-x man and so on...

There are worse things going on which only happen in the presence of
invisible text and only in 21.3.50, which I strongly suspect (even
though I am not 100% sure) to be related to the same change.

Do, say C-u C-x =, which pops up a new window.

Move that window upward with mouse-1.  No problem until we hit that
same spot with the invisible text.  There Emacs goes in an infinite
loop, apparently in the C code.  C-g is no help.

Start a new Emacs.

C-h i g (bash)Redirections RETURN

Just hit the down arrow key.  No problem until we hit some invisible
text after "Redirecting Output".  Infinite loop. no response to C-g.

Try everything over, but first do:

M-: (setq buffer-invisibility-spec nil)

No infinite loops, no problems.
No infinite loops, no problems in 21.3 either, regardless of
buffer-invisibility-spec.

I realize that putting point inside that invisible text has some
advantages in terms of stickiness.  However, in user produced buffers,
a user sophisticated enough to be playing around with invisibility
properties is probably sophisticated enough to handle stickiness in
the way that is best for him/her.  The Emacs produced buffers we are
talking about are all read-only to begin with, but to avoid confusing
users who, for some reason make them writable, we could give
text-property-default-nonsticky a buffer-local value and make the
invisibility property non-sticky in those particular buffers.

All of this is, of course just a suggestion.  It is possible to fix
all above bugs without reverting the change.  In the case of m and
RETURN in info, that would actually be easy, fixing the infinite loops
might be more complex.  However, as already mentioned, I believe that
the above bugs are just a small tip of a much bigger iceberg and that
there must be plenty more bugs related to the change.  The change in
question does not appear in any released version of Emacs, only in
21.3.50, so only people using the CVS would have gotten a shot at
encountering these bugs.  I encountered three in a few hours.  That
probably is because I was using info extensively, which contains
invisible text.
  
Sincerely,

Luc.




reply via email to

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