How about this patch? It changes find-image to look for an image file
in etc/images first, then in etc/, then in the load-path. The last
two are for backward compatibility, the idea being that images should
go into etc/images by default.
For example, if foobar.el needs an image that is installed into
etc/images/foobar/foo.xpm, it calls
(defimage foo-image ((:type xpm :file "foobar/foo.xpm" ....)))
*** emacs/lisp/image.el.~1.48.~ 2005-08-06 18:13:43.000000000 -0400
--- emacs/lisp/image.el 2005-09-14 03:55:29.000000000 -0400
***************
*** 286,292 ****
specification to be returned. Return nil if no specification is
satisfied.
! The image is looked for first on `load-path' and then in `data-directory'."
(let (image)
(while (and specs (null image))
(let* ((spec (car specs))
--- 286,293 ----
specification to be returned. Return nil if no specification is
satisfied.
! The image is looked for first in `data-directory'/images, then in
! `data-directory', then in `load-path'."
(let (image)
(while (and specs (null image))
(let* ((spec (car specs))
***************
*** 296,315 ****
found)
(when (image-type-available-p type)
(cond ((stringp 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
! (let ((try-file (expand-file-name file data-directory)))
! (if (file-readable-p try-file)
! (setq found try-file))))
! (if found
! (setq image
! (cons 'image (plist-put (copy-sequence spec)
! :file found))))))
((not (null data))
(setq image (cons 'image spec)))))
(setq specs (cdr specs))))
--- 297,323 ----
found)
(when (image-type-available-p type)
(cond ((stringp file)
! (if (or (file-readable-p
! (setq found
! (expand-file-name
! file
! (concat data-directory "/images"))))
! (file-readable-p
! (setq found
! (expand-file-name file data-directory)))
! (let ((path load-path))
! (setq found nil)
! (while (and (not found) path)
! (unless (file-readable-p
! (setq found (expand-file-name
! file (car path))))
! (setq found nil))
! (setq path (cdr path)))
! found))
! ;; image file found
! (setq image
! (cons 'image (plist-put (copy-sequence spec)
! :file found)))))
((not (null data))
(setq image (cons 'image spec)))))
(setq specs (cdr specs))))
_______________________________________________
Emacs-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-devel