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

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

move-to-column inconsistent with invisible text


From: Nikolaj Schumacher
Subject: move-to-column inconsistent with invisible text
Date: Wed, 04 Apr 2007 12:35:37 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (darwin)

Hello,

when I create an overlay to hide text, move-to-column works differently
depending on the point's position in the current line.

If the point is before the hidden characters, it will move the point to
the N'th visible column (i.e. the one given by column-number-mode), but
when the point is behind the hidden characters, it will move the point
to (point-at-bol) + N.


Consider the following example:

(progn
  (insert "1234567890")
  (let ((overlay (make-overlay (+ (point-at-bol) 2) (+ (point-at-bol) 4))))
    (overlay-put overlay 'invisible t)
    (let ((point-a (save-excursion (beginning-of-line)
                                   (move-to-column 6)
                                   (point)))
          (point-b (save-excursion (end-of-line)
                                   (move-to-column 6)
                                   (point))))
      (delete-overlay overlay)
      (message "%d %d" point-a point-b))))

point-a and point-b should be equal, but they are not.


regards,
Nikolaj Schumacher




reply via email to

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