From: "Ben Forbes" <bdforbes@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Running .emacs style commands within emacs
Date: Wed, 21 May 2008 08:55:53 +1000 [thread overview]
Message-ID: <206a409a0805201555t79fae7ege7a7309bfaae88bc@mail.gmail.com> (raw)
In-Reply-To: <003101c8ba7f$400ac640$0200a8c0@us.oracle.com>
>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 <nihil@nihilo.net> 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 <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
>>
next prev parent reply other threads:[~2008-05-20 22:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.11862.1211250760.18990.help-gnu-emacs@gnu.org>
2008-05-20 4:32 ` Running .emacs style commands within emacs B. T. Raven
2008-05-20 7:19 ` Ben Forbes
2008-05-20 13:41 ` Drew Adams
2008-05-20 22:55 ` Ben Forbes [this message]
[not found] ` <mailman.11880.1211284612.18990.help-gnu-emacs@gnu.org>
2008-05-20 12:26 ` B. T. Raven
2008-05-21 8:58 ` Tim X
2008-05-21 13:28 ` Joel J. Adamson
2008-05-20 18:05 ` james
2008-05-19 23:51 Ben Forbes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=206a409a0805201555t79fae7ege7a7309bfaae88bc@mail.gmail.com \
--to=bdforbes@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).