[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Command in a function
From: |
Drew Adams |
Subject: |
RE: Command in a function |
Date: |
Wed, 24 Mar 2010 15:36:04 -0700 |
> I am writing a function that inserts some text into a buffer.
> At some point the cursor (point?) should go to the end of a line.
>
> For that I found the command "end-of-line". How do I code the
> execution of this command in a function?
> I tried it with (command-execute end-of-line) but that resulted in an
> error message.
Just use (end-of-line).
Or (end-of-line N), where N is the number of lines to first move forward or
backward.
In Emacs, a command is a function.
A function that has an `interactive' spec is a command. See the Elisp manual,
page `Using Interactive', if you want to make a function interactive (i.e. make
it a command, so you can bind it to a key or invoke it by name using `M-x').