1

Why some functions in simple.el are invokable with M-x and some others aren't?
For example I can do M-x what-line but I can't do M-x line-number-at-pos.

3

1 Answer 1

1

Only functions which are declared to be interactive are callable with M-x. The declaration is done by putting an (interactive) form as the first thing in the body of the function. Like this:

(defun an-example () "this is an example function" (interactive) (insert "42")) 

There is a lot of other information you should know about interactive functions, so you should type C-h f and enter interactive to see more help for it.

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.