[R-SIG-Mac] emacs/ess problems

Simon Urbanek simon.urbanek at r-project.org
Mon Jun 13 21:02:54 CEST 2005


Hi Federico,

On Jun 13, 2005, at 2:19 PM, Federico Calboli wrote:

> 1) can anyone give me detailed and OSX specific instructions on how  
> to get ess work please?

Ok, I assume you have working emacs - if you don't, well, that's  
another story, much longer one ;). I also assume that your have Xcode  
Tools installed.

Now copy/paste the following in Terminal:

cd
curl -O http://stat.ethz.ch/ESS/downloads/ess/ess-5.2.8.tar.gz
tar fvxz ess-5.2.8.tar.gz
rm -f ess
ln -s ess-5.2.8 ess
cd ess
make
cd
rm ess-5.2.8.tar.gz

Now, if you don't have an emacs config file or don't care to kill it  
you can copy/paste this:

cd
echo '(load "~/ess/lisp/ess-site")' > .emacs

If you do have one, just replace the > above with >>, but make sure  
you don't have other conflicting stuff there.

That should do the magic and you have ESS at your fingertips.

If you want to work with emacs, I personally recommend using the  
Carbon version and adding some more lines to .emacs that make your  
life much easier by making it behave as a Mac application (e.g.  
respecting <cmd><w>, <cmd><l> etc.). This is what I have in my .emacs:

(global-font-lock-mode 1)

(set-face-font 'default "-apple-monaco-medium-r-normal--10-100-75-75- 
m-100-mac-roman")
;; remap backspace on keyboard to be sane
;;
(keyboard-translate ?\C-h ?\C-?)

;;; MacOS X specific stuff
(setq mac-command-key-is-meta nil)

;; Define the return key to avoid problems on MacOS X
(define-key function-key-map [return] [13])

(global-set-key [(alt a)] 'mark-whole-buffer)
(global-set-key [(alt v)] 'yank)
(global-set-key [(alt c)] 'kill-ring-save)
(global-set-key [(alt x)] 'kill-region)
(global-set-key [(alt s)] 'save-buffer)
(global-set-key [(alt l)] 'goto-line)
(global-set-key [(alt o)] 'find-file)
(global-set-key [(alt f)] 'isearch-forward)
(global-set-key [(alt g)] 'isearch-repeat-forward)
(global-set-key [(alt w)]
                 (lambda () (interactive) (kill-buffer (current- 
buffer))))
(global-set-key [(alt .)] 'keyboard-quit)

(global-set-key [(alt q)] 'save-buffers-kill-emacs)


> 2) if anyone knows an OSX native editor that is sintax aware for R/ 
> C/Python, let me know. As I said, always stuck with emacs, but I'd  
> love to drop it forever.

Personally I use Xcode for everything (it has C[.*]/Java/Python  
support) except for R files (well, that's why I wrote that R editor  
for the R-GUI ;)) and emacs for .Rd files. However, I'm told that  
SubEthaEdit is a quite good and has a plenty of syntax-aware modules,  
but I never used it myself.

Cheers,
Simon



More information about the R-SIG-Mac mailing list