summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2013-09-13 20:36:56 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2013-09-13 20:36:56 +0200
commit393305d2fcf612f4e5f99383f680f819b458c326 (patch)
treec74f36af8672b6c6c8c2e9624df19f2804cbd38c
parentba42cac06db062d5392342930d3d175c1d3cf763 (diff)
downloadgeiser-guile-393305d2fcf612f4e5f99383f680f819b458c326.tar.gz
geiser-guile-393305d2fcf612f4e5f99383f680f819b458c326.tar.bz2
Guile: augmenting %load-compiled-path too
We add the paths in geiser-guile-load-path also to %load-compiled-path, and new directories added to the load path via geiser-add-to-load-path are added to both %load-path and %load-compiled-path. Here's hope Ludovic will like all these additions!
-rw-r--r--elisp/geiser-guile.el13
-rw-r--r--scheme/guile/geiser/evaluation.scm15
2 files changed, 19 insertions, 9 deletions
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el
index d512185..994ea6b 100644
--- a/elisp/geiser-guile.el
+++ b/elisp/geiser-guile.el
@@ -305,7 +305,7 @@ it spawn a server thread."
(interactive)
(geiser-connect 'guile))
-(defun geiser-guile--set-load-path ()
+(defun geiser-guile--set-geiser-load-path ()
(let* ((path (expand-file-name "guile/" geiser-scheme-dir))
(witness "geiser/emacs.scm")
(code `(begin (if (not (%search-load-path ,witness))
@@ -318,12 +318,15 @@ it spawn a server thread."
`((,geiser-guile--path-rx geiser-guile--resolve-file-x)
("^ +\\([0-9]+\\):\\([0-9]+\\)" nil 1 2)))
(compilation-setup t)
- (font-lock-add-keywords nil
- `((,geiser-guile--path-rx 1
- compilation-error-face)))
+ (font-lock-add-keywords nil `((,geiser-guile--path-rx
+ 1 compilation-error-face)))
(let ((geiser-log-verbose-p t))
- (when remote (geiser-guile--set-load-path))
+ (when remote (geiser-guile--set-geiser-load-path))
(geiser-eval--send/wait ",use (geiser emacs)\n'done")
+ (mapcar (lambda (dir)
+ (let ((dir (expand-file-name dir)))
+ (geiser-eval--send/wait `(:eval (:ge add-to-load-path ,dir)))))
+ geiser-guile-load-path)
(geiser-guile-update-warning-level)))
diff --git a/scheme/guile/geiser/evaluation.scm b/scheme/guile/geiser/evaluation.scm
index 5562382..21f8772 100644
--- a/scheme/guile/geiser/evaluation.scm
+++ b/scheme/guile/geiser/evaluation.scm
@@ -1,6 +1,6 @@
;;; evaluation.scm -- evaluation, compilation and macro-expansion
-;; Copyright (C) 2009, 2010, 2011 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2009, 2010, 2011, 2013 Jose Antonio Ortega Ruiz
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the Modified BSD License. You should
@@ -108,8 +108,15 @@
(lambda ()
(pretty-print (tree-il->scheme (macroexpand form)))))))
+(define (add-to-list lst dir)
+ (and (not (member dir lst))))
+
(define (ge:add-to-load-path dir)
(and (file-is-directory? dir)
- (not (member dir %load-path))
- (begin (set! %load-path (cons dir %load-path))
- #t)))
+ (let ((in-lp (member dir %load-path))
+ (in-clp (member dir %load-compiled-path)))
+ (when (not in-lp)
+ (set! %load-path (cons dir %load-path)))
+ (when (not in-clp)
+ (set! %load-compiled-path (cons dir %load-compiled-path)))
+ (or in-lp in-clp))))