]> git.eshelyaron.com Git - emacs.git/commitdiff
(image-load-path-for-library): Fix example by not recommending that
authorBill Wohler <wohler@newt.com>
Wed, 15 Mar 2006 17:06:16 +0000 (17:06 +0000)
committerBill Wohler <wohler@newt.com>
Wed, 15 Mar 2006 17:06:16 +0000 (17:06 +0000)
one binds image-load-path. Just defvar it to placate compiler and only
use it if previously defined.

lisp/ChangeLog
lisp/image.el

index 29f6fa2ce41f6af79e98b226e8684ff8a02c30aa..ea75ff76f4475c38ce523a8b1734535400390bd2 100644 (file)
@@ -1,3 +1,9 @@
+2006-03-15  Bill Wohler  <wohler@newt.com>
+
+       * image.el (image-load-path-for-library): Fix example by not
+       recommending that one binds image-load-path. Just defvar it to
+       placate compiler and only use it if previously defined.
+
 2006-03-15  Carsten Dominik  <dominik@science.uva.nl>
 
        * textmodes/org.el (org-insert-centered): Use `string-width' to
index 6938dba05cbc713526f8a8693ead7d7444799367..a01497ff445ee5c1ffbbec029ef0baaaae8f2271 100644 (file)
@@ -99,11 +99,13 @@ Here is an example that uses a common idiom to provide
 compatibility with versions of Emacs that lack the variable
 `image-load-path':
 
-    ;; Avoid errors on Emacsen without `image-load-path'.
-    (if (not (boundp 'image-load-path)) (defvar image-load-path nil))
+    ;; Shush compiler.
+    (defvar image-load-path)
 
     (let* ((load-path (image-load-path-for-library \"mh-e\" \"mh-logo.xpm\"))
-           (image-load-path (cons (car load-path) image-load-path)))
+           (image-load-path (cons (car load-path)
+                                  (when (boundp 'image-load-path)
+                                    image-load-path))))
       (mh-tool-bar-folder-buttons-init))"
   (unless library (error "No library specified"))
   (unless image   (error "No image specified"))