Timeline for Why can't I bind my function to a key or call it with M-x?
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 22, 2018 at 15:12 | comment | added | Tyler | Thanks for your comments, @jrh. This question & answer are addressing a particular aspect of elisp, how to make a function interactive (i.e., turn function into a command). You're asking about more fundamental aspects of elisp, and are beyond the scope of this question. I recommend working through the the Emacs Lisp Intro. You seem to be confused about the difference between evaluating a function definition, which (re-)defines a function but doesn't actually call it, and calling the function, which runs the function code. | |
Oct 21, 2018 at 18:44 | comment | added | jrh |
It would appear that C-x C-e evaluates the buffer, it seems that the result of evaluating a buffer containing a defun is registering the function, though this article seems to make me think that it should just run the function, and yet the only thing shown in the minibuffer is my-function (implying it returns the function?), not This is a great function . I must be missing something here.
|
|
Oct 21, 2018 at 18:31 | comment | added | jrh |
one suggestion I'd like to add, make it clear that you need to do C-x C-e before doing M-x my-function in your example. Also as an emacs beginner I'm really not 100% clear yet on what exactly C-x C-e does or when you need to run it, but it appears that uh... when you run it, it parses the buffer and overwrites my-function in memory because if I don't run C-x C-e M-x runs the function from the last time I ran C-x C-e
|
|
Oct 16, 2018 at 20:53 | history | edited | Tyler | CC BY-SA 4.0 |
added 803 characters in body
|
Oct 16, 2018 at 14:36 | history | edited | Dan♦ | CC BY-SA 4.0 |
add link to another question
|
Oct 16, 2018 at 13:46 | history | answered | Tyler | CC BY-SA 4.0 |