[R] emacs, Mac OS X, R

Martin Maechler maechler at stat.math.ethz.ch
Tue Sep 28 10:54:57 CEST 2004


Redirected to ESS-help,
this has become an ESS/Emacs topic much more than an R one.
{Please drop R-help entirely if you reply to this! MM}

>>>>> "Meinhard" == Meinhard Ploner <meinhardploner at gmx.net>
>>>>>     on Mon, 27 Sep 2004 11:27:34 +0200 writes:

    Meinhard> On Sep 24, 2004, at 5:53 PM, Bill Rising wrote:

    >> On Sep 24, 2004, at 10:05, Meinhard Ploner wrote:
    >> 
    >>> Hi!
    >>> 
    >>> Since August I am using emacs on my Macintosh to edit
    >>> the R objects.  I have installed R 1.9.1, Mac OS X
    >>> 10.3.5 and GNU Emacs 21.2.1.  However there are some
    >>> issues I haven't resolved:
    >>> 
    >>> a) switch the caps lock key to the meta key (and when
    >>> this is not possible, switch the alt/option key to the
    >>> meta).
    >>  You can use only the command or option key for the meta
    >> key. To see the method, try looking at
    >> 
    >> http://members.shaw.ca/akochoi-emacs/stories/faq.html
    >> 
    >>> The switch should work only within emacs!
    >>> 
    >>> b) having different colors for the code, i.e. comments,
    >>> commands, strings, ...
    >>  I'd advise using ESS, whose home page is
    >> 
    >> http://stat.ethz.ch/ESS/

    Meinhard> after installing ESS 5.2.3 I called emacs and
    Meinhard> within emacs M-x R and I get the following:

    >> options(STERM='iESS', editor='emacsclient')
    >> 
    >> fix(fun1)

    Meinhard> emacsclient: can't find socket; have you started
    Meinhard> the server?

If you want to use the emacsclient, you need to start its server
(as the above question suggests!):
    M-x server-start

If you need this often, add it to your auto-initialization.
We have something like

	(if (not xemacs-p)
	    (server-start nil))

wrapped inside an 
  (add-hook
    'inferior-ess-mode-hook
    '(lambda()
    ..... 
  ))
clause, but you can do it unconditionally.

    Meinhard>   Error in edit(name, file, editor) :
    Meinhard> problem with running editor emacsclient
    >>

    Meinhard> What did I wrong?

using fix() at all :-)

Reall don't work with fix() once ``you've seen the light'' of ESS.
We strongly advocate using source files everywhere - something
which is particularly easy with ESS.
A compromise {between fix() and real source files} would be to
use  C-c C-d  {dump R object to file and start editing that file}

Martin Maechler, ETH Zurich




More information about the ESS-help mailing list