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: Tue, 20 May 2008 17:19:38 +1000 Message-ID: <206a409a0805200019w17c9fa64oc3d11c652edb285@mail.gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_30_13452099.1211267978790" X-Trace: ger.gmane.org 1211284702 31165 80.91.229.12 (20 May 2008 11:58:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 20 May 2008 11:58:22 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 20 13:58:55 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 1JyQUS-0003s7-RU for geh-help-gnu-emacs@m.gmane.org; Tue, 20 May 2008 13:58:49 +0200 Original-Received: from localhost ([127.0.0.1]:40380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JyQTi-00081N-Ju for geh-help-gnu-emacs@m.gmane.org; Tue, 20 May 2008 07:58:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JyM8N-00059T-Dr for help-gnu-emacs@gnu.org; Tue, 20 May 2008 03:19:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JyM8L-00058c-Gx for help-gnu-emacs@gnu.org; Tue, 20 May 2008 03:19:41 -0400 Original-Received: from [199.232.76.173] (port=45823 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JyM8L-00058W-96 for help-gnu-emacs@gnu.org; Tue, 20 May 2008 03:19:41 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:45021) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JyM8K-00036l-PW for help-gnu-emacs@gnu.org; Tue, 20 May 2008 03:19:41 -0400 Original-Received: from yw-out-1718.google.com ([74.125.46.158]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JyM8K-0002LL-0e for help-gnu-emacs@gnu.org; Tue, 20 May 2008 03:19:40 -0400 Original-Received: by yw-out-1718.google.com with SMTP id 9so1327183ywk.66 for ; Tue, 20 May 2008 00:19:38 -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:references; bh=l4/gd6XoQ3XqiZ0BWmwaCIKA13MHKVonirHKKtukvN8=; b=H8LH8kW4w9tO8zA5AlDYbY1SkoEU+w1z2KVk5jReC2z3hmugkvZrcxnk3zgClwSGNLkxd2bFW+S8BeRn7pvIlpm+KrgQQyu8eS0pEw0BXRXwHYJpvRT1dHlOeX2Y9ARe0KqYhDm0oX/GrdY7n9iX0wxOv9Wy53Ko/yP9M3fITtg= 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:references; b=r5Hq7kL3eiInE1SGnopKo6WSk4YnHdmcFp0+FAzQ7EeyA/sYBT+daVTEEMqIXXhOy70VaSocBFrfDtTXzx1w12iOcH/NrXwEpA4+bB1+6t3TO/ZroXzQalEh3rAXaDdHzdfYvQW7Yzxr9vPk5noQteNpUx2RTWVeyWQKofrVs6g= Original-Received: by 10.150.52.2 with SMTP id z2mr7251555ybz.44.1211267978781; Tue, 20 May 2008 00:19:38 -0700 (PDT) Original-Received: by 10.150.181.5 with HTTP; Tue, 20 May 2008 00:19:38 -0700 (PDT) In-Reply-To: X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 2) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Tue, 20 May 2008 07:56:50 -0400 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:54161 Archived-At: ------=_Part_30_13452099.1211267978790 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 ------=_Part_30_13452099.1211267978790 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 <nihil@nihilo.net>
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

------=_Part_30_13452099.1211267978790--