ado-mode
for EmacsThe ado-mode
is a major [editing] mode for Emacs which allows truly good editing of Stata, namely do
, ado
, sthlp
, smcl
, and mata
files. Here is a screenshot to see what the highlighting does. The mode also handles indentation, date stamps, and includes templates for writing help files, project do-files and the like.
Emacs versions down to 24.3 are supported.
Here is the change log which says what is new.
The current version is 1.18.5.0, which is made for Stata 18.5 (aka StataNow). It works just fine with earlier versions of Stata, but it will highlight commands as though you were using Stata 18.5.
Here are the things which make life easier when using the ado-mode
. Features include
Sending code directly from Emacs to Stata for evaluation. (See below)
Opening any file on the default ado-path, even automagically opening the ado-file for the current command.
Opening Stata help files (in Stata, of course) from Emacs.
Context-sensitive highlighting for keeping typos to a minimum.
smcl
directive highlighting (a big help for help files)Templates for common files, such as do-files which keep their own logs, ado-files, do-files made for testing and debugging ado-files, and (most importantly, perhaps) Stata help files.
Automatic indentation so that long if
, foreach
, forvalues
, and while
blocks get closed. Many types of indentation styles are supported.
Making the name of the ado file match the name of the program defined, even if you change the program's name.
Automatic refreshing of a header time stamp which can be formatted in a variety of ways.
Typical Emacs things:
M-x auto-complete-mode
or M-x company-mode
, among other minor modes. Both highlight common words and words already used in the buffer being edited. auto-complete-mode
comes with Emacs while company-mode
can be downloaded from Melpa via M-x list-packages
. ado-mode
can be downloaded via Melpa. It's been accepted as a Melpa project, but the whole Melpa autoupdate thing throws me for a loop. So...
Manual installation is also possible, but takes more work. Take a look at the INSTALL.md
file.
xsel
and xdotool
. In Debian/Ubuntu, this can be done via sudo apt-get install xsel xdotool
. Other *nixes will be similar.Please let me know if there are any troubles with the installations, since there are little quirks with cross-platform Emacs stuff.
ado-mode
is on the disaster now know as X: @ado-mode. The real reason for this is to have an easy RSS feed for finding out about updates: https://twitter.com/adomode