# HG changeset patch # User Gerd Moellmann # Date 951914835 0 # Node ID ea0a2a4f20b7779e9c79643a4595e402cd072419 # Parent 8f8b86890eb38cc932b13feab30c2d457497bfe4 (defimage): Look for image files in load-path. diff -r 8f8b86890eb3 -r ea0a2a4f20b7 lisp/image.el --- a/lisp/image.el Wed Mar 01 12:46:12 2000 +0000 +++ b/lisp/image.el Wed Mar 01 12:47:15 2000 +0000 @@ -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 @@ (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))))