Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Stata and Emacs interactively


From   Neil Shephard <nshephard@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Stata and Emacs interactively
Date   Wed, 20 Oct 2010 12:00:24 +0000

On Wed, Oct 20, 2010 at 11:38 AM, Ulrich Kohler <kohler@wzb.eu> wrote:
>
> Yes, but in Bill Rising's Ado mode I can run a command like this
>
> graph twoway ///
>  || scatter this that ///
>     , with options here and there
>  || lowess this that ///
>     , even some more options
>  || if exp ///
>  , and finally the tw-options
>
>
> directly by just putting the cursor on the command and hit M-Return.
> However this works only in Windows and Mac. As a Linux-User I would love
> to have this too.

Development of Stata support under ESS has been virtually non-existant
for some time now (at least as far as I'm aware from being on ESS-help
mailing list for a number of years), but if there is code in LISP for
sending commands from Emacs to Stata under OSX and M$-Win
(ado-to-stata.el and ado-to-stata.elc) then it shouldn't be too hard
to adapt these to work under *NIX (after all OSX isn't that distant a
cousin of *NIX systems being based on BSD).

Out of curiosity I did a quick bit of poking around.  I've no
experience of progamming LISP, but looking at the relevant .el and
.elc files indicates that the work is being done by two "scripts" that
Bill includes (ado2stata.scpt for OSX and ado2stata.exe for
M$-Win,neither of which appear to be scripts in the traditional sense,
they look more like executable binaries).  Also in the scripts/
sub-directory is scripts/send2stata.au3 which is a text-based script
and can be read for clues as to whats being done by these scripts
(which from the header of the file is copying the highlighted section
to the clipboard and then sending it to Stata).

Now I'm not massively familiar with the intricacies of clipboards
under *NIX systems, but a problem arises as 'clipboards' are provided
by desktop environments (DE)/window managers (i.e.
KDE/GNOME/Xfce4/IceWM/Fluxbox/etc/.) and therefore differ slightly
depending on which DE you are using.  What should be constant
regardless of the DE being used is the buffer ring that highlighting
and copying text with the mouse uses.

Thus my approach (if I had the time to work on this) would be to
investigate how to send highlighted text in Emacs to this buffer and
then paste it into Stata, and then write a bash-script under
scripts/ado2stata.sh and have ado-tostata.el[c] call this if being
invoked on a *NIX like system.

Of course none of this provides a solution and requires work to achieve.

It might be worth asking on the ESS-help if anyone knows how to do this.

Neil


-- 
"Our civilization would be pitifully immature without the intellectual
revolution led by Darwin" - Motoo Kimura, The Neutral Theory of
Molecular Evolution

Email - nshephard@gmail.com
Website - http://kimura-no-ip.org/
Photos - http://www.flickr.com/photos/slackline/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index