0

I wish to M-x my-func and let my code run. This seems basic but where can I get more documentation about this, if possible inside emacs itself?

0

2 Answers 2

0

A simple example:

(defun hello-world () "Insert \"Hello World!\"." (interactive) (insert "Hello World!\n")) 
2

You need to distinguish between a common function and an interactive command. The latter is also a function, but with the addition of (interactive) to its body.

You can run the latter, but not the former, by binding commands to keys or calling them by name via M-x. See the elisp manual links above more more details.

2
  • 1
    tell me in more detail , what commands to use Commented Dec 31, 2019 at 21:18
  • @Minikute: your question asked about documentation, and this answer provided it. Please don't ask for documentation if you don't intend to read it. Commented Dec 31, 2019 at 21:35

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.