Subject: bug#802 closed by Chong Yidong <[email-masked]> (Re: before-string property has no effect if display property is empty)

From: [email-masked] (Emacs bug Tracking System)
Date: Sat, 27 Jun 2009 04:30:04 +0000

This is an automatic notification regarding your bug report
which was filed against the emacs package:

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

It has been closed by Chong Yidong <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Chong Yidong <[email-masked]> by
replying to this email.

-- 
802: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=802
Emacs Bug Tracking System
Contact [email-masked] with problems

Subject: Re: before-string property has no effect if display property is empty
From: Chong Yidong <[email-masked]>
To: [email-masked]
Date: Sat, 27 Jun 2009 00:25:08 -0400

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

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

This bug is already fixed in current CVS (and in the Emacs 23.1 branch).
>From [email-masked] Wed Aug 27 13:27:26 2008
From: Glenn Morris <[email-masked]>
To: quiet <[email-masked]>
Subject: before-string property has no effect if display property is empty
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.