Since approximately mid-year I started developing an Emacs package for doing interactive work with RevBayes, a program for bayesian phylogenetic inference. Since then the project has grown steadily and now it’s in a better shape, with a cleaner setup and execution, and is about to be submitted to Melpa. However, this post is not about that package but instead concerns a new one more or less forked from rev-mode but this time to allow interactive work with TNT, a program for phylogenetic analysis using parsimony.
This first release ‘just works’ in the sense that some features are still unavailable; however, up to now the package is able to start a TNT process whenever there is a command for text redirection and there is still no process available, and if so, it redirects text from the active buffer (e.g., a TNT script) to the buffer with the process.
Font locking is still derived from sh-mode and thus most of syntax formatting is not as nice as if it was deriving from c-mode; alternatively, at its current state, the package inherits the sh-mode redirection capabilities that are absent in c-mode (and with all reason, since C is a compiled language where you can’t carry out interactive work as opposed to interpreted languages). Long story short, we need the text redirection from sh-mode and syntax font locking from c-mode; and I’m still trying to figure out how to manage to accomplish such hybrid.
How to use it
- Add the following to your
(add-to-list 'load-path "path/to/tntphylo-mode") (require 'tntphylo-mode)
- Open a TNT script.
- Call the function
tntphylo-mode. It will load the package on the active buffer.
- Step on a line with a TNT command (e.g.,
mxram) and press
C-c C-nfor redirecting just one line. It will send the text to the TNT process that will execute it and print output to the TNT buffer.
- Rinse and repeat.
You might be wondering why the odd “tntphylo” part of the name instead of just “tnt” as the program; it happens that there is already a package called
tnt for Emacs and I didn’t want to mess things up in the remote case that somebody needs such package. Please note that it is customary in Emacs to start the function names with the package name (e.g.,
tntphylo-next-code-line) and therefore it will be confusing whether a given function starting with
tnt- belongs to this package or to the earlier
tnt.el package, unrelated to this one.
A few other functions are planned for this package, among others, inspection and maybe visualization of the objects produced through the interactive section, autocompletion of commands, and interactive help.
Please note that TNT is NOT open source (unfortunately) but instead freeware with a license agreement. You can call the TNT process only after agreeing with such license during the first time you launch the program. In order to work properly, your copy of TNT must be in your
PATH, that is, in a directory where your operative system can look for executables.