--- mh-compat.el.orig 2006-03-10 17:36:49.000000000 -0800 +++ mh-compat.el 2006-03-10 17:54:48.000000000 -0800 @@ -124,12 +124,12 @@ well as in `image-load-path' and `load-path'. This function returns the value of `load-path' augmented with the -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. +directory containing IMAGE. If PATH is given, it is used instead +of `load-path'. If PATH is t, just return the directory that +contains IMAGE. -If NO-ERROR is non-nil, don't signal an error if no suitable path -for can be found. +If NO-ERROR is non-nil, return nil if a suitable path can't be +found rather than signaling an error. Here is an example that uses a common idiom to provide compatibility with versions of Emacs that lack the variable @@ -184,16 +184,19 @@ 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)) + ;; In this case we will return nil. + (message "Could not find image %s for library %s" image library)) (t (error "Could not find image %s for library %s" image library))) - ;; Return augmented `image-load-path' or `load-path'. - (cond ((eq path t) - image-directory) - ((and path (symbolp path)) - (nconc (list image-directory) + ;; Return the directory, nil if no-error was non-nil and a + ;; suitable path could not be found, or an augmented + ;; `image-load-path' or `load-path'. + (cond ((or (null image-directory) + (eq path t)) + image-directory) + ((and path (symbolp path)) + (nconc (list image-directory) (delete image-directory (if (boundp path) (copy-sequence (symbol-value path))