help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Execute a string as a command


From: Barry Margolin
Subject: Re: Execute a string as a command
Date: Thu, 05 Nov 2015 22:36:42 -0500
User-agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)

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))

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


reply via email to

[Prev in Thread] Current Thread [Next in Thread]