[Top][All Lists]

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

Weird interaction between `move-beginning-of-line', fields, and invisibl

From: Jorgen Schaefer
Subject: Weird interaction between `move-beginning-of-line', fields, and invisible overlays
Date: Sun, 18 Jun 2006 23:32:35 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

When using a prompt in a buffer with a field property,
`move-beginning-of-line' will move to the end of the prompt, not
the beginning of the line - unless the line before the field is
made invisible by an overlay.

To reproduce (tested in emacs -D -Q):

(with-current-buffer (get-buffer-create "*Test*")
  (let ((inhibit-read-only t))
  (insert "At this prompt, `move-beginning-of-line' stays behind the prompt.\n"
          "This is the expected behavior.\n"
          (propertize "Bar> "
                      'field 'fnord
                      'read-only t
                      'rear-nonsticky t))
  (insert "\n\nHere, it moves to the beginning the prompt.\n")
  (let ((beg (point)))
    (insert "Fnord!\n")
    (let ((o (make-overlay beg (point))))
      (overlay-put o 'invisible t)))
  (insert (propertize "Bar> "
                      'field 'fnord
                      'read-only t
                      'rear-nonsticky t))
  (switch-to-buffer "*Test*")
  (goto-char (point-max)))

        -- Jorgen

((email . "address@hidden") (www . "http://www.forcix.cx/";)
 (gpg   . "1024D/028AF63C")   (irc . "nick forcer on IRCnet"))

reply via email to

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