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

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

Display problems with 'before-string in overlay


From: Lennart Borgman (gmail)
Subject: Display problems with 'before-string in overlay
Date: Wed, 11 Apr 2007 00:33:04 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666

I want to put an overlay at the top of a buffer and display several lines of text there. I use an overlay of length 1 at point 1 with a 'before-string property to do this.

Doing this I see some strange display problems when moving point to the beginning of buffer. When (point) is 1 I want the cursor to be displayed after the 'before-string. And as a pessimist I fear that it might be displayed before the 'before-string.

However none of these alternatives happen. Instead the cursor is displayed at the end of the first line of the 'before-string.

To reproduce the problem eval this code and go to the beginning of the buffer:

(defvar temp-ovl nil)
(defun temp-toggle-ovl()
  (interactive)
  (if temp-ovl
      (progn
        (delete-overlay temp-ovl)
        (setq temp-ovl nil))
    (setq temp-ovl (make-overlay 1 1))
    (let ((s "A string\nwith several rows\nthat should be at top\n")
      (put-text-property 0 (length s)
                         'face (list (cons 'background-color
                                           "yellow"))
                         s)
      (overlay-put temp-ovl 'before-string s))))

I have attached an image display the cursor at point 1.


In GNU Emacs 22.0.97.1 (i386-mingw-nt5.1.2600)
 of 2007-04-09

PNG image


reply via email to

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