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

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

Re: Running .emacs style commands within emacs


From: Ben Forbes
Subject: Re: Running .emacs style commands within emacs
Date: Wed, 21 May 2008 08:55:53 +1000

>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 <address@hidden> 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 <address@hidden>
>> Date: Tue, May 20, 2008 at 2:32 PM
>> Subject: Re: Running .emacs style commands within emacs
>> To: address@hidden
>>
>>
>> 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
>>




reply via email to

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