I am trying to make graphical tooltips appear over some words in Emacs. Here is the code I have developed:
(defun image-tooltip (window object position) (save-excursion (goto-char position) (let* ((img-file (format "%s.png" (thing-at-point 'word))) (s (propertize "Look in the minbuffer" 'display (create-image (expand-file-name img-file))))) (message "%s" s)))) (font-lock-add-keywords nil '(("\\<kiwi\\>\\|\\<grapes\\>\\|strawberry" 0 '(face font-lock-keyword-face help-echo image-tooltip))))
The kiwi.png and other images are stored on disk, and they work fine (you can see it here https://www.youtube.com/watch?v=uX_hAPb9NOc) It works fine to put an image in the minibuffer, but the tooltip itself just says Look in minibuffer, and I thought it would instead show the image. Am I missing something in here?