all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Anselm Helbig <anselm.helbig+news2009@googlemail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: using find-image with picture name stored in a variable
Date: Wed, 19 Aug 2009 10:58:32 +0200	[thread overview]
Message-ID: <871vn85gef.wl%anselm.helbig@gmx.de> (raw)
In-Reply-To: <8b1dce33-641f-4a2b-9c1c-d2323cb8624b@18g2000yqa.googlegroups.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1045 bytes --]

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


  reply	other threads:[~2009-08-19  8:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.4854.1250627340.2239.help-gnu-emacs@gnu.org>
2009-08-18 20:42 ` using find-image with picture name stored in a variable A.Politz
2009-08-19  8:58   ` Anselm Helbig [this message]
2009-08-18 20:28 Dirk80

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871vn85gef.wl%anselm.helbig@gmx.de \
    --to=anselm.helbig+news2009@googlemail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.