]> rhodes.io Git - swankr.git/commitdiff
Christophe Weblog Wiki Code Publications Music
some elisp code that slime/swankr users probably want
authorChristophe Rhodes <csr21@cantab.net>
Tue, 1 May 2012 14:20:55 +0000 (15:20 +0100)
committerChristophe Rhodes <csr21@cantab.net>
Tue, 1 May 2012 14:20:55 +0000 (15:20 +0100)
Should try to find out how to have it loaded automatically

swankr.el [new file with mode: 0644]

diff --git a/swankr.el b/swankr.el
new file mode 100644 (file)
index 0000000..9ddeeab
--- /dev/null
+++ b/swankr.el
@@ -0,0 +1,13 @@
+(require 'ess-help)
+
+(defun swankr-operator-before-point ()
+  (ignore-errors
+    (save-excursion
+      (backward-up-list 1)
+      (slime-symbol-at-point))))
+
+(add-hook 'R-mode-hook
+          (defun swankr/R-mode-hook ()
+            (slime-mode 1)
+            (set (make-local-variable 'slime-operator-before-point-function) 'swankr-operator-before-point)
+            (local-set-key (kbd "(") 'slime-space)))