From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: Concat var names ? Date: Mon, 28 May 2012 00:26:37 -0400 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1338179420 3660 80.91.229.3 (28 May 2012 04:30:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 May 2012 04:30:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 28 06:30:19 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 1SYrax-0002nR-M1 for geh-help-gnu-emacs@m.gmane.org; Mon, 28 May 2012 06:30:15 +0200 Original-Received: from localhost ([::1]:49509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SYrax-0000fI-Bl for geh-help-gnu-emacs@m.gmane.org; Mon, 28 May 2012 00:30:15 -0400 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!news2.euro.net!newsfeed.freenet.ag!newsfeed.kamp.net!newsfeed.kamp.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 40 Injection-Info: barmar.motzarella.org; posting-host="ePtxJaRXJPFeIWBMlKfZaA"; logging-data="31586"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+xnTVkkyFsui2PkAo/BDF" User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Cancel-Lock: sha1:wfgrwEYJdYJld8RzRUgifWTk6ow= Original-Xref: usenet.stanford.edu gnu.emacs.help:192621 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:85027 Archived-At: In article , XeCycle wrote: > Philippe M. Coatmeur writes: > > > Hi ; I have those two functions and I want to make them one : > > > > (defun mail-bug-desktop-notify-one () > > (mapcar > > (lambda (x) > > (if (not (member x mail-bug-advertised-mails-one)) > > (progn > > (mail-bug-desktop-notification > > (format "%s" (first x)) > > (format "%s \n%s" (second x) > > (third x)) > > "5000" mail-bug-new-mail-icon-one) > > (add-to-list 'mail-bug-advertised-mails-one x)))) > > mail-bug-unseen-mails-one)) > > > > But I have to create distinct lists, so I'd really like to be able to > > say > > > > (setq suffix "plop") > > (setq myvar-plop "value") > > (message "%s" (concat "myvar-" suffix)) > > > > And get "myvar-value" instead of myvar-plop... > > Check what `intern' does. You also need to use symbol-value to get the value of the variable instead of just its name: (message "%s" (symbol-value (intern (concat "myvar-" suffix")))) -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***