summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-26 21:52:31 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-26 21:52:31 +0100
commit775b81c9be65b71a1d3090d5b80398a82ffc54f2 (patch)
tree48024b94444baf6edaaab5d1ffc4e862c0e6ddfb /elisp
parent0233627d20dd483745c8386b2eb5ff26b355f854 (diff)
downloadgeiser-guile-775b81c9be65b71a1d3090d5b80398a82ffc54f2.tar.gz
geiser-guile-775b81c9be65b71a1d3090d5b80398a82ffc54f2.tar.bz2
Remove unnecessary calls to symbol-at-point
... which interns the symbol in the global obarray: rather unfriendly. We still need to remove a few calls to that beast, and avoid intern in the scheme reader.
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-base.el4
-rw-r--r--elisp/geiser-completion.el2
-rw-r--r--elisp/geiser-doc.el10
-rw-r--r--elisp/geiser-edit.el2
-rw-r--r--elisp/geiser-mode.el12
-rw-r--r--elisp/geiser-repl.el10
-rw-r--r--elisp/geiser-xref.el4
7 files changed, 25 insertions, 19 deletions
diff --git a/elisp/geiser-base.el b/elisp/geiser-base.el
index 41fb6fc..65ab061 100644
--- a/elisp/geiser-base.el
+++ b/elisp/geiser-base.el
@@ -70,6 +70,10 @@
(dolist (e lst (nreverse result))
(unless (member e result) (push e result)))))
+(defsubst geiser--symbol-at-point ()
+ (let ((thing (thing-at-point 'symbol)))
+ (and thing (make-symbol thing))))
+
(provide 'geiser-base)
;;; geiser-base.el ends here
diff --git a/elisp/geiser-completion.el b/elisp/geiser-completion.el
index c04cc34..0deb76c 100644
--- a/elisp/geiser-completion.el
+++ b/elisp/geiser-completion.el
@@ -81,7 +81,7 @@
nil nil nil
(or history
geiser-completion--symbol-history)
- (or default (symbol-at-point))))))
+ (or default (geiser--symbol-at-point))))))
(defvar geiser-completion--module-history nil)
diff --git a/elisp/geiser-doc.el b/elisp/geiser-doc.el
index 19e2075..e975484 100644
--- a/elisp/geiser-doc.el
+++ b/elisp/geiser-doc.el
@@ -310,9 +310,9 @@ help (e.g. browse an HTML page) implementing this method.")
"Get docstring for symbol at point.
With prefix argument, ask for symbol (with completion)."
(interactive "P")
- (let ((symbol (or (and (not arg) (symbol-at-point))
- (geiser-completion--read-symbol "Symbol: "
- (symbol-at-point)))))
+ (let ((symbol (or (and (not arg) (geiser--symbol-at-point))
+ (geiser-completion--read-symbol
+ "Symbol: " (geiser--symbol-at-point)))))
(when symbol (geiser-doc-symbol symbol))))
(defun geiser-doc-look-up-manual (&optional arg)
@@ -321,7 +321,7 @@ With prefix argument, ask for the lookup symbol (with completion)."
(interactive "P")
(unless (geiser-doc--manual-available-p)
(error "No manual available"))
- (let ((symbol (or (and (not arg) (symbol-at-point))
+ (let ((symbol (or (and (not arg) (geiser--symbol-at-point))
(geiser-completion--read-symbol "Symbol: "))))
(geiser-doc--external-help geiser-impl--implementation
symbol
@@ -453,7 +453,7 @@ With prefix, the current page is deleted from history."
("Refresh" ("g" "r") geiser-doc-refresh "Refresh current page")
--
("Edit symbol" ("." "\M-.") geiser-doc-edit-symbol-at-point
- :enable (symbol-at-point))
+ :enable (geiser--symbol-at-point))
--
("Kill item" "k" geiser-doc-kill-page "Kill this page")
("Clear history" "c" geiser-doc-clean-history)
diff --git a/elisp/geiser-edit.el b/elisp/geiser-edit.el
index 8c34c28..8fa979f 100644
--- a/elisp/geiser-edit.el
+++ b/elisp/geiser-edit.el
@@ -201,7 +201,7 @@ or following links in error buffers.")
"Opens a new window visiting the definition of the symbol at point.
With prefix, asks for the symbol to edit."
(interactive "P")
- (let* ((symbol (or (and (not arg) (symbol-at-point))
+ (let* ((symbol (or (and (not arg) (geiser--symbol-at-point))
(geiser-completion--read-symbol "Edit symbol: ")))
(cmd `(:eval (:ge symbol-location ',symbol)))
(marker (point-marker)))
diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el
index 9759c7b..a933963 100644
--- a/elisp/geiser-mode.el
+++ b/elisp/geiser-mode.el
@@ -281,7 +281,7 @@ interacting with the Geiser REPL is at your disposal.
("Definition" ("\C-c\C-m\C-x" "\C-c\C-mx") geiser-expand-definition))
--
("Symbol documentation" ("\C-c\C-d\C-d" "\C-c\C-dd")
- geiser-doc-symbol-at-point :enable (symbol-at-point))
+ geiser-doc-symbol-at-point :enable (geiser--symbol-at-point))
("Module documentation" ("\C-c\C-d\C-m" "\C-c\C-dm") geiser-doc-module)
("Symbol manual lookup" ("\C-c\C-d\C-i" "\C-c\C-di")
geiser-doc-look-up-manual :enable (geiser-doc--manual-available-p))
@@ -294,19 +294,21 @@ interacting with the Geiser REPL is at your disposal.
("Set Scheme..." "\C-c\C-s" geiser-set-scheme)
--
("Edit symbol at point" "\M-." geiser-edit-symbol-at-point
- :enable (symbol-at-point))
+ :enable (geiser--symbol-at-point))
("Go to previous definition" "\M-," geiser-pop-symbol-stack)
("Complete symbol" ((kbd "M-TAB")) completion-at-point
- :enable (symbol-at-point))
+ :enable (geiser--symbol-at-point))
("Complete module name" ((kbd "M-`") (kbd "C-."))
geiser-completion--complete-module)
("Edit module" ("\C-c\C-e\C-m" "\C-c\C-em") geiser-edit-module)
("Toggle ()/[]" ("\C-c\C-e\C-[" "\C-c\C-e[") geiser-squarify)
--
("Callers" ((kbd "C-c <")) geiser-xref-callers
- :enable (and (geiser-eval--supported-p 'callers) (symbol-at-point)))
+ :enable (and (geiser-eval--supported-p 'callers)
+ (geiser--symbol-at-point)))
("Callees" ((kbd "C-c >")) geiser-xref-callees
- :enable (and (geiser-eval--supported-p 'callees) (symbol-at-point)))
+ :enable (and (geiser-eval--supported-p 'callees)
+ (geiser--symbol-at-point)))
--
(mode "Smart TAB mode" nil geiser-smart-tab-mode)
--
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index 7c89df2..b9c47f5 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -520,11 +520,11 @@ buffer."
(geiser-menu--defmenu repl geiser-repl-mode-map
("Complete symbol" ((kbd "M-TAB"))
- geiser-repl--tab :enable (symbol-at-point))
+ geiser-repl--tab :enable (geiser--symbol-at-point))
("Complete module name" ((kbd "C-.") (kbd "M-`"))
- geiser-completion--complete-module :enable (symbol-at-point))
+ geiser-completion--complete-module :enable (geiser--symbol-at-point))
("Edit symbol" "\M-." geiser-edit-symbol-at-point
- :enable (symbol-at-point))
+ :enable (geiser--symbol-at-point))
--
("Switch to module..." "\C-c\C-m" switch-to-geiser-module)
("Import module..." "\C-c\C-i" geiser-repl-import-module)
@@ -539,9 +539,9 @@ buffer."
(mode "Autodoc mode" ("\C-c\C-da" "\C-c\C-d\C-a") geiser-autodoc-mode)
("Symbol documentation" ("\C-c\C-dd" "\C-c\C-d\C-d")
geiser-doc-symbol-at-point
- "Documentation for symbol at point" :enable (symbol-at-point))
+ "Documentation for symbol at point" :enable (geiser--symbol-at-point))
("Module documentation" ("\C-c\C-dm" "\C-c\C-d\C-m") geiser-repl--doc-module
- "Documentation for module at point" :enable (symbol-at-point))
+ "Documentation for module at point" :enable (geiser--symbol-at-point))
--
("Kill Scheme interpreter" "\C-c\C-q" geiser-repl-exit
:enable (geiser-repl--live-p))
diff --git a/elisp/geiser-xref.el b/elisp/geiser-xref.el
index a93b7a8..661c625 100644
--- a/elisp/geiser-xref.el
+++ b/elisp/geiser-xref.el
@@ -104,8 +104,8 @@
(goto-char (point-min)))
(defun geiser-xref--read-name (ask prompt)
- (let ((name (or (and (not ask) (symbol-at-point))
- (read-string prompt nil nil (symbol-at-point)))))
+ (let ((name (or (and (not ask) (geiser--symbol-at-point))
+ (read-string prompt nil nil (geiser--symbol-at-point)))))
(and name (format "%s" name))))
(defun geiser-xref--fetch-xrefs (ask kind rkind proc)