diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-02-16 22:21:28 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-02-16 22:21:28 +0100 |
commit | 41d54012368ca33461fe3e8668c2b0e3052af3b8 (patch) | |
tree | 52137aa1371e7c1ec81b95508a504eabba3b0bc3 /elisp | |
parent | fbc65dfc767da1dc3b28262eae041e9d303752c2 (diff) | |
download | geiser-chez-41d54012368ca33461fe3e8668c2b0e3052af3b8.tar.gz geiser-chez-41d54012368ca33461fe3e8668c2b0e3052af3b8.tar.bz2 |
New command to open module file.
Diffstat (limited to 'elisp')
-rw-r--r-- | elisp/geiser-edit.el | 16 | ||||
-rw-r--r-- | elisp/geiser-eval.el | 3 | ||||
-rw-r--r-- | elisp/geiser-mode.el | 3 | ||||
-rw-r--r-- | elisp/geiser-syntax.el | 5 |
4 files changed, 17 insertions, 10 deletions
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: |