Clarify image file search

* doc/lispref/display.texi (Defining Images, Image Descriptors):
* lisp/image.el (create-image): Clarify that non-absolute image
files are searched along 'image-load-path'.  (Bug#52931)
This commit is contained in:
Eli Zaretskii 2022-09-28 22:03:27 +03:00
parent fc212364ce
commit cf38e1c393
2 changed files with 9 additions and 7 deletions

View file

@ -5416,10 +5416,9 @@ Every image descriptor must include this property.
@item :file @var{file} @item :file @var{file}
This says to load the image from file @var{file}. If @var{file} is This says to load the image from file @var{file}. If @var{file} is
not an absolute file name, it is expanded relative to the not an absolute file name, it is expanded relative to each of the
@file{images} subdirectory of @code{data-directory}, and failing that, directories mentioned by @code{image-load-path} (@pxref{Defining
relative to the directories listed by @code{x-bitmap-file-path} Images}).
(@pxref{Face Attributes}).
@item :data @var{data} @item :data @var{data}
This specifies the raw image data. Each image descriptor must have This specifies the raw image data. Each image descriptor must have
@ -6367,7 +6366,9 @@ Supports the @code{:index} property. @xref{Multi-Frame Images}.
This function creates and returns an image descriptor which uses the This function creates and returns an image descriptor which uses the
data in @var{file-or-data}. @var{file-or-data} can be a file name or data in @var{file-or-data}. @var{file-or-data} can be a file name or
a string containing the image data; @var{data-p} should be @code{nil} a string containing the image data; @var{data-p} should be @code{nil}
for the former case, non-@code{nil} for the latter case. for the former case, non-@code{nil} for the latter case. If
@var{file-or-data} is a relative file name, the function will search
for it in directories mentioned in @code{image-load-path}.
The optional argument @var{type} is a symbol specifying the image type. The optional argument @var{type} is a symbol specifying the image type.
If @var{type} is omitted or @code{nil}, @code{create-image} tries to If @var{type} is omitted or @code{nil}, @code{create-image} tries to

View file

@ -460,8 +460,9 @@ must be available."
;;;###autoload ;;;###autoload
(defun create-image (file-or-data &optional type data-p &rest props) (defun create-image (file-or-data &optional type data-p &rest props)
"Create an image. "Create an image from FILE-OR-DATA.
FILE-OR-DATA is an image file name or image data. FILE-OR-DATA is an image file name or image data. If it is a relative
file name, the function will look for it along `image-load-path'.
Optional TYPE is a symbol describing the image type. If TYPE is omitted Optional TYPE is a symbol describing the image type. If TYPE is omitted
or nil, try to determine the image type from its first few bytes or nil, try to determine the image type from its first few bytes