summaryrefslogtreecommitdiff
path: root/scheme/racket
diff options
context:
space:
mode:
Diffstat (limited to 'scheme/racket')
-rw-r--r--scheme/racket/geiser/eval.rkt12
-rw-r--r--scheme/racket/geiser/main.rkt6
-rw-r--r--scheme/racket/geiser/user.rkt1
3 files changed, 14 insertions, 5 deletions
diff --git a/scheme/racket/geiser/eval.rkt b/scheme/racket/geiser/eval.rkt
index f1f3f51..a59e275 100644
--- a/scheme/racket/geiser/eval.rkt
+++ b/scheme/racket/geiser/eval.rkt
@@ -1,6 +1,6 @@
;;; eval.rkt -- evaluation
-;; Copyright (C) 2009, 2010 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2009, 2010, 2011 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
@@ -14,6 +14,7 @@
(provide eval-in
load-file
macroexpand
+ add-to-load-path
make-repl-reader)
@@ -65,6 +66,15 @@
(lambda ()
(pretty-print (syntax->datum ((if all expand expand-once) form)))))))
+(define (add-to-load-path p)
+ (when (string? p)
+ (let ([p (string->path p)]
+ [cps (current-library-collection-paths)])
+ (unless (member p cps)
+ (current-library-collection-paths
+ (cons p cps)))))
+ #t)
+
(define (make-repl-reader reader)
(lambda ()
(last-namespace (current-namespace))
diff --git a/scheme/racket/geiser/main.rkt b/scheme/racket/geiser/main.rkt
index c759089..b1db6fb 100644
--- a/scheme/racket/geiser/main.rkt
+++ b/scheme/racket/geiser/main.rkt
@@ -1,6 +1,6 @@
;;; main.rkt -- exported interface for emacs
-;; Copyright (C) 2010 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2010, 2011 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
@@ -44,7 +44,7 @@
(load-file file))
(define geiser:compile-file geiser:load-file)
-
+(define geiser:add-to-load-path add-to-load-path)
(define geiser:autodoc autodoc)
(define geiser:help get-help)
(define geiser:completions symbol-completions)
@@ -55,5 +55,3 @@
(define geiser:macroexpand macroexpand)
(define geiser:symbol-documentation symbol-documentation)
(define (geiser:no-values) (values))
-
-;;; main.rkt ends here
diff --git a/scheme/racket/geiser/user.rkt b/scheme/racket/geiser/user.rkt
index 69a5df7..3ef978b 100644
--- a/scheme/racket/geiser/user.rkt
+++ b/scheme/racket/geiser/user.rkt
@@ -73,6 +73,7 @@
[(enter) (enter! (read) #'cmd)]
[(geiser-eval) (geiser-eval)]
[(geiser-no-values) (datum->syntax #f (void))]
+ [(add-to-load-path) (add-to-load-path (read))]
[else form])]
[_ form])))