From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: Running .emacs style commands within emacs Date: Tue, 20 May 2008 07:26:58 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1211287254 8007 80.91.229.12 (20 May 2008 12:40:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 20 May 2008 12:40:54 +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 14:41:32 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 1JyR9a-0002eS-38 for geh-help-gnu-emacs@m.gmane.org; Tue, 20 May 2008 14:41:18 +0200 Original-Received: from localhost ([127.0.0.1]:38667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JyR8q-0000OD-0i for geh-help-gnu-emacs@m.gmane.org; Tue, 20 May 2008 08:40:32 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.sysmatrix.net!news.sysmatrix.net.POSTED!not-for-mail Original-NNTP-Posting-Date: Tue, 20 May 2008 07:26:41 -0500 User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) Original-Newsgroups: gnu.emacs.help In-Reply-To: Original-Lines: 43 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 65.45.140.29 Original-X-Trace: sv3-4XxmRsb/pza+X0nNgd1WbVwFTHHOmPc1j02txyNcpHa/FulSQZL4KdeGLqTeqB9aDuosF1sDaR25x5E!iUPpAxGc5lJQtQI7ZJWdnVmbGS1AYFqnzE0MM1Xr2iWCQZH0ZX1uj5AHXWClxVob2MxFzsKZH23Z!WLg2h1GMUMHON+SGoqPmThzt0KPnfw== Original-X-Complaints-To: abuse@sysmatrix.net X-DMCA-Complaints-To: abuse@sysmatrix.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.38 Original-Xref: news.stanford.edu gnu.emacs.help:158798 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:54165 Archived-At: 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 >