Skip to content

Instantly share code, notes, and snippets.

@mudphone
Last active December 14, 2015 08:49
Show Gist options
  • Save mudphone/5060758 to your computer and use it in GitHub Desktop.
Save mudphone/5060758 to your computer and use it in GitHub Desktop.
Processing 2 with Emacs
install Processing (Mac) version 2.0b9
install processing-emacs
$ cd ~/.emacs.d/vendor
$ git clone https://github.com/ptrv/processing2-emacs.git
install processing-java command line utility
- Open Processing.app
- Tools > Install "processing-java"
there's a bug in the Processing 2.0b9 version of /usr/bin/processing-java that can be fixed by looking at this post:
http://forum.processing.org/topic/processing-2-0b9-processing-java-can-t-find-org-eclipse-jdi-bootstrap
silence yasnippet
- edit your ~/.emacs.d/vendor/processing2-emacs/processing-mode.el
- find the following section and comment it out, unless you want yasnippet
;;;###autoload
;; (eval-after-load 'yasnippet
;; '(processing-snippets-initialize))
configure your Emacs init.el
- update ~/.emacs.d/init.el with this
;; From: https://github.com/ptrv/processing2-emacs
(add-to-list 'load-path "~/.emacs.d/vendor/processing2-emacs/")
(autoload 'processing-mode "processing-mode" "Processing mode" t)
(add-to-list 'auto-mode-alist '("\\.pde$" . processing-mode))
(setq processing-location "/usr/bin/processing-java")
(setq processing-application-dir "/Applications/Processing.app")
(setq processing-sketch-dir "~/Documents/Processing")
(defun processing-mode-init ()
(make-local-variable 'ac-sources)
(setq ac-sources '(ac-source-dictionary ac-source-yasnippet))
(make-local-variable 'ac-user-dictionary)
(setq ac-user-dictionary processing-functions)
(setq ac-user-dictionary (append ac-user-dictionary processing-builtins))
(setq ac-user-dictionary (append ac-user-dictionary processing-constants)))
(add-to-list 'ac-modes 'processing-mode)
(add-hook 'processing-mode-hook 'processing-mode-init)
;; C-c C-p r Run a sketch.
;; C-c C-p b Compile a sketch into .class files.
;; C-c C-p p Run a sketch full screen.
;; C-c C-p e Export sketch.
;; C-c C-p d Find in reference.
;; C-c C-p f Find or create sketch.
;; C-c C-p s Search in Processing forum.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment