I am trying to create a command that will indent a selected region by 4 spaces.
The appropriate commands are: C-u 4 C-x <TAB>, when C-u is a shortcut for "universal-argument" command and C-x <TAB> is a shortcut for indent-rigidly, so I've written this function:
(defun my-tab ()
(interactive)
(universal-argument 4)
(indent-rigidly))
But when I'm trying to run the function (with M-x my-tab) I get this error:
Wrong number of arguments: (0 . 0), 1
What is the problem?
Thanks!
F3to start recording, type the keys in question, hitF4to stop recording the macro, and then name and save the macro in your.emacsfile.indent-rigidly. Then useC-h fto look at its doc and see just what that function expects as arguments. Emacs really tries to give you all the help you need to fix the problem. But you have to look at what it tells you - in this case, the function name.