summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README39
-rw-r--r--elisp/geiser-edit.el16
-rw-r--r--elisp/geiser-eval.el3
-rw-r--r--elisp/geiser-mode.el3
-rw-r--r--elisp/geiser-syntax.el5
5 files changed, 37 insertions, 29 deletions
diff --git a/README b/README
index 1a00d09..6eb8c18 100644
--- a/README
+++ b/README
@@ -14,25 +14,26 @@
*** In Scheme buffers:
- |---------------+-------------------------------------------------|
- | C-cC-z | Switch to REPL |
- |---------------+-------------------------------------------------|
- | M-. | Edit symbol at point |
- | M-, | Go back to where M-. was last invoked |
- |---------------+-------------------------------------------------|
- | C-M-x, C-cC-e | Eval definition around point |
- | C-cMe | Eval definition around point and switch to REPL |
- | C-xC-e | Eval sexp before point |
- | C-cC-r | Eval region |
- | C-cM-r | Eval region and switch to REPL |
- |---------------+-------------------------------------------------|
- | C-cC-k | Compile and load current file |
- | C-cC-l | Load current file |
- |---------------+-------------------------------------------------|
- | C-cC-dd | See docstring for symbol at point |
- | C-cC-dm | See module documentation |
- | C-cC-da | Toggle autodoc mode |
- |---------------+-------------------------------------------------|
+ |---------+-------------------------------------------------|
+ | C-cC-z | Switch to REPL |
+ |---------+-------------------------------------------------|
+ | M-. | Edit symbol at point |
+ | M-, | Go back to where M-. was last invoked |
+ | C-cC-em | Ask for a module and open its file |
+ |---------+-------------------------------------------------|
+ | C-M-x | Eval definition around point |
+ | C-cM-e | Eval definition around point and switch to REPL |
+ | C-xC-e | Eval sexp before point |
+ | C-cC-r | Eval region |
+ | C-cM-r | Eval region and switch to REPL |
+ |---------+-------------------------------------------------|
+ | C-cC-k | Compile and load current file |
+ | C-cC-l | Load current file |
+ |---------+-------------------------------------------------|
+ | C-cC-dd | See documentation for symbol at point |
+ | C-cC-dm | See module documentation |
+ | C-cC-da | Toggle autodoc mode |
+ |---------+-------------------------------------------------|
If `geiser-mode-smart-tab-p' is nil
|----------+-------------------------------|
diff --git a/elisp/geiser-edit.el b/elisp/geiser-edit.el
index fc28d09..5d6ca46 100644
--- a/elisp/geiser-edit.el
+++ b/elisp/geiser-edit.el
@@ -63,11 +63,11 @@
(defconst geiser-edit--def-re
(regexp-opt '("define" "defmacro" "define-macro" "define-syntax" "define*")))
-(defsubst geiser-edit--def-re (symbol)
- (format "(%s +(?%s\\_>" geiser-edit--def-re (regexp-quote (symbol-name symbol))))
+(defsubst geiser-edit--def-re (thing)
+ (format "(%s +(?%s\\_>" geiser-edit--def-re (regexp-quote (format "%s" thing))))
-(defsubst geiser-edit--symbol-re (symbol)
- (format "\\_<%s\\_>" (regexp-quote (symbol-name symbol))))
+(defsubst geiser-edit--symbol-re (thing)
+ (format "\\_<%s\\_>" (regexp-quote (format "%s" thing))))
(defun geiser-edit--goto-line (symbol line)
(if (numberp line)
@@ -81,7 +81,7 @@
(let* ((loc (geiser-eval--retort-result ret))
(file (geiser-edit--location-file loc))
(line (geiser-edit--location-line loc)))
- (unless file (error "Couldn't find edit location"))
+ (unless file (error "Couldn't find edit location for '%s'" symbol))
(unless (file-readable-p file) (error "Couldn't open '%s' for read" file))
(geiser-edit--visit-file file geiser-edit-symbol-method)
(geiser-edit--goto-line symbol line)))
@@ -116,6 +116,12 @@ With prefix, asks for the symbol to edit."
(pop-tag-mark)
(error "No previous location for find symbol invocation")))
+(defun geiser-edit-module (module)
+ "Asks for a module and opens it in a new buffer."
+ (interactive (list (geiser-completion--read-module)))
+ (let ((cmd `(:gs ((:ge module-location) (quote (:scm ,module))))))
+ (geiser-edit--try-edit module (geiser-eval--send/wait cmd))))
+
(provide 'geiser-edit)
;;; geiser-edit.el ends here
diff --git a/elisp/geiser-eval.el b/elisp/geiser-eval.el
index 7a729cf..b1bd83b 100644
--- a/elisp/geiser-eval.el
+++ b/elisp/geiser-eval.el
@@ -51,7 +51,8 @@
") (quote "
(or (and (nth 1 code)
(geiser-eval--scheme-str (nth 1 code)))
- (geiser-syntax--buffer-module))
+ (geiser-syntax--buffer-module)
+ "#f")
"))"))
(defsubst geiser-eval--ge (proc)
diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el
index b023c3d..cd7a5a6 100644
--- a/elisp/geiser-mode.el
+++ b/elisp/geiser-mode.el
@@ -161,7 +161,6 @@ interacting with the Geiser REPL is at your disposal.
(define-key geiser-mode-map "\M-\C-x" 'geiser-send-definition)
(define-key geiser-mode-map "\C-x\C-e" 'geiser-send-last-sexp)
-(define-key geiser-mode-map "\C-c\C-e" 'geiser-send-definition)
(define-key geiser-mode-map "\C-c\M-e" 'geiser-send-definition-and-go)
(define-key geiser-mode-map "\C-c\C-r" 'geiser-send-region)
(define-key geiser-mode-map "\C-c\M-r" 'geiser-send-region-and-go)
@@ -170,6 +169,8 @@ interacting with the Geiser REPL is at your disposal.
(geiser-mode--triple-chord ?d ?d 'geiser-doc-symbol-at-point)
(geiser-mode--triple-chord ?d ?m 'geiser-doc-module)
+(geiser-mode--triple-chord ?e ?m 'geiser-edit-module)
+
(define-key geiser-mode-map "\C-c\M-c" 'geiser-compile-definition)
(define-key geiser-mode-map "\C-c\C-c" 'geiser-compile-definition-and-go)
(define-key geiser-mode-map "\C-c\C-t" 'geiser-trace-procedure)
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el
index 1897898..6577152 100644
--- a/elisp/geiser-syntax.el
+++ b/elisp/geiser-syntax.el
@@ -39,9 +39,8 @@
(with-current-buffer buffer
(save-excursion
(goto-char (point-min))
- (if (re-search-forward geiser-syntax--module-definition-re nil t)
- (match-string-no-properties 1)
- "#f")))))
+ (when (re-search-forward geiser-syntax--module-definition-re nil t)
+ (match-string-no-properties 1))))))
;;; Indentation: