* gmm-utils.el (gmm-image-load-path-for-library): Add no-error.
authorReiner Steib <Reiner.Steib@gmx.de>
Mon, 6 Mar 2006 17:33:52 +0000 (17:33 +0000)
committerReiner Steib <Reiner.Steib@gmx.de>
Mon, 6 Mar 2006 17:33:52 +0000 (17:33 +0000)
lisp/ChangeLog
lisp/gmm-utils.el

index 39ac7b9..afa7002 100644 (file)
@@ -1,7 +1,7 @@
 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>.
index e1c0207..4395628 100644 (file)
@@ -299,7 +299,7 @@ This function returns nil on those systems."
 ;; 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
@@ -311,6 +311,9 @@ path to IMAGE.  If PATH is given, it is used instead of
 `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':
@@ -363,6 +366,9 @@ This function is used by Emacs versions that don't have
                  (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)))