Eggdrive via Emacs Lisp

I keep coming back to Eggdrive because I love the idea of it and have wanted to leverage it for some time. Initially I tried a shell script and then a Python script, but neither of those felt right. I wanted more visibility. Since I use Emacs for code editing (and just about everything else) I started working on some Emacs Lisp so that I could leverage the buffer for logging. I think this is the path I want to tread with all the features and opportunities Emacs can leverage.

The first version includes:

  • Connection settings for host, port, suite path, and optional runscript path.
  • StartSession support.
  • Execute support for one-line or multi-line SenseTalk code.
  • ExecuteWithTimeout support for long-running commands.
  • Update support for polling timed-out executions.
  • EndSession support.
  • Interactive commands for executing a command, region, or whole buffer.
  • A simple *Eggdrive* response buffer.
  • Optional local runscript launcher.
  • Optional debug logging.

The key requirement currently is:

  • xml-rpc.el

There’s a lot to do still. I have a sensetalk-mode I’ve been working on that I’d like to join with this at some point, so will be a future refinement.

If you’re curious, clone or copy this repository (after close code review, naturally) somewhere in your Emacs load-path:

git clone https://github.com/chrisbryant-ucla/eggdrive-el.git
 cp eggdrive.el ~/.emacs.d/lisp/eggdrive.el

Some examples of the configuration:

Configure the Eggdrive host and port:

(setq eggdrive-host "127.0.0.1")
(setq eggdrive-port 5400)

Optionally configure a default suite path:

(setq eggdrive-suite-path "/Users/me/Eggplant/MySuite.suite")

Optionally configure the local runscript executable if you want Emacs to launch Eggplant Functional in drive mode:

(setq eggdrive-runscript-program
      "/Applications/Eggplant.app/Contents/MacOS/runscript")

Basic workflow

Start Eggplant Functional in drive mode first. Then, in Emacs:

M-x eggdrive-start

If eggdrive-suite-path is configured, eggdrive-start passes that suite path to StartSession. Eggplant Functional opens the suite and uses it as the context for subsequent commands. This matters because scripts and images inside that suite become available to your SenseTalk code.

Execute a one-line command:

M-x eggdrive-execute-command
SenseTalk command: put "Hello from Emacs"

Execute selected SenseTalk code:

M-x eggdrive-execute-region

Execute the whole current buffer:

M-x eggdrive-execute-buffer

End the session:

M-x eggdrive-end