[ESS] Execute (ess-eval-buffer) when running emacs -batch
Bernd Weiss
bernd.weiss at uni-koeln.de
Fri Apr 13 18:15:27 CEST 2012
On 13.04.2012 16:43, Rodney Sparapani wrote:
> Vitalie Spinu wrote:
>> R asks for a directory on startup, may be this is what causing your hang.
>>
> Ah, that makes sense. I hate that so I have it turned off:
>
> (setq ess-ask-for-ess-directory nil)
>
Thanks, Vitalie & Rodney, but have turned it off too and it still
hangs... Below is the relevant part of my .emacs.
Thanks,
Bernd
----------------------------------------------------------------------------
;; ESS
(require 'ess-site)
;; (defun noweb-newline (&optional arg)
;; "A kludge to get round very odd behaviour of newline in quoted code."
;; (interactive "p")
;; (if arg (newline arg) (newline 1))
;; (noweb-indent-line))
;; prevents ESS of staying in -mark-mode
;; see: http://thread.gmane.org/gmane.emacs.ess.general/3087/focus=3091
(setq ess-eval-deactivate-mark t)
;;(setq inferior-R-program-name "d:/programme/R/bin/Rterm.exe")
;;; From "R Internals - R coding standards"
;;; ESS
(add-hook 'ess-mode-hook
(lambda ()
(ess-set-style 'C++ 'quiet)
;; Because
;; DEF GNU BSD K&R C++
;; ess-indent-level 2 2 8 5 4
;; ess-continued-statement-offset 2 2 8 5 4
;; ess-brace-offset 0 0 -8 -5 -4
;; ess-arg-function-offset 2 4 0 0 0
;; ess-expression-offset 4 2 8 5 4
;; ess-else-offset 0 0 0 0 0
;; ess-close-brace-offset 0 0 0 0 0
(add-hook 'local-write-file-hooks
(lambda ()
(ess-nuke-trailing-whitespace)))))
(setq ess-nuke-trailing-whitespace-p 'ask)
;; or even
;; (setq ess-nuke-trailing-whitespace-p t)
;;; Perl
(add-hook 'perl-mode-hook
(lambda () (setq perl-indent-level 4)))
;; source: http://www.emacswiki.org/emacs/CategoryESS
;;(setq ess-eval-visibly-p nil) ;otherwise C-c C-r (eval region) takes
forever
(setq ess-ask-for-ess-directory nil) ;otherwise you are prompted each
time you start an interactive R session
(require 'ess-eldoc) ;to show function arguments while you are typing them
;; source: http://www.emacswiki.org/emacs/ESSWindowsAdvice
;; Default Emacs does not scroll pages smoothly with down arrow key.
; It tries to jump a page-worth.
; See this for advice on preventing that
;
http://stackoverflow.com/questions/3631220/fix-to-get-smooth-scrolling-in-emacs
(setq redisplay-dont-pause t)
(setq scroll-conservatively 20)
(setq scroll-margin 2)
(setq scroll-preserve-screen-position 1)
(setq comint-scroll-to-bottom-on-input t)
(setq comint-scroll-to-bottom-on-output t)
(setq comint-move-point-for-output t)
(setq comint-scroll-show-maximum-output t)
(require 'ess-rutils)
(autoload 'ess-rdired "ess-rdired"
"View *R* objects in a dired-like buffer." t)
(setq ess-history-file nil)
More information about the ESS-help
mailing list