Skip to content

emacs/ess problems

3 messages · Federico Calboli, Don MacQueen, Simon Urbanek

#
Hi everybody,

I am having problems getting ess running with emacs... I got the  
latest ess, untarred it, read the readmes... edited my .emacs file  
end nothing works... Mind you, I _never_ got the blasted thing to  
work in any Unix I worked on, with the sole exception of Debian (but  
apt get emacs and ess talk to each other there).

To be honest if I can drop emacs from my life altogether I won't shed  
a tear, but in any case I'd like to ask the list:

1) can anyone give me detailed and OSX specific instructions on how  
to get ess work please?
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.

BTW, I am not sending any of my config files because they are  
obviously wrong, or things would work...

Cheers,

Federico

--
Federico C. F. Calboli
Department of Epidemiology and Public Health
Imperial College, St. Mary's Campus
Norfolk Place, London W2 1PG

Tel +44 (0)20 75941602   Fax +44 (0)20 75943193

f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com
#
I'm sorry you are having trouble. I have had very little trouble -- 
but I admit to using ESS only for syntax assistance.

In my home directory, I have a .emacs file. In it is this line:

(load "/erd/statistic/apps/R/ESS/ess-5.2.4/lisp/ess-site")

The first part of the path, /erd/statistic/apps/R/ESS, is a directory 
I created. It could be anything you want.
In that directory I put the ESS distribution file, i.e., 
ess-5.2.4.tar.gz, and unpacked it. This created the directory 
ess-5.2.4 and all of its subdirectories.

I believe that is *all* I have done.

I can use Emacs within an X Windows context (I've chosen to install 
this version of emacs using fink), or a Aqua-GUI version of Emacs 
that I downloaded from somewhere. Both of them recognize my ~/.emacs 
file and load ESS when I open a file with an appropriate suffix.

This same method works for me on both Solaris and OS X. In fact, the 
directory actually resides on a Solaris box and is automounted on my 
OS X box. Emacs loads ESS from the exact same set of ESS files, 
regardless of which host I login to. I don't do anything different on 
OS X than on Solaris, to make ESS available.

-Don
At 7:19 PM +0100 6/13/05, Federico Calboli wrote:

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

            
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)
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