From: Bill Wohler Date: Wed, 15 Mar 2006 17:06:16 +0000 (+0000) Subject: (image-load-path-for-library): Fix example by not recommending that X-Git-Tag: emacs-pretest-22.0.90~3592 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9f036d338a998a7a05b971e74d2af8071a518a11;p=emacs.git (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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 29f6fa2ce41..ea75ff76f44 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2006-03-15 Bill Wohler + + * 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 * textmodes/org.el (org-insert-centered): Use `string-width' to diff --git a/lisp/image.el b/lisp/image.el index 6938dba05cb..a01497ff445 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -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"))