From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: Execute as a command a yanked text Date: Wed, 03 May 2006 11:56:19 +0200 Organization: Organization?!? Message-ID: <85mzdzo2ik.fsf@lola.goethe.zz> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1146652933 23495 80.91.229.2 (3 May 2006 10:42:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 3 May 2006 10:42:13 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 03 12:42:11 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FbEnz-0007Sh-ME for geh-help-gnu-emacs@m.gmane.org; Wed, 03 May 2006 12:42:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FbEnz-0001N6-3w for geh-help-gnu-emacs@m.gmane.org; Wed, 03 May 2006 06:42:03 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder3.cambrium.nl!feed.tweaknews.nl!195.14.215.230.MISMATCH!news.netcologne.de!nhp.netcologne.de!newsfeed.arcor.de!news.arcor.de!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:U+60RwTCeUjMlFCm6zQ+CTaJ0FA= Original-Lines: 47 Original-NNTP-Posting-Date: 03 May 2006 11:56:35 MEST Original-NNTP-Posting-Host: bfe46953.newsread4.arcor-online.net Original-X-Trace: DXC=KOTPo; NPk2d^O_h>VFi7[b:ejgIfPPlddjW\KbG]kaMh]kI_X=5KeafG7mOm5m[dBe1_LiI6ENVam3>5MOK`O=Rkj4kP3U_eY2l Original-X-Complaints-To: usenet-abuse@arcor.de Original-Xref: shelby.stanford.edu gnu.emacs.help:139144 Original-To: help-gnu-emacs@gnu.org 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:34767 Archived-At: Mathias Dahl writes: > Stefan Horomnea writes: > >> Do you have any idea how to execute a text that was previously killed ? >> I mean, I have a function named insert-html-table. >> >> This code works: >> (command-execute 'insert-html-table) >> >> This code doesn't work: >> (command-execute (car kill-ring-yank-pointer)) >> >> *and I have previously killed "insert-html-table" >> >> and, this also works (insert (car kill-ring-yank-pointer)) - and >> inserts the text: "insert-html-table". > > The problem seems to be that (car kill-ring-yank-pointer) returns a > *string*, not a symbol which `command-execute' needs. Maybe this > works (untested): > > (command-execute (make-symbol (car kill-ring-yank-pointer))) Won't work because make-symbol returns an uninterned symbol (which has the print name "insert-html-table", but not the meaning of the previously interned symbol with the same name): make-symbol is a built-in function in `C source code'. (make-symbol NAME) Return a newly allocated uninterned symbol whose name is NAME. Its value and function definition are void, and its property list is nil. Instead you need to use intern: intern is a built-in function in `C source code'. (intern STRING &optional OBARRAY) Return the canonical symbol whose name is STRING. If there is none, one is created by this function and returned. A second optional argument specifies the obarray to use; it defaults to the value of `obarray'. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum