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: Execute a string as a command Date: Sat, 07 Nov 2015 13:32:12 -0500 Organization: A noiseless patient Spider Message-ID: References: <20151106032357.GF3301@mail.akwebsoft.com> <87r3k3yea5.fsf@debian.uxu> <20151106040613.GH3301@mail.akwebsoft.com> <87h9kyn6li.fsf@debian.uxu> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1446921319 26458 80.91.229.3 (7 Nov 2015 18:35:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Nov 2015 18:35:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 07 19:35:19 2015 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 1Zv8Kc-0002O8-Dw for geh-help-gnu-emacs@m.gmane.org; Sat, 07 Nov 2015 19:35:18 +0100 Original-Received: from localhost ([::1]:44916 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zv8Kb-0001LA-Q2 for geh-help-gnu-emacs@m.gmane.org; Sat, 07 Nov 2015 13:35:17 -0500 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!barmar.motzarella.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Injection-Info: barmar.motzarella.org; posting-host="2be9e9f5dd9af768b8861af71b85fc28"; logging-data="13070"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19FmdFopQWkhYSTv3czFi3d" User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Cancel-Lock: sha1:6avDE8UY8MOswnemqqp0yDAN1W0= Original-Xref: usenet.stanford.edu gnu.emacs.help:215699 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:107985 Archived-At: In article , Tim Johnson wrote: > * Emanuel Berg [151106 12:47]: > > Tim Johnson writes: > > > > > I can't get to that phase for another day or two.. > > > thanks, Emanuel. > > > > No, there are much better things for you to do than to > > digest that code. For example, ask yourself why you > > want to execute strings as commands, and if there is > > a better way still. > > > > That code of mine is more like a demo to show of > > skills and attract ohs and ahs. It is not really > > helpful (tho sometimes I use it so it *does* work). > > By this time, you've probably read from the continuation of this > thread that I had problems with setting up the menu structure so > that command objects could be read from it. Thus I used a string > representation to see if that could be evaluated. The usual way to implement things like this is with an association list. The key is the string that's displayed in the menu, and the value is a symbol that names a function or a lambda expression. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***