From 3def657e6a1159396579b083c774ecbbbf9077f8 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Tue, 17 Nov 2015 16:12:47 -0500 Subject: [PATCH] Add a compile function for scad-mode --- .emacs.d/init.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index c776804..58819f1 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -146,7 +146,13 @@ (local-set-key (kbd "S-") 'markdown-promote) :mode "\\.md\\'") (use-package scad-mode - :mode "\\.scad$") + :mode "\\.scad$" + :config + (defun scad-compile (ext) + "Compile current buffer using 'scad-command' and the extention 'ext'" + (interactive (list (completing-read "Extension: " '("stl" "off" "amf" "dxf" "svg" "csg" "png")))) + (compile (concat scad-command " -o " (file-name-sans-extension buffer-file-name) "." ext " " buffer-file-name))) + (define-key scad-mode-map (kbd "C-c z") 'scad-compile)) (use-package smart-tabs-mode :config (smart-tabs-insinuate 'c 'c++ 'javascript))