From 4bff94c0cc46bf7a530c25308c0e6695d6667c16 Mon Sep 17 00:00:00 2001 From: Marije Baalman Date: Sat, 12 Sep 2009 15:11:18 +0000 Subject: [PATCH] committed ide platform switch for emacs/scel, and added the evaluate document shortcut git-svn-id: https://supercollider.svn.sourceforge.net/svnroot/supercollider/trunk@9398 a380766d-ff14-0410-b294-a243070f3f08 --- el/sclang-interp.el | 9 +++++++++ el/sclang-mode.el | 2 ++ 2 files changed, 11 insertions(+) diff --git a/el/sclang-interp.el b/el/sclang-interp.el index 94aee2d..abb2d06 100644 --- a/el/sclang-interp.el +++ b/el/sclang-interp.el @@ -301,6 +301,7 @@ If EOB-P is non-nil, positions cursor at end of buffer." (append-option "-r")) (if sclang-main-stop (append-option "-s")) + (append-option "-iscel") res))) (defun sclang-start () @@ -545,6 +546,14 @@ if PRINT-P is non-nil. Return STRING if successful, otherwise nil." (sclang-eval-string string (not silent-p)) string))) +(defun sclang-eval-document (&optional silent-p) + "Execute the whole document as SuperCollider code." + (interactive "P") + (mark-whole-buffer) + (sclang-eval-string + (buffer-substring-no-properties (region-beginning) (region-end)) + (not silent-p))) + (defvar sclang-eval-results nil "Save results of sync SCLang evaluation.") diff --git a/el/sclang-mode.el b/el/sclang-mode.el index 0733df8..8ad72cc 100644 --- a/el/sclang-mode.el +++ b/el/sclang-mode.el @@ -86,6 +86,7 @@ ["Evaluate Line" sclang-eval-region-or-line] ["Evaluate Defun" sclang-eval-defun] ["Evaluate Expression ..." sclang-eval-expression] + ["Evaluate Document" sclang-eval-document] "-" ["Find Definitions ..." sclang-find-definitions] ["Find References ..." sclang-find-references] @@ -117,6 +118,7 @@ (define-key map "\C-c\C-d" 'sclang-eval-region) (define-key map "\C-\M-x" 'sclang-eval-defun) (define-key map "\C-c\C-e" 'sclang-eval-expression) + (define-key map "\C-c\C-f" 'sclang-eval-document) ;; language information (define-key map "\C-c\C-n" 'sclang-complete-symbol) (define-key map "\M-\t" 'sclang-complete-symbol)