From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: What is the :eval form ? Date: Fri, 08 Jun 2012 20:08:29 +0200 Message-ID: <878vfx65ia.fsf@thinkpad.tsdh.de> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1339178943 14466 80.91.229.3 (8 Jun 2012 18:09:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 8 Jun 2012 18:09:03 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 08 20:09:02 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sd3cM-0006Ax-0u for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Jun 2012 20:09:02 +0200 Original-Received: from localhost ([::1]:54891 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sd3cL-0006z8-OM for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Jun 2012 14:09:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sd3c5-0006Nz-3a for help-gnu-emacs@gnu.org; Fri, 08 Jun 2012 14:08:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sd3c3-0006su-5M for help-gnu-emacs@gnu.org; Fri, 08 Jun 2012 14:08:44 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:48817) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sd3c2-0006sT-Ug for help-gnu-emacs@gnu.org; Fri, 08 Jun 2012 14:08:43 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Sd3bx-0005aW-Il for help-gnu-emacs@gnu.org; Fri, 08 Jun 2012 20:08:37 +0200 Original-Received: from 91-67-9-216-dynip.superkabel.de ([91.67.9.216]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Jun 2012 20:08:37 +0200 Original-Received: from tassilo by 91-67-9-216-dynip.superkabel.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Jun 2012 20:08:37 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 91-67-9-216-dynip.superkabel.de User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.0.97 (gnu/linux) Cancel-Lock: sha1:wQdrCHjSkEegpfcVDrzbmE1Ubq0= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85163 Archived-At: Philippe M. Coatmeur 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