I simply want to execute the whole file I am editing right now in a small shell buffer just like I can run my python script. How can I do this?
Here you can find a function that will send current line to the shell buffer: https://stackoverflow.com/questions/6286579/emacs-shell-mode-how-to-send-region-to-shell/7053298#7053298
Here is an adapted version that uses
comint-scroll-to-bottom-on-output, so the shell buffer always scrolls to the last output:
A possible workaround would be to select the entire buffer (
C-x h) and then use the function to run a shell command on a region as explained on https://stackoverflow.com/questions/1871970/emacs-execute-code-in-shell-script-mode.
If I have a split window with the shell script on top and a session in bash below, it would indeed be nice to have a command to send the content of the upper buffer to the bash session and see the output without having to change to the buffer below.