Subject: bug#19307: closed (Re: bug#19307: 24.4.51; Ellipsis created with `invisible' removes highlighting from overlay after-string after it)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 03 Feb 2015 20:31:04 +0000

Your bug report

#19307: 24.4.51; Ellipsis created with `invisible' removes highlighting from overlay after-string after it

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

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

Subject: Re: bug#19307: 24.4.51; Ellipsis created with `invisible' removes highlighting from overlay after-string after it
From: Dmitry Gutov <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked]
Date: Tue, 03 Feb 2015 22:30:30 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

On 02/03/2015 08:54 PM, Eli Zaretskii wrote:

> Turns out the bug I fixed concealed another one that was also there
> for a long time (more than 9 years), and became exposed due to my fix.
> Now fixed in commit e589765 on the emacs-24 branch.

Terrific. Works fine, AFAICS.

> The bugs happened in special cases for which no one coded the
> solution, so catering to those cases often needs additional code.
> Isn't that natural?

Okay. As long as you're confident that the cases are sufficiently 
special, I'm going to be content, too.

> Anyway, you should be happier with this last fix, since it removes
> more lines than it adds ;-)

Thanks, I am. :-)

Subject: 24.4.51; Ellipsis created with `invisible' removes highlighting from overlay after-string after it
From: Dmitry Gutov <[email-masked]>
To: [email-masked]
Date: Mon, 08 Dec 2014 17:33:36 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

In the example below, the `after-string' value is propertized with a
face.

But as long as there is ellipsis at its beginning, the after-string is
rendered using the default face.

(defun test ()
  (interactive)
  (ignore-errors
    (kill-buffer "test"))
  (pop-to-buffer "test")
  (add-to-invisibility-spec '(... . t))
  (insert (propertize "foo" 'invisible '...))
  (let ((ov (make-overlay (point) (point))))
    (overlay-put ov 'invisible t)
    (overlay-put ov 'window (selected-window))
    (overlay-put ov 'after-string
                 (propertize "xxx" 'face 'highlight))))

And here's a somewhat related scenario, with a surprising result:

(defun testt ()
  (interactive)
  (ignore-errors
    (kill-buffer "testt"))
  (pop-to-buffer "testt")
  (add-to-invisibility-spec '(... . t))
  (insert " ")
  (let ((ov (make-overlay (1- (point)) (point))))
    (overlay-put ov 'invisible t)
    (overlay-put ov 'window (selected-window))
    (overlay-put ov 'after-string
                 (propertize "xxx" 'face 'highlight)))
  (insert (propertize "foo" 'invisible '...)))

If I modify the scenario to make the overlay empty (and maybe omit
inserting the space at the beginning, though this makes no difference),
then "xxx" is displayed and even highlighted as expected.

In GNU Emacs 24.4.51.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)
 of 2014-11-28 on axl
Repository revision: 6b765b8facbdbb03f28028007885236601652515
Windowing system distributor `The X.Org Foundation', version 11.0.11501000
System Description:	Ubuntu 14.04.1 LTS