GNU bug report logs - #42521
28.0.50; Can't include an image in a display string

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Fri, 24 Jul 2020 19:41:02 UTC

Severity: wishlist

Found in version 28.0.50

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; Can't include an image in a display string
Date: Fri, 24 Jul 2020 22:40:02 +0300
(progn
  (erase-buffer)
  (insert " ")
  (setq o (make-overlay (point-min) (point)))
  (overlay-put o 'display
               (concat (propertize " " 'display
                                   (create-image "splash.svg" nil nil 
:max-height
                                                 (default-font-height)))
                       " text after image")))

The script above will end with a blank space instead of an image being 
displayed.

To compare: replace the first 'display symbol with 'after-string, and
the image is displayed.

Why do we need this: if this worked, we would implement icons display in
the default completion popup in company-mode. It's a feature that has 
been requested for a while. See the discussion here:

https://github.com/company-mode/company-mode/pull/996#issuecomment-662743347

Unfortunately, as we seem to have concluded in

  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=18285
  and
  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20847,

I have to use the `display' overlay property in most of the cases.

P.S. This is not a regression, Emacs 26.3 is the same.

In GNU Emacs 28.0.50 (build 25, x86_64-pc-linux-gnu, GTK+ Version 
3.24.20, cairo version 1.16.0)
 of 2020-07-20 built on potemkin
Repository revision: 4c08c2f45b9bb0265f6d7c3529011dee1b18e843
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Ubuntu 20.04 LTS




This bug report was last modified 4 years and 326 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.