From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mortimer Cladwell Newsgroups: gmane.emacs.help Subject: Re:Re: widget-create 'menu-choice Date: Thu, 24 Sep 2009 09:13:14 -0700 (PDT) Message-ID: <87177.14397.qm@web111605.mail.gq1.yahoo.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1340490234-1253808794=:14397" X-Trace: ger.gmane.org 1253808842 27143 80.91.229.12 (24 Sep 2009 16:14:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Sep 2009 16:14:02 +0000 (UTC) To: kevin.d.rodgers@gmail.com, help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 24 18:13:54 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mqqx7-0002rP-3b for geh-help-gnu-emacs@m.gmane.org; Thu, 24 Sep 2009 18:13:53 +0200 Original-Received: from localhost ([127.0.0.1]:40063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mqqx6-0004oj-HG for geh-help-gnu-emacs@m.gmane.org; Thu, 24 Sep 2009 12:13:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mqqwe-0004oW-0U for help-gnu-emacs@gnu.org; Thu, 24 Sep 2009 12:13:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqqwY-0004o6-Sr for help-gnu-emacs@gnu.org; Thu, 24 Sep 2009 12:13:23 -0400 Original-Received: from [199.232.76.173] (port=53355 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqqwY-0004o3-P4 for help-gnu-emacs@gnu.org; Thu, 24 Sep 2009 12:13:18 -0400 Original-Received: from n14.bullet.mail.mud.yahoo.com ([68.142.206.41]:42997) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MqqwY-0007Qv-CU for help-gnu-emacs@gnu.org; Thu, 24 Sep 2009 12:13:18 -0400 Original-Received: from [209.191.108.97] by n14.bullet.mail.mud.yahoo.com with NNFMP; 24 Sep 2009 16:13:16 -0000 Original-Received: from [68.142.201.72] by t4.bullet.mud.yahoo.com with NNFMP; 24 Sep 2009 16:13:16 -0000 Original-Received: from [127.0.0.1] by omp424.mail.mud.yahoo.com with NNFMP; 24 Sep 2009 16:13:16 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 1698.9777.bm@omp424.mail.mud.yahoo.com Original-Received: (qmail 15186 invoked by uid 60001); 24 Sep 2009 16:13:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1253808795; bh=Je0RTGhtIEFyYnvDPhfUaQzJWIfCHOfOpQpAwfozJLM=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=yehOZPhGwAw9R5iiCtPuG3k91P7Q6+uIGP0bFSbtFsCM/DFYXtaP+MoH85gRvYRnozrH1RwZlZpNXnawMTJhjGhDXYEk3Nel00brkZ0HBxPFbJtzTjS4AiajeopQxi+PUvtZbYE58VRIva7+EMb+8kSB93aJ+cykgZ473wduo7I= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=vpjknEX7kBsr4SV7THJabqroUUP32XFYEvdDlKSQ/0oBBDsDnjidUCrPQ9JnRLHvDQ/CKgm1U1frTespBUr4Waucm9+XWd1kXJe1/lXw45xqHpXxP2/l/qYC/O7nX3REc6rHA1O8uSkpiFVq3l1lKCDLpsITUrNhkyBbyY/zQD0=; X-YMail-OSG: ZKBG60gVM1mEs7BI9IZ.Dx01qIvr.AJc2s9TCLalwsDIyGesbPvENj7dpSQgMwH09cTaeYIoa7YToBtGdP36PAI.If_G1.cmBXh66Uy_Nqi1P1JT5w9FpQtNsdUkvjBmm.RgwtTnpr0RwwADzML9EcVu.BdGLaBMAmN6D8gk5oOCe6Dk592VSjGHioydGmtr4uHL8qZlaxSC3Ny0VUs- Original-Received: from [155.94.110.223] by web111605.mail.gq1.yahoo.com via HTTP; Thu, 24 Sep 2009 09:13:14 PDT X-Mailer: YahooMailRC/157.18 YahooMailWebService/0.7.347.2 X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:68445 Archived-At: --0-1340490234-1253808794=:14397 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Your suggestion evaluates to:=0A=0A((item "human") (item "rat") (item "mous= e"))=0A=0Awhich when inserted into a form results in the error:=0A=0Awidget= -create: Invalid function: (item "human")=0A=0AEvaluations that would work = are:=0A=0A'(item "human") '(item "rat") '(item "mouse")=0AOR =0A=0A(quote (= item "human"))=A0 (quote (item "rat")) (quote (item "mouse"))=0A=0ANote tha= t there are no enclosing parenthesis around the list.=0AThanks=0AMortimer--= ---------------------------------------------------------------=0A=0AMortim= er Cladwell wrote: =0AHi,=0A>I would like to dynamically populate a dropdow= n widget from a database. the 'menu-choice widget looks like=0A>(widget-cre= ate 'menu-choice=0A>:tag "Select Host Species"=0A>:value "unknown"=0A>:noti= fy (lambda (widget &rest ignore)=0A>(setq host-species (widget-value widget= )))=0A>'(item "human")=0A>'(item "rat")=0A>'(item "mouse"))=0A>Suppose I ca= n generate a list '( "human "rat" "mouse") from the database. How to create= =0A>'(item "human")=0A>'(item "rat")=0A>'(item "mouse")=0A>on the fly? The = closest I can come is=0A>(progn=0A>(setq var '( "human" "rat" "mouse"))=0A>= (mapcar '(lambda (a) `'(item ,a)) var)=0A>) =0A=0Ai.e.=0A=0A(let ((var '("h= uman" "rat" "mouse")))=0A (mapcar (lambda (label) (list 'item label))=0A = var))=0A=0A--=0AKevin Rodgers=0ADenver, Colorado, USA=0A=0A=0A = --0-1340490234-1253808794=:14397 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
=0A
=0A
Your suggestion evaluates to:=0A
 
=0A
((item "human") (item "rat") (item "mouse"))<= /DIV>=0A
 
=0A
which when inserted into a form results in= the error:
=0A
 
=0A
widget-create: Invalid functio= n: (item "human")
=0A
 
=0A
Evaluations that would work are:
=0A
=  
=0A
'(item "human") '(item "rat") '(item "mouse")
=0A<= DIV>OR
=0A

(quote (item "human"))  (quote (item "rat")) = (quote (item "mouse"))
=0A

Note that there are no enclosing pa= renthesis around the list.
=0A
Thanks
=0A
Mortimer
-----------------= ------------------------------------------------
=0A
=0AMortimer Cladwell wrote: =0AHi,
I would like to dynamically populate a dropdown widget from = a database. the 'menu-choice widget looks like
(widget-create 'menu-choi= ce
:tag "Select Host Species"
:value "unknown"
:notify (lambda (wi= dget &rest ignore)
(setq host-species (widget-value widget)))
'(i= tem "human")
'(item "rat")
'(item "mouse"))
Suppose I can generate= a list '( "human "rat" "mouse") from the database. How to create
'(item= "human")
'(item "rat")
'(item "mouse")
on the fly? The closest I = can come is
(progn
(setq var '( "human" "rat" "mouse"))
(mapcar '(= lambda (a) `'(item ,a)) var)
)

i.e.

(let ((var '("human" "rat"=
 "mouse")))=0A  (mapcar (lambda (label) (list 'item label))=0A          var=
))

--=0AKevin Rodgers=0ADenver, Colorad=
o, USA

=0A=0A --0-1340490234-1253808794=:14397--