Set the other windows to R process
Sometimes when writing R code on an ess buffer I need to use a different R process. This is accomplished by using the ess-switch-process function. The problem is that I would like to also change the other-window to this new R session automatically as soon as I make the switch.
The following code accomplish this:
(defun set-other-to-ess-process() "set the other window to the R process associated to ess buffer" (interactive) (let* ( (cprocess ess-local-process-name) ) (progn (message "Associated buffer is %s" cprocess) (set-other-window-func (process-buffer (get-process cprocess))) ) ) ) (advice-add 'ess-switch-process :after #'set-other-to-ess-process)