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 <tim@klingt.org>
This commit is contained in:
Tim Blechmann 2011-12-07 00:00:16 +01:00
parent 08cbc64f3a
commit 1569625efa
3 changed files with 6 additions and 18 deletions

View file

@ -230,10 +230,10 @@ If EOB-P is non-nil, positions cursor at end of buffer."
(sclang-message "Initializing library...done")) (sclang-message "Initializing library...done"))
(defun sclang-on-library-shutdown () (defun sclang-on-library-shutdown ()
(run-hooks 'sclang-library-shutdown-hook) (when sclang-library-initialized-p
(setq sclang-library-initialized-p nil) (run-hooks 'sclang-library-shutdown-hook)
(sclang-message "Shutting down library...") (setq sclang-library-initialized-p nil)
) (sclang-message "Shutting down library...")))
;; ===================================================================== ;; =====================================================================
;; process hooks ;; process hooks
@ -311,6 +311,7 @@ If EOB-P is non-nil, positions cursor at end of buffer."
"Start SuperCollider process." "Start SuperCollider process."
(interactive) (interactive)
(sclang-stop) (sclang-stop)
(sclang-on-library-shutdown)
(sit-for 1) (sit-for 1)
(sclang-init-post-buffer) (sclang-init-post-buffer)
(sclang-start-command-process) (sclang-start-command-process)
@ -349,7 +350,6 @@ If EOB-P is non-nil, positions cursor at end of buffer."
"Recompile class library." "Recompile class library."
(interactive) (interactive)
(when (sclang-get-process) (when (sclang-get-process)
(sclang-on-library-shutdown)
(process-send-string sclang-process "\x18") (process-send-string sclang-process "\x18")
)) ))

View file

@ -251,6 +251,7 @@ Emacs {
outStream = CollStream.on(String.new); outStream = CollStream.on(String.new);
outFile = File(outFileName, "w"); outFile = File(outFileName, "w");
ShutDown.add { ShutDown.add {
Emacs.evalLispExpression( "(sclang-on-library-shutdown)" );
if (outFile.notNil) { if (outFile.notNil) {
outFile.close; outFile.close;
outFile = nil outFile = nil

View file

@ -1,13 +0,0 @@
+ LinuxPlatform {
recompile {
if ( this.hasFeature( \emacs ) ) {
Emacs.evalLispExpression( "(sclang-recompile)" )
} {
this.prRecompile
}
}
prRecompile {
_Recompile
}
}