Skip to content

Instantly share code, notes, and snippets.

@lvm lvm/
Created Feb 13, 2017

What would you like to do?
[WIP] hackish emacs mode for FoxDot


  1. put in the same directory as the FoxDot installaton (in case you're using virtualenv, otherwise comment from lines 5 to 7)
  2. copy foxdot-mode.el to ~/.emacs.d/lisp
  3. add (defvar foxdot-cli-path "/path/to/foxdot-cli/") in your ~/.emacs file
  4. in Emacs M-x load-library and complete with foxdot-mode
  5. Type C-c C-f or M-x foxdot-start to start
  6. Type C-c C-e or M-x foxdot-execute to evaluate a line or a block of code
#!/usr/bin/env python
import os
import cmd
BASE_PATH = os.path.dirname(os.path.abspath(__file__))
ACTIVATE_PY = os.path.join(BASE_PATH, ".env", "bin", "")
execfile(ACTIVATE_PY, dict(__file__=ACTIVATE_PY))
from FoxDot import *
class FoxDotConsole(cmd.Cmd):
prompt = "FoxDot> "
intro = "LiveCoding with Python and SuperCollider"
def default(self, line):
if __name__ == "__main__":
(defvar foxdot-buffer-name "*FoxDot*")
(defun foxdot-start ()
python-shell-interpreter-args (concat foxdot-cli-path "")
fd-code-buffer (format (buffer-name))
(run-python (python-shell-parse-command))
(rename-buffer foxdot-buffer-name)
(switch-to-buffer-other-window fd-code-buffer)
(defun foxdot-execute(start end)
(interactive "r")
fd-code (buffer-substring-no-properties start end)
fd-code-buffer (format (buffer-name))
(append-to-buffer (get-buffer foxdot-buffer-name) start end)
(switch-to-buffer-other-window (get-buffer foxdot-buffer-name))
(execute-kbd-macro "\C-m")
(switch-to-buffer-other-window fd-code-buffer)
(execute-kbd-macro "\C-g")
(global-set-key [?\C-c ?\C-e] `foxdot-execute)
(global-set-key [?\C-c ?\C-f] `foxdot-start)
(provide 'foxdot-mode)

This comment has been minimized.

Copy link

rdtor commented May 6, 2019

i cant get it workm when loading the library it says cannot find foxdot-mode


This comment has been minimized.

Copy link

fdragovic commented Dec 18, 2019

you can also

(add-to-list 'load-path "~/.emacs.d/your/directory/")
(load 'foxdot-mode)

This comment has been minimized.

Copy link
Owner Author

lvm commented Dec 18, 2019

@rdtor @fdragovic keep in mind this was done many years ago. I'm not really sure this still works. And probably FoxDot provides a proper emacs mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.