[ESS] following setwd

Sebastian Luque spluque at gmail.com
Fri Jul 15 15:26:14 CEST 2005


Stephen Eglen <S.J.Eglen at damtp.cam.ac.uk> wrote:

[...]

> (defun ess-change-directory (path)
> "Set the current working directory to PATH for both *R* and Emacs."
> (interactive "DDirectory to change to: ")
>
> (when (file-exists-p path)
> (ess-command (concat "setwd(\"" path "\")\n"))
> ;; use file-name-as-directory to ensure it has trailing /
> (setq default-directory (file-name-as-directory path))))

Excellent, that does it. Thank you Thomas and Stephen.


-- 
Sebastian P. Luque




More information about the ESS-help mailing list