--text follows this line--
It appears that images in tooltip-mode tooltips is currently broken on
most platforms besides windows. The following snippet should provide an
(defun my-download-as-string (url)
"Download file from URL and return it as string."
(let ((image-buf (url-retrieve-synchronously url)))
(when (looking-at "HTTP/")
(progn (re-search-forward "\n[\n]+")
(buffer-substring-no-properties (point-min) (point-max))))))
(defun my-download-image (url)
"Download URL as image."
(create-image (my-download-as-string url) (image-type-from-file-name url) t))
(with-current-buffer (get-buffer-create "*TooltipTest*")
(propertize "Facepalm" 'help-echo
(propertize " " 'display
Just `eval-buffer` then hover your mouse over `Facepalm` in the new
Emacs versions 26.2 26.3 and 28.0.50 were tested on NixOS, Ubuntu, OSX
On Windows a tooltip displays an image. On Linux (NixOS, Ubuntu) and OSX
only a small empty tooltip is presented.
One package I was able to identify that uses this behavior is Dired+
This feature is also useful in general to maintain the readability of
org-mode documents for example.