diff options
author | Bill Wohler <wohler@newt.com> | 2006-03-14 19:35:08 +0000 |
---|---|---|
committer | Bill Wohler <wohler@newt.com> | 2006-03-14 19:35:08 +0000 |
commit | 70949f309abf3fd2f7c27a253d3ee5d1bf30d83b (patch) | |
tree | 0942ab6fb9f1ada300ef7904ef0fc15c79170987 /lispref | |
parent | 44e3f44013ee5d526d2666e2ec8ed4962f9a6c77 (diff) | |
download | emacs-70949f309abf3fd2f7c27a253d3ee5d1bf30d83b.tar.gz |
(Defining Images): In image-load-path-for-library, always return list
of directories. Update example.
Diffstat (limited to 'lispref')
-rw-r--r-- | lispref/ChangeLog | 5 | ||||
-rw-r--r-- | lispref/display.texi | 19 |
2 files changed, 14 insertions, 10 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 5b5a316c95e..9d07a2d59c8 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,8 @@ +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> * modes.texi: New node, "Region to Fontify" (for Font Lock). diff --git a/lispref/display.texi b/lispref/display.texi index dcf54f60d1d..294a6d64e7e 100644 --- a/lispref/display.texi +++ b/lispref/display.texi @@ -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 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? +@code{load-path}. -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. +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 |