51 |
|
|
52 |
(defvar image-load-path |
(defvar image-load-path |
53 |
(list (file-name-as-directory (expand-file-name "images" data-directory)) |
(list (file-name-as-directory (expand-file-name "images" data-directory)) |
54 |
data-directory 'load-path) |
'data-directory 'load-path) |
55 |
"List of locations in which to search for image files. |
"List of locations in which to search for image files. |
56 |
If an element is a string, it defines a directory to search in. |
If an element is a string, it defines a directory to search. |
57 |
If an element is a variable symbol, the value of that variable is |
If an element is a variable symbol whose value is a string, that |
58 |
used as a list of directories to search.") |
value defines a directory to search. |
59 |
|
If an element is a variable symbol whose value is a list, the |
60 |
|
value is used as a list of directories to search.") |
61 |
|
|
62 |
(defun image-jpeg-p (data) |
(defun image-jpeg-p (data) |
63 |
"Value is non-nil if DATA, a string, consists of JFIF image data. |
"Value is non-nil if DATA, a string, consists of JFIF image data. |
280 |
(setq overlays (cdr overlays))))) |
(setq overlays (cdr overlays))))) |
281 |
|
|
282 |
(defun image-search-load-path (file path) |
(defun image-search-load-path (file path) |
283 |
(let (found pathname) |
(let (element found pathname) |
284 |
(while (and (not found) (consp path)) |
(while (and (not found) (consp path)) |
285 |
|
(setq element (car path)) |
286 |
(cond |
(cond |
287 |
((stringp (car path)) |
((stringp element) |
288 |
(setq found |
(setq found |
289 |
(file-readable-p |
(file-readable-p |
290 |
(setq pathname (expand-file-name file (car path)))))) |
(setq pathname (expand-file-name file element))))) |
291 |
((and (symbolp (car path)) (boundp (car path))) |
((and (symbolp element) (boundp element)) |
292 |
(if (setq pathname (image-search-load-path |
(setq element (symbol-value element)) |
293 |
file (symbol-value (car path)))) |
(cond |
294 |
(setq found t)))) |
((stringp element) |
295 |
|
(setq found |
296 |
|
(file-readable-p |
297 |
|
(setq pathname (expand-file-name file element))))) |
298 |
|
((consp element) |
299 |
|
(if (setq pathname (image-search-load-path file element)) |
300 |
|
(setq found t)))))) |
301 |
(setq path (cdr path))) |
(setq path (cdr path))) |
302 |
(if found pathname))) |
(if found pathname))) |
303 |
|
|