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

lispref/ChangeLog
lispref/display.texi

index 9d07a2d59c8258c471943f970dcbb48f66df9044..70df1ae03f49bf054ae3cd8b6ae2e74300f1329a 100644 (file)
@@ -1,3 +1,10 @@
+2006-03-15  Bill Wohler  <wohler@newt.com>
+
+       * display.texi (Defining Images): Fix example in
+       image-load-path-for-library by not recommending that one binds
+       image-load-path. Just defvar it to placate compiler and only use
+       it if previously defined.
+
 2006-03-14  Bill Wohler  <wohler@newt.com>
 
        * display.texi (Defining Images): In image-load-path-for-library,
index 294a6d64e7e50e5a6b41adec772bbee0b391e76f..649d2ca17a0e00a3b842939e92bd207daa25763d 100644 (file)
@@ -4148,11 +4148,13 @@ Here is an example that uses a common idiom to provide compatibility
 with versions of Emacs that lack the variable @code{image-load-path}:
 
 @example
-;; 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))
 @end example
 @end defun