]> git.donarmstrong.com Git - lib.git/blob - emacs_el/configuration/ess_configuration.el
add ess configuration and remote eval
[lib.git] / emacs_el / configuration / ess_configuration.el
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: ")
4
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
12       '(lambda ()
13          (outline-minor-mode)
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)
19              (t 1000)))
20          ))
21 (add-hook 'ess-mode-hook
22           '(lambda ()
23              (local-set-key (kbd "C-c C-r")
24                             dla/ess-eval-region)))