emacs-devel
[Top][All Lists]
Advanced

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

Re: invisible


From: Stefan Monnier
Subject: Re: invisible
Date: Sun, 25 Nov 2007 22:20:51 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

> I don't know.  I'd have to gdb set_point_both to find out but doing so
> is awkward here.  Maybe you could give it a try.  I could imagine that
> invisibility and intangibility properties get mixed up.  On the other
> hand it might be simply TRT to do for redisplay after an interactive
> command.  Miles and Stefan used to work on this but I'm afraid they
> won't tell us ...

Indeed.  I don't care about the behavior being right in all conceivable
cases because I consider it simply impossible.  So I have no intention
spending time trying to analyze each and every problematic case
presented in this thread.  No time for that.

If you have a conrete situation where the current behavior is
problematic, firsyt you need to understand how those things work:
there are 2 places where invisibility impacts movement:
- when combined with `intangible', it impacts every single movement of
  `point', including within elisp functions.  This may "do the right
  thing" in some sense, but it tends to break a lot of code, and
  it can be terribly difficult to write code that works in the face of
  intangible properties.  So I highly recommend against the use of
  `intangible' except for those rare cases where it's *really*
  absolutely needed.
- when not combined with `intangible', invisible properties have the
  effect (just like composition and display properties) that after each
  *command* (i..e more or less just after running post-command-hook)
  point is moved outside of the invisible text.  Now since it's done at
  the end of a command (which may have moved point many times in
  arbitrarily complex ways), you can't do it right 100% of the time.
  OTOH this interacts fine with pretty much any elisp code.

Many of the problems you point out have to do with interactions with C-n
and C-p which are surprisingly complex functions.  The interaction
between all three is even worse.

So if you can try and reproduce the problem with only C-n/C-p (i.e. no
intangible text and with non-nil disable-point-adjustement) or with
only intangible text or with only invisible text, that makes it more
likely we can try and fix it.

Also the interaction with those things is sufficiently bad, that there
are many problematic cases.  So if the problem only appears when you mix
those, to have a better chance of seeing your bug fixed, try to make
sure the symptom is really serious: e.g. C-n does move at all (or moves
backward).  And focus on *1* problem at a time.

> Meanwhile could you please check my patch for simple.el too?

Please post it again,


        Stefan




reply via email to

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