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/geiser-edit.el | |
parent | fbc65dfc767da1dc3b28262eae041e9d303752c2 (diff) | |
download | geiser-chez-41d54012368ca33461fe3e8668c2b0e3052af3b8.tar.gz geiser-chez-41d54012368ca33461fe3e8668c2b0e3052af3b8.tar.bz2 |
New command to open module file.
Diffstat (limited to 'elisp/geiser-edit.el')
-rw-r--r-- | elisp/geiser-edit.el | 16 |
1 files changed, 11 insertions, 5 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 |