From 1569625efa4678836fedbd5de38949f48a37410b Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Wed, 7 Dec 2011 00:00:16 +0100 Subject: [PATCH] editors: scel - move code from el to sc to avoid method overwrite we can simply call the library shutdown handler from within emacs to avoid a method overwrite. Signed-off-by: Tim Blechmann --- el/sclang-interp.el | 10 +++++----- sc/Emacs.sc | 1 + sc/extPlatform.sc | 13 ------------- 3 files changed, 6 insertions(+), 18 deletions(-) delete mode 100644 sc/extPlatform.sc diff --git a/el/sclang-interp.el b/el/sclang-interp.el index 24ece0b..b254038 100644 --- a/el/sclang-interp.el +++ b/el/sclang-interp.el @@ -230,10 +230,10 @@ If EOB-P is non-nil, positions cursor at end of buffer." (sclang-message "Initializing library...done")) (defun sclang-on-library-shutdown () - (run-hooks 'sclang-library-shutdown-hook) - (setq sclang-library-initialized-p nil) - (sclang-message "Shutting down library...") - ) + (when sclang-library-initialized-p + (run-hooks 'sclang-library-shutdown-hook) + (setq sclang-library-initialized-p nil) + (sclang-message "Shutting down library..."))) ;; ===================================================================== ;; process hooks @@ -311,6 +311,7 @@ If EOB-P is non-nil, positions cursor at end of buffer." "Start SuperCollider process." (interactive) (sclang-stop) + (sclang-on-library-shutdown) (sit-for 1) (sclang-init-post-buffer) (sclang-start-command-process) @@ -349,7 +350,6 @@ If EOB-P is non-nil, positions cursor at end of buffer." "Recompile class library." (interactive) (when (sclang-get-process) - (sclang-on-library-shutdown) (process-send-string sclang-process "\x18") )) diff --git a/sc/Emacs.sc b/sc/Emacs.sc index f0e3780..d1dcb1e 100644 --- a/sc/Emacs.sc +++ b/sc/Emacs.sc @@ -251,6 +251,7 @@ Emacs { outStream = CollStream.on(String.new); outFile = File(outFileName, "w"); ShutDown.add { + Emacs.evalLispExpression( "(sclang-on-library-shutdown)" ); if (outFile.notNil) { outFile.close; outFile = nil diff --git a/sc/extPlatform.sc b/sc/extPlatform.sc deleted file mode 100644 index 445e8e8..0000000 --- a/sc/extPlatform.sc +++ /dev/null @@ -1,13 +0,0 @@ -+ LinuxPlatform { - recompile { - if ( this.hasFeature( \emacs ) ) { - Emacs.evalLispExpression( "(sclang-recompile)" ) - } { - this.prRecompile - } - } - - prRecompile { - _Recompile - } -}