diff --git a/Cask b/Cask index c6883f8a1..5c2568672 100644 --- a/Cask +++ b/Cask @@ -179,6 +179,9 @@ (depends-on "php-boris") (depends-on "php-extras") +;; Processing -- modules/module-processing.el +(depends-on "processing-mode") + ;; Python -- modules/module-python.el (depends-on "nose") (depends-on "anaconda-mode") diff --git a/core/core-popup.el b/core/core-popup.el index 222cc4dcf..515ee681a 100644 --- a/core/core-popup.el +++ b/core/core-popup.el @@ -46,6 +46,7 @@ ;; Emacs ("^\\*.+-Profiler-Report .+\\*$" :regexp t :align below :size 0.3) + ("*processing-compilation*" :align below :size 15 :noselect t) ("*Backtrace*" :align below :size 0.25 :noselect t) ("*scratch*" :align below :size 0.3 :select t) ("*Help*" :align below :size 21 :select t) diff --git a/init.el b/init.el index b5876d0a9..06870ac03 100644 --- a/init.el +++ b/init.el @@ -76,6 +76,7 @@ module-lisp ; drowning in parentheses module-lua ; one-based indices? one-based indices. module-php ; making php less painful to work with + module-processing ; pretty prototypes module-python ; beautiful is better than ugly module-ruby ; 1.step do {|i| p "Ruby is #{i&1==0?'love':'life'}"} module-rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() diff --git a/modules/module-processing.el b/modules/module-processing.el new file mode 100644 index 000000000..7c6e91fc3 --- /dev/null +++ b/modules/module-processing.el @@ -0,0 +1,45 @@ +;;; module-processing.el + +(use-package processing-mode + :when IS-MAC + :commands (processing-mode processing-find-sketch) + :mode "\\.pde$" + :config + (setq processing-location "/usr/local/bin/processing-java" + processing-application-dir "/Applications/Processing.app" + processing-sketchbook-dir "~/Dropbox/work/pde" + processing-output-dir "/tmp") + + (define-builder! processing-mode processing-sketch-build) + (after! quickrun + (quickrun-add-command + "processing" `((:command . ,processing-location) + (:exec . (lambda () (format "--sketch=%s --output=%s --force --run" + (narf/project-root) processing-output-dir))) + (:description . "Run Processing sketch")) + :mode 'processing-mode)) + + (map! :map processing-mode-map + :nv "M-r" 'processing-sketch-run + :m "gD" 'processing-find-in-reference + :m "gF" 'processing-find-sketch + (:localleader + "e" 'processing-export-application + "h" 'processing-open-reference + "e" 'processing-open-examples + "o" 'processing-open-sketchbook)) + + (add-hook 'processing-compilation-mode-hook 'narf|hide-mode-line) + (add-hook! processing-mode + (setq-local company-backends '((company-keywords + :with + company-yasnippet + company-dabbrev-code))) + (make-local-variable 'company-keywords-alist) + (add-to-list 'company-keywords-alist + (cons 'processing-mode (append processing-functions + processing-builtins + processing-constants))))) + +(provide 'module-processing) +;;; module-processing.el ends here