help-gnu-emacs
[Top][All Lists]
Advanced

[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" <address@hidden> wrote:
> 
> On Aug 18, 10:28 pm, Dirk80 <address@hidden> 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:address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]