Home » Questions » Computers [ Ask a new question ]

Using emacs interactive functions on gnu emacs, mac os x

Using emacs interactive functions on gnu emacs, mac os x

For some reason, emacs functions which use the interactive form don't work for me on Mac OS x. The emacs I am using is from emacsformacosx.com, which up until now has worked flawlessly. An example of such a function that uses interactive (taken from here) is:

Asked by: Guest | Views: 322
Total answers/comments: 1
Guest [Entry]

"I am a little worried by:

I run it in scratch with C-x C-e

This does not run the function, it just evaluates it. To call the function you can evaluate:

(multiply-by-seven 10)
=> ""The result is 70""

with C-x C-e or call it interactivly:

M-x multiply-by-seven
=> ""The result is 7""

and call it with an argument

C-u M-x multiply-by-seven
=> ""The result is 28""

or

C-u 7 M-x multiply-by-seven
=> ""The result is 49""

as (interactive ""p"") uses the numeric prefix argument, Emacs Manual"