unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* using find-image with picture name stored in a variable
@ 2009-08-18 20:28 Dirk80
  0 siblings, 0 replies; 3+ messages in thread
From: Dirk80 @ 2009-08-18 20:28 UTC (permalink / raw)
  To: Help-gnu-emacs


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)))

Thank you for your help.

Greetings,
Dirk
-- 
View this message in context: http://www.nabble.com/using-find-image-with-picture-name-stored-in-a-variable-tp25032884p25032884.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: using find-image with picture name stored in a variable
       [not found] <mailman.4854.1250627340.2239.help-gnu-emacs@gnu.org>
@ 2009-08-18 20:42 ` A.Politz
  2009-08-19  8:58   ` Anselm Helbig
  0 siblings, 1 reply; 3+ messages in thread
From: A.Politz @ 2009-08-18 20:42 UTC (permalink / raw)
  To: help-gnu-emacs

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
>
> Thank you for your help.
>
> Greetings,
> Dirk
> --
> View this message in context:http://www.nabble.com/using-find-image-with-picture-name-stored-in-a-...
> Sent from the Emacs - Help mailing list archive at Nabble.com.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: using find-image with picture name stored in a variable
  2009-08-18 20:42 ` using find-image with picture name stored in a variable A.Politz
@ 2009-08-19  8:58   ` Anselm Helbig
  0 siblings, 0 replies; 3+ messages in thread
From: Anselm Helbig @ 2009-08-19  8:58 UTC (permalink / raw)
  To: help-gnu-emacs

[-- 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-08-19  8:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
2009-08-18 20:28 Dirk80

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).