summaryrefslogtreecommitdiff
path: root/lisp/image.el
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-03-01 12:47:15 +0000
committerGerd Moellmann <gerd@gnu.org>2000-03-01 12:47:15 +0000
commit7f2283795ec1a69af07164c64c0283d2ba0ae652 (patch)
tree9611bf62f649d9042d4dab0d76a01c462ae61a3a /lisp/image.el
parent70d9b8fd9083ddb0cbb0af6c6d60d733ce3f87b4 (diff)
downloademacs-7f2283795ec1a69af07164c64c0283d2ba0ae652.tar.gz
(defimage): Look for image files in load-path.
Diffstat (limited to 'lisp/image.el')
-rw-r--r--lisp/image.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/image.el b/lisp/image.el
index daee7994b27..534cafe1e9b 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -1,6 +1,6 @@
;;; image.el --- image API
-;; Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
;; Keywords: multimedia
;; This file is part of GNU Emacs.
@@ -200,12 +200,19 @@ Example:
(let* ((spec (car specs))
(type (plist-get spec :type))
(data (plist-get spec :data))
- (file (plist-get spec :file)))
+ (file (plist-get spec :file))
+ found)
(when (image-type-available-p type)
(cond ((stringp file)
- (setq file (expand-file-name file data-directory))
- (when (file-readable-p file)
- (setq image (cons 'image (plist-put spec :file file)))))
+ (let ((path load-path))
+ (while (and (not found) path)
+ (let ((try-file (expand-file-name file (car path))))
+ (when (file-readable-p try-file)
+ (setq found try-file)))
+ (setq path (cdr path)))
+ (unless found
+ (setq found (expand-file-name file data-directory)))
+ (setq image (cons 'image (plist-put spec :file found)))))
((not (null data))
(setq image (cons 'image spec)))))
(setq specs (cdr specs))))