1 (defun ess-change-directory (path)
2 "Set the current working directory to PATH for both *R* and Emacs."
3 (interactive "DDirectory to change to: ")
5 (when (file-exists-p path)
6 (ess-command (concat "setwd(\"" path "\")\n"))
7 ;; use file-name-as-directory to ensure it has trailing /
8 (setq default-directory (file-name-as-directory path))))
9 (add-hook 'ess-mode-hook 'flyspell-prog-mode)
10 ;;; outlining support for ess modes
11 (add-hook 'ess-mode-hook
14 (setq outline-regexp "\\(^#\\{4,5\\} \\)\\|\\(^[a-zA-Z0-9_\.]+ ?<- ?function\\)")
15 (defun outline-level ()
16 (cond ((looking-at "^##### ") 1)
17 ((looking-at "^#### ") 2)
18 ((looking-at "^[a-zA-Z0-9_\.]+ ?<- ?function(.*{") 3)
21 (add-hook 'ess-mode-hook
23 (local-set-key (kbd "C-c C-R")
24 'dla/ess-region-remote-eval)))