Commit 70949f30 authored by Bill Wohler's avatar Bill Wohler
Browse files

(Defining Images): In image-load-path-for-library, always return list

of directories. Update example.
parent 44e3f440
2006-03-14 Bill Wohler <wohler@newt.com>
* display.texi (Defining Images): In image-load-path-for-library,
always return list of directories. Update example.
2006-03-14 Alan Mackenzie <acm@muc.de> 2006-03-14 Alan Mackenzie <acm@muc.de>
* modes.texi: New node, "Region to Fontify" (for Font Lock). * modes.texi: New node, "Region to Fontify" (for Font Lock).
......
...@@ -4138,22 +4138,21 @@ First it searches for @var{image} in a path suitable for ...@@ -4138,22 +4138,21 @@ First it searches for @var{image} in a path suitable for
Then this function returns a list of directories which contains first Then this function returns a list of directories which contains first
the directory in which @var{image} was found, followed by the value of the directory in which @var{image} was found, followed by the value of
@code{load-path}. If @var{path} is given, it is used instead of @code{load-path}. If @var{path} is given, it is used instead of
@code{load-path}. If @var{path} is @code{t}, then the function just @code{load-path}.
returns the directory that contains @var{image}.
@c ??? Meaningm it does not return a list?
If @var{no-error} is non-@code{nil}, this function returns @code{nil} If @var{no-error} is non-@code{nil} and a suitable path can't be
if a suitable path can't be found, rather than signaling an error. found, don't signal an error. Instead, return a list of directories as
before, except that @code{nil} appears in place of the image directory.
Here is an example that uses a common idiom to provide compatibility Here is an example that uses a common idiom to provide compatibility
with versions of Emacs that lack the variable @code{image-load-path}: with versions of Emacs that lack the variable @code{image-load-path}:
@example @example
(let ((load-path ;; Avoid errors on Emacsen without `image-load-path'.
(image-load-path-for-library "mh-e" "mh-logo.xpm")) (if (not (boundp 'image-load-path)) (defvar image-load-path nil))
(image-load-path
(image-load-path-for-library "mh-e" "mh-logo.xpm" (let* ((load-path (image-load-path-for-library "mh-e" "mh-logo.xpm"))
'image-load-path))) (image-load-path (cons (car load-path) image-load-path)))
(mh-tool-bar-folder-buttons-init)) (mh-tool-bar-folder-buttons-init))
@end example @end example
@end defun @end defun
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment