Skip to content

Commit

Permalink
lispy.el (lispy-goto-symbol): Simplify
Browse files Browse the repository at this point in the history
* lispy.el (lispy-goto-symbol): Just use `geiser-edit-symbol'.

* le-scheme.el (lispy--scheme-goto-symbol): Remove.
  • Loading branch information
abo-abo committed Apr 1, 2015
1 parent 931f380 commit a93f4a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
12 changes: 0 additions & 12 deletions le-scheme.el
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,6 @@
(declare-function geiser-eval--send/wait "geiser-eval")
(declare-function geiser-eval--retort-error "geiser-eval")
(declare-function geiser-mode "geiser-mode")
(declare-function geiser-edit--try-edit "geiser-edit")

(defun lispy--scheme-goto-symbol (symbol)
"Opens a new window visiting the definition of SYMBOL."
(let* ((symbol (make-symbol symbol))
(cmd `(:eval (:ge symbol-location ',symbol)))
(marker (point-marker)))
(condition-case err
(progn (geiser-edit--try-edit symbol (geiser-eval--send/wait cmd))
(when marker (ring-insert find-tag-marker-ring marker)))
(error
(error (error-message-string err))))))

(defun lispy--eval-scheme (str)
"Eval STR as Scheme code."
Expand Down
3 changes: 2 additions & 1 deletion lispy.el
Original file line number Diff line number Diff line change
Expand Up @@ -2660,6 +2660,7 @@ Sexp is obtained by exiting list ARG times."
(declare-function lispy--clojure-resolve "le-clojure")
(declare-function lispy--clojure-jump "le-clojure")
(declare-function lispy--scheme-goto-symbol "le-scheme")
(declare-function geiser-edit-symbol "geiser-edit")
(defun lispy-goto-symbol (symbol)
"Go to definition of SYMBOL.
SYMBOL is a string."
Expand Down Expand Up @@ -2710,7 +2711,7 @@ SYMBOL is a string."
(slime-edit-definition symbol))
((eq major-mode 'scheme-mode)
(require 'geiser)
(lispy--scheme-goto-symbol symbol))))
(geiser-edit-symbol (make-symbol symbol)))))
;; in case it's hidden in an outline
(lispy--ensure-visible))

Expand Down

0 comments on commit a93f4a9

Please sign in to comment.