[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Execute a string as a command
From: |
Tim Johnson |
Subject: |
Re: Execute a string as a command |
Date: |
Thu, 5 Nov 2015 18:59:22 -0900 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
* Barry Margolin <barmar@alum.mit.edu> [151105 18:51]:
> In article <mailman.1811.1446780244.7904.help-gnu-emacs@gnu.org>,
> Tim Johnson <tim@akwebsoft.com> wrote:
>
> > Example : A string has the value of :
> > "toggle-truncate-lines"
> >
> > (setq string-wants-to-be-a-command "toggle-truncate-lines")
> >
> > How may I convert 'string-wants-to-be-a-command to a command:
> > I.E. => (toggle-truncate-lines) to be used programmatically?
> >
> > thanks
>
> (call-interactively (intern string-wants-to-be-a-command))
That's exactly what I was looking for. I knew about 'intern, but
had tried eval, make-symbol and others to no evail.
thanks very much.
--
Tim
http://www.akwebsoft.com, http://www.tj49.com
- Re: Execute a string as a command, (continued)
Re: Execute a string as a command, Random832, 2015/11/05
Re: Execute a string as a command, Barry Margolin, 2015/11/05