# HG changeset patch # User Bill Wohler # Date 1142364908 0 # Node ID 279f737753d85d3ef423bfda93b2d30331df396b # Parent 5259cc742763eaa30422d965a36849c749c6043f (Defining Images): In image-load-path-for-library, always return list of directories. Update example. diff -r 5259cc742763 -r 279f737753d8 lispref/ChangeLog --- a/lispref/ChangeLog Tue Mar 14 19:21:48 2006 +0000 +++ b/lispref/ChangeLog Tue Mar 14 19:35:08 2006 +0000 @@ -1,3 +1,8 @@ +2006-03-14 Bill Wohler + + * display.texi (Defining Images): In image-load-path-for-library, + always return list of directories. Update example. + 2006-03-14 Alan Mackenzie * modes.texi: New node, "Region to Fontify" (for Font Lock). diff -r 5259cc742763 -r 279f737753d8 lispref/display.texi --- a/lispref/display.texi Tue Mar 14 19:21:48 2006 +0000 +++ b/lispref/display.texi Tue Mar 14 19:35:08 2006 +0000 @@ -4138,22 +4138,21 @@ Then this function returns a list of directories which contains first 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 @code{t}, then the function just -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 a suitable path can't be found, rather than signaling an error. +@code{load-path}. + +If @var{no-error} is non-@code{nil} and a suitable path can't be +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 with versions of Emacs that lack the variable @code{image-load-path}: @example -(let ((load-path - (image-load-path-for-library "mh-e" "mh-logo.xpm")) - (image-load-path - (image-load-path-for-library "mh-e" "mh-logo.xpm" - 'image-load-path))) +;; Avoid errors on Emacsen without `image-load-path'. +(if (not (boundp 'image-load-path)) (defvar image-load-path nil)) + +(let* ((load-path (image-load-path-for-library "mh-e" "mh-logo.xpm")) + (image-load-path (cons (car load-path) image-load-path))) (mh-tool-bar-folder-buttons-init)) @end example @end defun