aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-03-01 12:47:15 +0000
committerGerd Moellmann2000-03-01 12:47:15 +0000
commit7f2283795ec1a69af07164c64c0283d2ba0ae652 (patch)
tree9611bf62f649d9042d4dab0d76a01c462ae61a3a
parent70d9b8fd9083ddb0cbb0af6c6d60d733ce3f87b4 (diff)
downloademacs-7f2283795ec1a69af07164c64c0283d2ba0ae652.tar.gz
emacs-7f2283795ec1a69af07164c64c0283d2ba0ae652.zip
(defimage): Look for image files in load-path.
-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 @@
1;;; image.el --- image API 1;;; image.el --- image API
2 2
3;; Copyright (C) 1998, 1999 Free Software Foundation, Inc. 3;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
4;; Keywords: multimedia 4;; Keywords: multimedia
5 5
6;; This file is part of GNU Emacs. 6;; This file is part of GNU Emacs.
@@ -200,12 +200,19 @@ Example:
200 (let* ((spec (car specs)) 200 (let* ((spec (car specs))
201 (type (plist-get spec :type)) 201 (type (plist-get spec :type))
202 (data (plist-get spec :data)) 202 (data (plist-get spec :data))
203 (file (plist-get spec :file))) 203 (file (plist-get spec :file))
204 found)
204 (when (image-type-available-p type) 205 (when (image-type-available-p type)
205 (cond ((stringp file) 206 (cond ((stringp file)
206 (setq file (expand-file-name file data-directory)) 207 (let ((path load-path))
207 (when (file-readable-p file) 208 (while (and (not found) path)
208 (setq image (cons 'image (plist-put spec :file file))))) 209 (let ((try-file (expand-file-name file (car path))))
210 (when (file-readable-p try-file)
211 (setq found try-file)))
212 (setq path (cdr path)))
213 (unless found
214 (setq found (expand-file-name file data-directory)))
215 (setq image (cons 'image (plist-put spec :file found)))))
209 ((not (null data)) 216 ((not (null data))
210 (setq image (cons 'image spec))))) 217 (setq image (cons 'image spec)))))
211 (setq specs (cdr specs)))) 218 (setq specs (cdr specs))))