summaryrefslogtreecommitdiff
path: root/elisp/geiser-edit.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-08-26 12:23:53 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-08-26 12:23:53 +0200
commitcee169c2de13d30f213b03578e70ca7c370e2684 (patch)
tree9111729fad059dd1c55527c5d22303a72edba495 /elisp/geiser-edit.el
parent2f5a1cce9e66e6f931749e5d3df6fe3fb220ad1f (diff)
downloadgeiser-chez-cee169c2de13d30f213b03578e70ca7c370e2684.tar.gz
geiser-chez-cee169c2de13d30f213b03578e70ca7c370e2684.tar.bz2
Company's go to location working also for locations in same file.
Diffstat (limited to 'elisp/geiser-edit.el')
-rw-r--r--elisp/geiser-edit.el16
1 files changed, 9 insertions, 7 deletions
diff --git a/elisp/geiser-edit.el b/elisp/geiser-edit.el
index 418b6e3..0ec1669 100644
--- a/elisp/geiser-edit.el
+++ b/elisp/geiser-edit.el
@@ -56,6 +56,7 @@ or following links in error buffers.")
(defun geiser-edit--visit-file (file method)
(cond ((eq method 'window) (find-file-other-window file))
((eq method 'frame) (find-file-other-frame file))
+ ((eq method 'noselect) (find-file-noselect file t))
(t (find-file file))))
(defsubst geiser-edit--location-name (loc)
@@ -126,10 +127,11 @@ or following links in error buffers.")
(geiser-edit--goto-line symbol line)
(when col
(beginning-of-line)
- (forward-char col))))
+ (forward-char col))
+ (cons (current-buffer) (point))))
-(defsubst geiser-edit--try-edit (symbol ret)
- (geiser-edit--try-edit-location symbol (geiser-eval--retort-result ret)))
+(defsubst geiser-edit--try-edit (symbol ret &optional method)
+ (geiser-edit--try-edit-location symbol (geiser-eval--retort-result ret) method))
;;; Links
@@ -155,13 +157,13 @@ or following links in error buffers.")
(defvar geiser-edit--symbol-history nil)
-(defun geiser-edit-symbol (symbol)
+(defun geiser-edit-symbol (symbol &optional method)
"Asks for a symbol to edit, with completion."
(interactive (list (geiser-completion--read-symbol "Edit symbol: "
nil
geiser-edit--symbol-history)))
(let ((cmd `(:eval ((:ge symbol-location) ',symbol))))
- (geiser-edit--try-edit symbol (geiser-eval--send/wait cmd))))
+ (geiser-edit--try-edit symbol (geiser-eval--send/wait cmd) method)))
(defun geiser-edit-symbol-at-point (&optional arg)
"Opens a new window visiting the definition of the symbol at point.
@@ -181,11 +183,11 @@ With prefix, asks for the symbol to edit."
(pop-tag-mark)
(error "No previous location for find symbol invocation")))
-(defun geiser-edit-module (module)
+(defun geiser-edit-module (module &optional method)
"Asks for a module and opens it in a new buffer."
(interactive (list (geiser-completion--read-module)))
(let ((cmd `(:eval ((:ge module-location) (:module ,module)))))
- (geiser-edit--try-edit module (geiser-eval--send/wait cmd))))
+ (geiser-edit--try-edit module (geiser-eval--send/wait cmd) method)))
(provide 'geiser-edit)