Subject: before-string property has no effect if display property is empty

From: Glenn Morris <[email-masked]>
Date: Wed, 27 Aug 2008 16:25:53 -0400

Package: emacs
Version: 22.1
Severity: minor

(Filing a report for an old item from FOR-RELEASE.)

http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-09/msg00094.html
http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg01816.html

Summary:
    
    The documentation leads me to believe that the before-string and
    display properties of an overlay should be orthogonal.  However, the
    before-string is not displayed if the display property is the empty
    string.
    
    Reproduce by evaluating this code:
    
      (let ((buf (get-buffer-create "foo")))
        (with-current-buffer buf
          (display-buffer buf)
          (erase-buffer)
          (dolist (o (overlays-in (point-min) (point-max)))
            (delete-overlay o))
          (insert "ABC")
          (let ((o (make-overlay 2 3))
                (s (make-string 3 ?X)))
            (overlay-put o 'display "")
            (overlay-put o 'before-string s))))
    
    You will see the 'foo' window pop up and in the window you will see
    'AC'.  I expected that instead 'AXXXC' would be shown.