I have the following function defined in my dot-Emacs:
(defun call-shell-refresh-browser ()
;; When pressing 'sf', save the content and refresh the browser
(interactive)
(save-buffer)
(shell-command "python ~/Dropbox/Sys/Linux/chrome-refresh-back-emacs.py")))
It saves the buffer in Emacs, then switching to Chrome, reload the webpage and gets back to Emacs. This worked like a charm.
Until now, I use TRAMP to edit files on a remote machine. When I save it, and call the function call-shell-refresh-browser
, it looks in the remote shell for the script chrome-refresh-back-emacs.py
which don't exists on the remote machine.
How could I tell Emacs/Tramp to switch to the local shell on my machine, when editing a remote file? This is without terminating the current TRAMP session.