EditorClient is a small application which supports the ODB protocol developed by Bare Bones Software: and runs a shell command to start an editor in response. It was originally written for use with Emacs, but can be used with any editor which can be started from the command line and blocks until it has finished editing the file.
What editor to open and how can be customized by setting environment
variables (or by editing
EditorClientWorker.py). The variables in
question in order of preference are:
EDITOR_CLIENT_COMMANDcan be used to specify the whole command line. In this case it must be ready to print
filename. See below.
EMACSCLIENTis used for the editor and
EMACSfor the alternate.
- Defaults to
/Applications/Emacs.app/Contents/MacOS/bin/emacsclientfor emacsclient and empty for alternate.
EDITOR_CLIENT_COMMAND is set it should be something ready for
Python string formatting taking
filename as the
keys (you can ignore linenum if your editor doesn't support it.)
EMACS will produce the same as if you
"$EMACSCLIENT -c -a '$EMACS' +%(linenum)s '%(filename)s'"
A Note on Environment Variables in OS X
Working with environment variables in OS X can be confusing since
exporting them in
.bashrc for example is ineffective. Instead you
must set them in
~/.MacOSX/environment.plist. Brian D Foy wrote about a way to
update/create this file based on your shell environment (and which can
be run in
.bashrc for example).