From 1e0a06408df55867d6ad22f343535ea58a568684 Mon Sep 17 00:00:00 2001 From: Derek Kwan Date: Sat, 16 Feb 2019 23:15:55 -0800 Subject: [PATCH 1/2] adding sonic-pi-send-line --- sonic-pi-mode.el | 1 + sonic-pi-osc.el | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/sonic-pi-mode.el b/sonic-pi-mode.el index ab4a68e..8add7dd 100644 --- a/sonic-pi-mode.el +++ b/sonic-pi-mode.el @@ -22,6 +22,7 @@ (define-key map (kbd "C-c M-c") 'sonic-pi-connect) (define-key map (kbd "C-c C-k") 'sonic-pi-send-buffer) (define-key map (kbd "C-c C-r") 'sonic-pi-send-region) + (define-key map (kbd "C-c C-w") 'sonic-pi-send-line) (define-key map (kbd "C-c C-q") 'sonic-pi-quit) (define-key map (kbd "C-c C-b") 'sonic-pi-stop-all) (define-key map (kbd "C-c C-c") 'sonic-pi-send-live-loop) diff --git a/sonic-pi-osc.el b/sonic-pi-osc.el index a54a770..81fc61a 100644 --- a/sonic-pi-osc.el +++ b/sonic-pi-osc.el @@ -72,6 +72,13 @@ (hlt-highlight-regexp-region (region-beginning) (region-end) ".+" 'eval-sonic-pi-flash nil) (run-at-time flash-time nil 'hlt-unhighlight-region nil nil nil)) +(defun sonic-pi-send-line () + "send a line to sonic via osc" + (interactive) + (sonic-pi-osc-send-text (line-beginning-position) (line-end-position)) + (hlt-highlight-regexp-region (line-beginning-position) (line-end-position) ".+" 'eval-sonic-pi-flash nil) + (run-at-time flash-time nil 'hlt-unhighlight-region nil nil nil)) + (defun sonic-pi-send-buffer () "send the current buffer to sonic via osc" (interactive) From e055480a8e19606901d6bec4db1139d1334d6b9c Mon Sep 17 00:00:00 2001 From: Derek Kwan Date: Mon, 6 May 2019 03:54:05 -0700 Subject: [PATCH 2/2] add in_thread, define to regex --- sonic-pi-osc.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonic-pi-osc.el b/sonic-pi-osc.el index 81fc61a..6398e8a 100644 --- a/sonic-pi-osc.el +++ b/sonic-pi-osc.el @@ -102,7 +102,7 @@ "send a live-loop to sonic via osc" (interactive) (save-excursion - (let ((s (re-search-backward "^\\(live_loop\\|with_fx\\)"))) + (let ((s (re-search-backward "^\\(live_loop\\|with_fx\\|in_thread\\|define\\)"))) (ruby-end-of-block) (end-of-line) (sonic-pi-osc-send-text s (point))