[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-users] execute document in scel/emacs



Hiho,

I recently wrote a little function to have shortcut to select and execute the 
code in the current document. Especially useful in combination with the 
PdefAllGui (and siblings) edit buttons, which open up code documents to 
manipulate.

I can add this to svn, if enough people like it.

Maybe someone has suggestions for a good shortcut key combo, as I'm not sure 
C-c C-f is the best one (rather close to C-x C-f, which opens a file); on the 
other hand it seems to be the only one with the left hand that is free...


Add this to your .emacs and it'll work:

(defun sclang-eval-document (&optional silent-p)
  "Execute the region as SuperCollider code."
  (interactive "P")
  (mark-whole-buffer)
  (sclang-eval-string
   (buffer-substring-no-properties (region-beginning) (region-end))
   (not silent-p)))

(global-set-key "\C-c\C-f" 'sclang-eval-document)


sincerely,
Marije

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/