unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* moving point and invisible text
@ 2006-02-08  9:23 martin rudalics
  2006-02-08 12:56 ` Stefan Monnier
  2006-02-14  0:40 ` Richard M. Stallman
  0 siblings, 2 replies; 9+ messages in thread
From: martin rudalics @ 2006-02-08  9:23 UTC (permalink / raw)


The Elisp manual describes the behavior of commands moving point with
respect to invisible text as follows:

"However, if a command ends with point inside or immediately after
invisible text, the main editing loop moves point further forward or
further backward (in the same direction that the command already moved
it) until that condition is no longer true.  ...  If the command moved
point forward into an invisible range, Emacs moves point forward past
the first visible character that follows the invisible text."

This description seems archaic.  With Emacs -q evaluate

(with-current-buffer (get-buffer-create "*test*")
   (insert "foo\n")
   (let ((at (point)))
     (insert "bar\nbar\nbar\n")
     (overlay-put (make-overlay at (point-max)) 'invisible t))
   (insert "baz\n"))

move point to position 18 in *test* (between the "b" and "a" of "baz")
and do C-b.  On my system this moves point to position 17 which is the
position immediately after the invisible text, thus contradicting the
first sentence of the description.  According to that sentence point
should move to position 5 here.

Now move point to position 4 (the end of the first line) and do C-2 C-f.
Another time point moves to position 17.  According to the manual point
should move to position 18 here.  I'm glad it doesn't.

Finally, move point to position 4 and execute C-f.  Once more point
moves to position 17.  This behavior is not mentioned in the manual.
Moreover, the manual fails to say what happens when the invisible text
resides at the end of a buffer.

Also, I was not able to detect a consistent behavior with different
values of `line-move-ignore-invisible' and with respect to whether an
invisibility overlay or an invisibility text-property was used.


Would it be difficult to implement this as:

"However, if a command moved point backward into or to the end of
invisible text, Emacs moves point backward to the beginning of that
text.  If a command moved point forward into or to the beginning of
invisible text, Emacs moves point forward to the end of that text."

Otherwise I'd change the text to something like:

"However, if a command ends with point inside invisible text, the main
editing loop moves point to some position before or after the invisible
text."

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: moving point and invisible text
@ 2006-02-20 18:42 Richard M. Stallman
  2006-02-20 22:07 ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Richard M. Stallman @ 2006-02-20 18:42 UTC (permalink / raw)
  Cc: emacs-devel

It looks like the your code to move point out of invisible text is not
behaving consistently.  The previous invisible/intangible code, which
your code replaced, worked consistently.

Here is what martin rudalics <rudalics@gmx.at> said:

    Stefan then told me that

       The behavior depends on many things: whether the invisible text is replaced
       by ellipsis, whether the invisible property is front-sticky and/or
       rear-sticky, whether the command made changes to the buffer, ...

     > Further experimentation shows that this case works the way the
     > manual previously said: it allows position 5 but does not allow
     > position 17.

    Not really: It rarely ever moves "point forward past the first visible
    character that follows the invisible text", that is, position 18.  (It
    does so only with `line-move-ignore-invisible' nil.)

It needs to consistently allow one of the two possible point positions
next to invisible text--either just before it, or just after it--and
not allow the other.

Would you please work on fixing this?

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-02-21 20:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-08  9:23 moving point and invisible text martin rudalics
2006-02-08 12:56 ` Stefan Monnier
2006-02-14  0:40 ` Richard M. Stallman
2006-02-14  7:25   ` martin rudalics
2006-02-14 22:18     ` Richard M. Stallman
2006-02-15 10:13       ` martin rudalics
  -- strict thread matches above, loose matches on Subject: below --
2006-02-20 18:42 Richard M. Stallman
2006-02-20 22:07 ` Stefan Monnier
2006-02-21 20:56   ` Richard M. Stallman

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).