I am currently running R 3.3.1 in emacs 25.1.1, ESS 16.10, and polymode 20160805.448 installed via MELPA on Mac OS Sierra. Whenever I try to open an interactive R console using M-x R
, it freezes immediately upon startup and I have to force quit emacs.
The bottom bar says "ess-tracebug mode enabled" and the R console initially runs if(identical(getOption('pager'), file.path(R.home('bin'), 'pager'))).
My .emacs
file has the following code related to ESS:
;ESS mode configuration
(autoload 'R-mode "ess-site.el" "ESS" t)
(add-to-list 'auto-mode-alist '("\\.R$" . R-mode))
(setq inferior-R-program-name "/usr/local/bin/R")
;;R stuff
(setq ess-eval-visibly-p nil)
(setq ess-ask-for-ess-directory nil)
(require 'ess-eldoc)
;;compile the first target in the Makefile in the current directory using F9
(global-set-key [f9] 'compile)
(setq compilation-read-command nil)
(require 'poly-R) ;; Load polymode for Rmd and Rnw
(add-to-list 'auto-mode-alist '("\\.Snw" . poly-noweb+r-mode))
(add-to-list 'auto-mode-alist '("\\.Rnw" . poly-noweb+r-mode))
(add-to-list 'auto-mode-alist '("\\.Rmd" . poly-markdown+r-mode))
;; The following four lines set C-; to automatically add " -> " in ESS,
;; and causes _ to insert a normal underscore.
(setq ess-S-assign-key (kbd "C-;"))
(ess-toggle-S-assign-key t) ; enable above key definition
;; leave my underscore key alone!
(ess-toggle-underscore nil)
;; Map C-' to the pipe operator %>%
(defun then_R_operator ()
"R - %>% operator or 'then' pipe operator"
(interactive)
(just-one-space 1)
(insert "%>%")
(just-one-space 1))
(define-key ess-mode-map (kbd "C-'") 'then_R_operator)
(define-key inferior-ess-mode-map (kbd "C-'") 'then_R_operator)
EDIT: Also I'm not sure if this helps, but I copied a .emacs file from a computer with a functioning R mode to try to fix this issue and it still failed.
**EDIT 2: Completely copied over a .emacs
and a .emacs.d
from the same working computer. Upon startup, the first line on the frozen computer is if(identical(getOption('pager'), file.path(R.home('bin'), 'pager')))
, but on the original, working computer, it is:
if(identical(getOption('pager'), file.path(R.home('bin'), 'pager'))) # rather take the ESS one
+ options(pager='cat')
> options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient', show.error.locations=TRUE)
emacs -Q
)?M-x R
isn't enabled.init
file one by one from the top. Just the first one (that loads R) should be enough. Alternately, just evaluate(require 'ess-site)
.(require 'ess-site)
and tryingM-x R
froze with the same error as in the original post.