Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: text editors


From   Philippe Glaziou <[email protected]>
To   [email protected]
Subject   Re: st: text editors
Date   Thu, 10 Apr 2003 09:06:35 +0700

Reka Sundaram-Stukel <[email protected]> wrote:
> >>Can you run a selection of a .do file from JEDIT (OS X).
> >>I tried getting EMACS to do this without success.
> >
> >Hmm... I've had reports that it is possible.  Under which
> >version of Emacs?  > Tony,
> 
> Emacs version 21.3.50.5 -- how does configure this to run
> selections of code?


You will need a recent ESS package (mine is v. 5.1.24-3) 
with emacs21.

I do not think that any specific configuration of ESS and
emacs is needed to run a selection of a do file.

In emacs21, the following command starts a Stata process 
in a new buffer:

   M-x Stata RET

You will be asked about your starting data directory, which
defaults to your current directory. You can configure ESS
not to ask and start right away (see the ESS info pages,
node "Starting the ESS process").

If the Stata buffer's display is not correct because emacs
does not deal very well with stata conren modes, type:

   . conren clear

You may then load your do file. I find it convenient to
split the window into two, with the Stata buffer in one and
the do file in the other.

Make your selection, keep the focus on the do file window,
and then:

   C-c C-r 

will evaluate the region.

One note: in my experience, evaluating a whole do file
buffer which ends with an -exit- statement tends to kill the
Stata process (unless the do file modified the data in
memory).

Hope this helps. I know that many statalist members have
much more expertise than me on the ESS modes.

-- 
Philippe 
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index