unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: help-gnu-emacs@gnu.org
Subject: Re: What is the :eval form ?
Date: Fri, 08 Jun 2012 20:08:29 +0200	[thread overview]
Message-ID: <878vfx65ia.fsf@thinkpad.tsdh.de> (raw)
In-Reply-To: lzvcj1tzqd.wl%philippe.coatmeur@gmail.com

Philippe M. Coatmeur <philippe.coatmeur@gmail.com> writes:

Hi Philippe,

> BTW what I'm trying to do is to use a variable to pass the ("2" in the
> example) argument to the function, to use it in a loop, like this :
>
>   (loop for i from 1 to 3 do
> 	(add-to-list 'global-mode-string
> 		     '(:eval (mail-bug-mode-line-all (format "%s" i)))))
>
> but i's value is always stuck at 1 :(

Not sure what you are trying to do, but since you quote (') the :eval
form, what's actually added to the `global-mode-string' list is
literally

  (:eval (mail-bug-mode-line-all (format "%s" i)))

with i not substituted with 1, 2, or 3.  And since `add-to-list' only
adds if that elements is not included already, you end up with exactly
one occurence.

I guess, you want this:

   (loop for i from 1 to 3 do
 	(add-to-list 'global-mode-string
 		     `(:eval (mail-bug-mode-line-all (format "%s" ,i)))))

Bye,
Tassilo




  parent reply	other threads:[~2012-06-08 18:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-08 18:39 What is the :eval form ? Philippe M. Coatmeur
2012-06-08 17:56 ` Eli Zaretskii
2012-06-08 18:01 ` Drew Adams
2012-06-08 18:02 ` Tassilo Horn
2012-06-09  6:40   ` Richard Riley
2012-06-09  8:34     ` Thien-Thi Nguyen
2012-06-09 14:08     ` Drew Adams
2012-06-08 18:08 ` Tassilo Horn [this message]
2012-06-08 18:10 ` Drew Adams
2012-06-08 18:21 ` Barry Margolin
     [not found] ` <mailman.2446.1339178928.855.help-gnu-emacs@gnu.org>
2012-06-08 19:19   ` Philippe M. Coatmeur

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=878vfx65ia.fsf@thinkpad.tsdh.de \
    --to=tassilo@member.fsf.org \
    --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.
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).