2006-03-06 Reiner Steib <Reiner.Steib@gmx.de>
* gmm-utils.el (gmm-image-load-path-for-library): Return single
- directory if path is t.
+ directory if path is t. Add no-error.
* gnus-group.el (gnus-group-make-tool-bar): Use add-hook.
Suggested by Stefan Monnier <monnier@iro.umontreal.ca>.
;; From MH-E with modifications:
(gmm-defun-compat gmm-image-load-path-for-library
- image-load-path-for-library (library image &optional path)
+ image-load-path-for-library (library image &optional path no-error)
"Return a suitable search path for images relative to LIBRARY.
Images for LIBRARY are searched for in \"../../etc/images\" and
`load-path'. If PATH is t, return a single image directory
instead of a path.
+If NO-ERROR is non-nil, don't signal an error if no suitable path
+for can be found.
+
Here is an example that uses a common idiom to provide
compatibility with versions of Emacs that lack the variable
`image-load-path':
(setq img (directory-file-name parent)
dir (expand-file-name "../" dir)))
(setq image-directory dir)))))
+ (no-error
+ ;; In this case we will return a nil element
+ (gmm-message 1 "Could not find image %s for library %s" image library))
(t
(error "Could not find image %s for library %s" image library)))