From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Ben Forbes" Newsgroups: gmane.emacs.help Subject: Re: Running .emacs style commands within emacs Date: Wed, 21 May 2008 08:55:53 +1000 Message-ID: <206a409a0805201555t79fae7ege7a7309bfaae88bc@mail.gmail.com> References: <206a409a0805200019w17c9fa64oc3d11c652edb285@mail.gmail.com> <003101c8ba7f$400ac640$0200a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1211324194 20840 80.91.229.12 (20 May 2008 22:56:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 20 May 2008 22:56:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 21 00:57:11 2008 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 1Jyalb-0000Uw-8I for geh-help-gnu-emacs@m.gmane.org; Wed, 21 May 2008 00:57:11 +0200 Original-Received: from localhost ([127.0.0.1]:45432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jyakr-0006JQ-7A for geh-help-gnu-emacs@m.gmane.org; Tue, 20 May 2008 18:56:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JyakY-0006IV-O6 for help-gnu-emacs@gnu.org; Tue, 20 May 2008 18:56:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JyakY-0006I1-Bs for help-gnu-emacs@gnu.org; Tue, 20 May 2008 18:56:06 -0400 Original-Received: from [199.232.76.173] (port=44868 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JyakY-0006Hu-2U for help-gnu-emacs@gnu.org; Tue, 20 May 2008 18:56:06 -0400 Original-Received: from yw-out-1718.google.com ([74.125.46.155]:55538) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JyakX-0004P9-VN for help-gnu-emacs@gnu.org; Tue, 20 May 2008 18:56:06 -0400 Original-Received: by yw-out-1718.google.com with SMTP id 9so1524852ywk.66 for ; Tue, 20 May 2008 15:55:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=jdcJwOYD5KC8no9r8lnZenx+fcqHXjTUdSTKoMKsBM0=; b=VzorI0TgXpkmUqnKxAscSOIomxePcQK+JEXMA8Hc/ux2RXNHoPd73wApN9kMMTbfV3np4H9y0cqrL/mW9mGX2la6I6ResQyEkEz9NY1eoTs2fRRkrsm+hm/0kl4PTETxAKrjNaeZR71aZLtEUJfK672Tm5G+DibNzqaKurFu+lk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PjAWvNsw2UjmP9IJbnwMB3bqb9J6EkNx9DhQV1FjtiMxsH8Tf8XBSZqH+kOn83bJXXfBNC7KH5HoH80h3zP1j6NdVhRu4Lf//gy8xDoNVYtkQT1AbKQCj2Vt0UZKYUv0io9X8OM0frSTpKkL57woH4ATc6tmRJnCmigB3nx45Kw= Original-Received: by 10.150.11.2 with SMTP id 2mr8222510ybk.10.1211324153968; Tue, 20 May 2008 15:55:53 -0700 (PDT) Original-Received: by 10.150.181.5 with HTTP; Tue, 20 May 2008 15:55:53 -0700 (PDT) In-Reply-To: <003101c8ba7f$400ac640$0200a8c0@us.oracle.com> Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 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:54186 Archived-At: >C-M-x, with the cursor on the sexp somewhere, assuming you are in >emacs-lisp-mode. See node Lisp Eval of the Emacs manual. > You can evaluate any lisp expression at any time (even in non lisp buffers) by putting the cursor after the last parenthesis and issuing C-x C-e Thanks, both of those were what I was looking for. > P.S., use plain text, not HTML, for mail to this mailing list. Will do. Thanks, Ben Forbes -- On Tue, May 20, 2008 at 10:26 PM, B. T. Raven wrote: > > I don't understand. It seems to me that in this context "interactive" and "manual" are about the same thing. You can evaluate any lisp expression at any time (even in non lisp buffers) by putting the cursor after the last parenthesis and issuing C-x C-e. So make 'delete-whole-line a function rather than a macro. > > > Ben Forbes wrote: >> >> Actually what I meant was, I want to run lisp forms from within emacs. Eg, >> (global-set-key "\C-\M-z" 'delete-whole-line). There must be a Lisp engine >> running within Emacs that interprets this form when it is in the .emacs init >> file. Can I send lisp forms to this engine at any given time during an Emacs >> session? I know global-set-key can be run from M-x but it's interactive, I'd >> like to be able to enter the above form manually. >> >> ---------- Forwarded message ---------- >> From: B. T. Raven >> Date: Tue, May 20, 2008 at 2:32 PM >> Subject: Re: Running .emacs style commands within emacs >> To: help-gnu-emacs@gnu.org >> >> >> Ben Forbes wrote: >> >>> In my .emacs init file I have commands like >>> >>> (fset 'delete-whole-line "\C-a\C-k\C-k") >>> >>> >>> How can I run a command like this from within emacs? It doesn't seem to be >>> recognized when I try "M-x fset". >>> >>> >> >> This is just the expression generated when you save a macro. Try C-h f >> 'delete-whole-line and a *Help buffer will show this. You could shorten the >> macro name to 'dln and it would work the same. Try this and then invoke with >> M-x dln. So it's just go to beginning of line, kill line, kill newline. You >> can define keyboard macros and not save them if you need them for only one >> session. >> >> Ed >>