I am currently programming emacs. I have a function defined in my .emacs that saves all my work and the interpreter executes to start my work in the current open shell buffer. Usually I will edit one or more frames and open the shell in a separate frame. The problem is that when I run the save and execute function, everything is saved, but the shell buffer is then displayed in the frame that I am currently editing. Thus, I have two frames showing the shell buffer, and I do not see the source code that I just edited. Quite often, when I program, I would immediately like to compare the output of the code with the code that I just wrote. It is a bit annoying to switch back to my code buffer and then go to the end of another shell buffer to look at the output, referring to the code just written.
(defun execute-script () "Switch to shell buffer and re-execute the last command." (interactive) (save-some-buffers) (switch-to-buffer "*shell*") (end-of-buffer) (comint-previous-input 0) (comint-send-input))
As you can see, my function is currently quite primitive, just restarting the latest command in the shell.
I know that Emacs has the functionality to switch to the buffer in another frame, since the ido buffer switch code does this. Does anyone have any guidance on what I need to replace my call with a switch to a buffer in order to get the desired effect?
Regards Giles
source share