[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using find-image with picture name stored in a variable
From: |
Anselm Helbig |
Subject: |
Re: using find-image with picture name stored in a variable |
Date: |
Wed, 19 Aug 2009 10:58:32 +0200 |
At Tue, 18 Aug 2009 13:42:07 -0700 (PDT),
"A.Politz" <politza@googlemail.com> wrote:
>
> On Aug 18, 10:28Â pm, Dirk80 <d...@dirkundsari.de> wrote:
> > Hello,
> >
> > when I give the name of a picture as a string to the find-image command then
> > it is working. But when I use a variable instead then find-image is not
> > finding the picture. What am I doing wrong?
> >
> > ;; picture test.jpg is in my home directory
> > (add-to-list 'image-load-path "~")
> >
> > ;; working
> > (find-image `((:type jpeg :file "./test.jpg")))
> >
> > ;; NOT working
> > (setq my-picture "./test.jpg")
> > (find-image `((:type jpeg :file my-picture)))
>
> You are missing a comma, or more likely don't understand quoting.
>
> (find-image `((:type jpeg :file ,my-picture)))
>
> (info "(elisp)Backquote")
> (info "(elisp)Quoting")
>
> -ap
Maybe it's easier to understand what's going on when you write it this
way:
(find-image (list (list :type 'jpeg :file my-picture)))
HTH,
Anselm
--
Anselm Helbig
mailto:anselm.helbig+news2009@googlemail.com