emacs-devel
[Top][All Lists]
Advanced

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

Re: moving point and invisible text


From: Richard M. Stallman
Subject: Re: moving point and invisible text
Date: Mon, 13 Feb 2006 19:40:46 -0500

    (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

    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.

The manual follows a previous version of the code, in which the position
after the invisible text was an impossible position.  The motive for this
was to avoid having two different point positions which display the cursor
in the same place.

The present code seems to treat the position after the invisible text
as possible, and treat the position just before it as impossible.
It's different, but it still achieves the goal of not having two
point positions that display the cursor in the same place.

I don't see any particular reason to prefer the old behavior, so I will
update the manual to describe the new behavior.

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

It would be easy enough to implement, but then there would be two
different point positions that appear to be the same place.




reply via email to

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