aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorChong Yidong2005-09-18 14:04:46 +0000
committerChong Yidong2005-09-18 14:04:46 +0000
commit93a75651ff56f5064762ca5565f5baef9a8f6a7b (patch)
treef26afd697e3626f68074181e340474542f7895f7 /lisp
parent906320ec023f407eec55afa2df3532251056e8b8 (diff)
downloademacs-93a75651ff56f5064762ca5565f5baef9a8f6a7b.tar.gz
emacs-93a75651ff56f5064762ca5565f5baef9a8f6a7b.zip
(image-load-path): Use symbol `data-directory' instead of its value,
for backward compatibility with packages that bind it during `find-image'. Suggested by Katsumi Yamaoka. (image-search-load-path): Handle symbols whose values are strings.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/image.el31
2 files changed, 27 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 452cbb2971d..7251572ee96 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12005-09-18 Chong Yidong <cyd@stupidchicken.com>
2
3 * image.el (image-load-path): Use symbol `data-directory' instead
4 of its value, for backward compatibility with packages that bind
5 it during `find-image'. Suggested by Katsumi Yamaoka.
6 (image-search-load-path): Handle symbols whose values are strings.
7
12005-09-18 Romain Francoise <romain@orebokech.com> 82005-09-18 Romain Francoise <romain@orebokech.com>
2 9
3 * calendar/diary-lib.el (mark-diary-entries): Rearrange to wrap 10 * calendar/diary-lib.el (mark-diary-entries): Rearrange to wrap
diff --git a/lisp/image.el b/lisp/image.el
index 154a49e61b1..ee188677517 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -51,11 +51,13 @@ a non-nil value, TYPE is the image's type.")
51 51
52(defvar image-load-path 52(defvar image-load-path
53 (list (file-name-as-directory (expand-file-name "images" data-directory)) 53 (list (file-name-as-directory (expand-file-name "images" data-directory))
54 data-directory 'load-path) 54 'data-directory 'load-path)
55 "List of locations in which to search for image files. 55 "List of locations in which to search for image files.
56If an element is a string, it defines a directory to search in. 56If an element is a string, it defines a directory to search.
57If an element is a variable symbol, the value of that variable is 57If an element is a variable symbol whose value is a string, that
58used as a list of directories to search.") 58value defines a directory to search.
59If an element is a variable symbol whose value is a list, the
60value is used as a list of directories to search.")
59 61
60(defun image-jpeg-p (data) 62(defun image-jpeg-p (data)
61 "Value is non-nil if DATA, a string, consists of JFIF image data. 63 "Value is non-nil if DATA, a string, consists of JFIF image data.
@@ -278,17 +280,24 @@ BUFFER nil or omitted means use the current buffer."
278 (setq overlays (cdr overlays))))) 280 (setq overlays (cdr overlays)))))
279 281
280(defun image-search-load-path (file path) 282(defun image-search-load-path (file path)
281 (let (found pathname) 283 (let (element found pathname)
282 (while (and (not found) (consp path)) 284 (while (and (not found) (consp path))
285 (setq element (car path))
283 (cond 286 (cond
284 ((stringp (car path)) 287 ((stringp element)
285 (setq found 288 (setq found
286 (file-readable-p 289 (file-readable-p
287 (setq pathname (expand-file-name file (car path)))))) 290 (setq pathname (expand-file-name file element)))))
288 ((and (symbolp (car path)) (boundp (car path))) 291 ((and (symbolp element) (boundp element))
289 (if (setq pathname (image-search-load-path 292 (setq element (symbol-value element))
290 file (symbol-value (car path)))) 293 (cond
291 (setq found t)))) 294 ((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))))))
292 (setq path (cdr path))) 301 (setq path (cdr path)))
293 (if found pathname))) 302 (if found pathname)))
294 303