From abe0355b7eb7961c89ef2e37f68451b131dacb05 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sat, 21 Feb 2009 04:46:14 +0100 Subject: Correct stack in load/compile file retorts. --- elisp/geiser-compile.el | 8 ++++---- elisp/geiser-eval.el | 8 ++++++++ scheme/guile/geiser/emacs.scm | 8 +++++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/elisp/geiser-compile.el b/elisp/geiser-compile.el index ee6c5f8..82200a5 100644 --- a/elisp/geiser-compile.el +++ b/elisp/geiser-compile.el @@ -69,14 +69,14 @@ (message "") (geiser-compile--pop-to-buffer)))) -(defun geiser-compile--file-op (path op msg) +(defun geiser-compile--file-op (path compile-p msg) (let* ((b/p (geiser-compile--buffer/path path)) (buffer (car b/p)) (path (cdr b/p)) (msg (format "%s %s ..." msg path))) (message msg) (geiser-compile--display-result - msg (geiser-eval--send/wait `(:eval ((:ge ,op) ,path) (geiser emacs)))))) + msg (geiser-eval--send/wait `(,(if compile-p :comp-file :load-file) ,path))))) ;;; User commands: @@ -84,7 +84,7 @@ (defun geiser-compile-file (path) "Compile and load Scheme file." (interactive "FScheme file: ") - (geiser-compile--file-op path 'compile-file "Compiling")) + (geiser-compile--file-op path t "Compiling")) (defun geiser-compile-current-buffer () "Compile and load current Scheme file." @@ -94,7 +94,7 @@ (defun geiser-load-file (path) "Load Scheme file." (interactive "FScheme file: ") - (geiser-compile--file-op path 'load-file "Loading")) + (geiser-compile--file-op path nil "Loading")) (defun geiser-load-current-buffer () "Load current Scheme file." diff --git a/elisp/geiser-eval.el b/elisp/geiser-eval.el index ca442f0..785f441 100644 --- a/elisp/geiser-eval.el +++ b/elisp/geiser-eval.el @@ -40,6 +40,8 @@ ((listp code) (cond ((eq (car code) :eval) (geiser-eval--eval (cdr code))) ((eq (car code) :comp) (geiser-eval--comp (cdr code))) + ((eq (car code) :load-file) (geiser-eval--load-file (cadr code))) + ((eq (car code) :comp-file) (geiser-eval--comp-file (cadr code))) ((eq (car code) :module) (geiser-eval--module (cadr code))) ((eq (car code) :ge) (geiser-eval--ge (cadr code))) ((eq (car code) :scm) (cadr code)) @@ -55,6 +57,12 @@ (geiser-eval--scheme-str `((@ (geiser emacs) ge:compile) (quote ,(nth 0 code)) (:module ,(nth 1 code))))) +(defsubst geiser-eval--load-file (file) + (geiser-eval--scheme-str `((@ (geiser emacs) ge:load-file) ,file))) + +(defsubst geiser-eval--comp-file (file) + (geiser-eval--scheme-str `((@ (geiser emacs) ge:compile-file) ,file))) + (defsubst geiser-eval--module (code) (geiser-eval--scheme-str (cond ((or (eq code '(())) (null code)) diff --git a/scheme/guile/geiser/emacs.scm b/scheme/guile/geiser/emacs.scm index 147af7c..b9e2d67 100644 --- a/scheme/guile/geiser/emacs.scm +++ b/scheme/guile/geiser/emacs.scm @@ -112,11 +112,13 @@ SUBR, MSG and REST." (define (ge:compile-file path) "Compile and load file, given its full @var{path}." - (and (compile-file path) - (load-compiled (compiled-file-name path)))) + (evaluate `(and (compile-file ,path) + (load-compiled ,(compiled-file-name path))) + '(geiser emacs) + eval)) (define (ge:load-file path) "Load file, given its full @var{path}." - (compile-and-load path)) + (evaluate `(compile-and-load ,path) '(geiser emacs) eval)) ;;; emacs.scm ends here -- cgit v1.2.3