Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs: error wrong number of arguments when trying to call my function

Tags:

emacs

elisp

I'm trying to make a function that moves to the end of line and inserts a newline.

(defun newline-below ()
    (interactive)
    (move-end-of-line)
    (newline)
)

However, I get a cryptic error when I try to run it.

newline-below: Wrong number of arguments: #[(arg) "
like image 678
sighol Avatar asked Mar 06 '12 08:03

sighol


1 Answers

The function move-end-of-line needs an argument (try C-hf while the cursor is over the function). Just nil might work for your purpose:

(move-end-of-line nil)
like image 89
choroba Avatar answered Nov 15 '22 09:11

choroba