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
commite7cdf10b94d7f5e66a5b3a6e7e65439ef35f874f (patch)
tree9e8a158bc843df47047dde625b432e037936b40b /elisp/geiser-edit.el
parent69643a0d6d214a164117a49696b08073cfbe58e5 (diff)
downloadgeiser-e7cdf10b94d7f5e66a5b3a6e7e65439ef35f874f.tar.gz
geiser-e7cdf10b94d7f5e66a5b3a6e7e65439ef35f874f.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)