Subject: 26.1; Image files are sometimes not found

From: Markus Triska <[email-masked]>
Date: Sat, 06 Jul 2019 14:16:03 +0200

When I start Emacs with "$ emacs -Q", the description of the variable
data-directory reads:

    data-directory is a variable defined in ‘C source code’.
    Its value is "/opt/local/share/emacs/26.1/etc/"

In addition, I see that there is a file right.xpm with path:

    /opt/local/share/emacs/26.1/etc/images/custom/right.xpm

Also, the info manual states in 39.17.2 Image Descriptors:

   ‘:file FILE’
        This says to load the image from file FILE.  If FILE is not an
        absolute file name, it is expanded in ‘data-directory’.

Hence, I expect the following form to insert right.xpm, which is located
in images/custom/right.xpm relative to data-directory:

   (insert-image '(image :type xpm
                         :file "images/custom/right.xpm"
                         :ascent center))

However, when I evaluate the form with C-x C-e, I see a blank rectangle
at the end of the form instead of the intended image.

In contrast, changing the form to:

   (insert-image '(image :type xpm
                         :file "custom/right.xpm"
                         :ascent center))

inserts the intended image. Please note that "images/" had to be dropped
from the path, even though it belongs to the path of the file.

Could you please consider changing the documentation or implementation
to match the observed behaviour?

Thank you and all the best,
Markus

In GNU Emacs 26.1 (build 1, x86_64-apple-darwin15.3.0, X toolkit, Xaw scroll bars)
 of 2018-09-22 built on laptop
Windowing system distributor 'The X.Org Foundation', version 11.0.11502000

Configured features:
XPM JPEG TIFF GIF PNG GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE XFT
ZLIB TOOLKIT_SCROLL_BARS LUCID X11 MODULES THREADS LCMS2