I split the emacs into 2 windows, one window is used to edit the python code, say test.py, and another shell window to run shell command "python test.py", so each time after I edit the python, I need to 1: save the buffer 2: switch from python window to shell window 3: run the last command in shell window 4: switch back to python window to edit again
That's boring, so I used the following code to automate the process,
(defun run-shell-command-again ()
(interactive)
(save-buffer (buffer-name))
(other-window)
(comint-previous-input)
(other-window))
But when I run the command using M-x run-shell-command-again in the python window, it throws wierd message as below:
run-shell-command-again: Wrong number of arguments: #[(count &optional all-frames)