summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLockywolf <lockywolf@gmail.com>2019-08-06 00:43:05 +0800
committerLockywolf <lockywolf@gmail.com>2019-08-06 00:43:05 +0800
commit1881db7de8c1a0b2d2544dca8b755c6792c916c9 (patch)
tree96d97a74b33bae5c4e350545e5f0fd5e22fe4218
parentfbdfbee56a03a1a0396d61fdc8f0b0af87273fc9 (diff)
downloadgeiser-guile-1881db7de8c1a0b2d2544dca8b755c6792c916c9.tar.gz
geiser-guile-1881db7de8c1a0b2d2544dca8b755c6792c916c9.tar.bz2
Add scheme subroutine to find files implementing modules to chibi.
Add a helper function make-location to chibi interface.
-rw-r--r--.gitignore1
-rw-r--r--elisp/geiser-connection.el1
-rw-r--r--elisp/geiser-edit.el4
-rw-r--r--elisp/geiser-eval.el1
-rw-r--r--scheme/chibi/geiser/geiser.scm27
-rw-r--r--scheme/chibi/geiser/geiser.sld3
6 files changed, 35 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index b1caaf5..5178817 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+*~
*.elc
Makefile
Makefile.in
diff --git a/elisp/geiser-connection.el b/elisp/geiser-connection.el
index 510afe9..560412f 100644
--- a/elisp/geiser-connection.el
+++ b/elisp/geiser-connection.el
@@ -252,6 +252,7 @@
"Time limit, in msecs, blocking on synchronous evaluation requests")
(defun geiser-con--send-string/wait (con str cont &optional timeout sbuf)
+ (message "lwf:g-c--s-s/w:%s" str)
(save-current-buffer
(let ((proc (and con (geiser-con--connection-process con))))
(unless proc (error "Geiser connection not active"))
diff --git a/elisp/geiser-edit.el b/elisp/geiser-edit.el
index 3187b99..6754472 100644
--- a/elisp/geiser-edit.el
+++ b/elisp/geiser-edit.el
@@ -237,10 +237,10 @@ With prefix, asks for the symbol to edit."
(geiser-completion--read-symbol "Edit symbol: ")))
(cmd `(:eval (:ge symbol-location ',symbol)))
(marker (point-marker)))
- (condition-case err
+ (condition-case-unless-debug err
(progn (geiser-edit--try-edit symbol (geiser-eval--send/wait cmd))
(when marker (xref-push-marker-stack)))
- (error (condition-case nil
+ (error (condition-case-unless-debug nil
(geiser-edit-module-at-point)
(error (error (error-message-string err))))))))
diff --git a/elisp/geiser-eval.el b/elisp/geiser-eval.el
index 6209dd3..c8059a6 100644
--- a/elisp/geiser-eval.el
+++ b/elisp/geiser-eval.el
@@ -161,6 +161,7 @@ module-exports, autodoc, callers, callees and generic-methods.")
(and (listp ret) (or (assoc 'error ret) (assoc 'result ret))))
(defsubst geiser-eval--retort-result (ret)
+ (message "lwf:g-e--r-r:%s" ret)
(let ((values (cdr (assoc 'result ret))))
(car (geiser-syntax--read-from-string (car values)))))
diff --git a/scheme/chibi/geiser/geiser.scm b/scheme/chibi/geiser/geiser.scm
index 96399c3..6ba3edd 100644
--- a/scheme/chibi/geiser/geiser.scm
+++ b/scheme/chibi/geiser/geiser.scm
@@ -1,3 +1,4 @@
+; -*- geiser-scheme-implementation:chibi; -*-
(define (all-environment-exports environment prefix)
(if environment
(append (filter (lambda (identifier)
@@ -92,3 +93,29 @@
(define (geiser:newline)
#f)
+;(define (geiser:symbol-location)
+ ; '("geiser-chibi-error" "Not implemented"))
+
+;;> A chibi implementation of the standard geiser's location-making
+;;> subrouting. \var{file} is a string representing file name with path,
+;;> \var{line} is the line number starting from 0 (scheme way).
+
+(define (make-location file line)
+ (list (cons "file" (if (string? file) file '()))
+ (cons "line" (if (number? line) (+ 1 line) '()))))
+
+;;> A function to find the file where the symbol
+;;> \var{symbol-representing-module} is defined.
+
+(define (geiser:module-location symbol-representing-module)
+ (make-location
+ (find-module-file
+ (module-name->file
+ (module-name
+ (find-module symbol-representing-module)
+ )
+ )
+ )
+ 0
+ )
+)
diff --git a/scheme/chibi/geiser/geiser.sld b/scheme/chibi/geiser/geiser.sld
index a60b7de..30c0986 100644
--- a/scheme/chibi/geiser/geiser.sld
+++ b/scheme/chibi/geiser/geiser.sld
@@ -1,9 +1,12 @@
+; -*- geiser-scheme-implementation:chibi; -*-
(define-library (geiser)
(export geiser:completions
geiser:eval
geiser:autodoc
geiser:module-completions
geiser:no-values
+; geiser:symbol-location
+ geiser:module-location
geiser:newline)
(import (scheme small) (chibi modules) (chibi) (meta) (chibi ast) (chibi string) (srfi 1) (srfi 95) (chibi show))
(include "geiser.scm"))