Skip to content

Instantly share code, notes, and snippets.

@kingtim
kingtim / eval_in_emacs.clj
Last active December 10, 2015 23:09
Prototype nrepl middleware for eval-in-emacs.
(ns org.kingtim.eval-in-emacs
(:require
[clojure.tools.nrepl.transport :as transport]
[clojure.tools.nrepl.middleware :refer [set-descriptor!]]
[clojure.tools.nrepl.middleware.session :refer [session]]
[clojure.tools.nrepl.misc :refer [response-for]])
(:import clojure.tools.nrepl.transport.Transport))
(def transports (atom {}))
@kingtim
kingtim / xxx.el
Created December 21, 2012 00:39
Some random clojure/nrepl emacs lisp that I hacked together today which could be useful.
;(define-key clojure-mode-map (kbd "C-c ;") 'nrepl-insert-balanced-comments)
;(define-key clojure-mode-map (kbd "C-c M-;") 'nrepl-remove-balanced-comments)
; inspired by http://bc.tech.coop/blog/070122.html
; ported from slime/contrib/slime-editing-commands.el
(defun nrepl-insert-reader-comment (prefix)
"Insert a reader comment (#_) around the s-expression containing the point.
If this command is invoked repeatedly (without any other command
occurring between invocations), the comment progressively moves outward
over enclosing expressions. If invoked with a positive prefix argument,
@kingtim
kingtim / gist:1553368
Created January 3, 2012 03:43
jruby-launcher spec failure
kingtim@tumult:~/workspace/jruby/lib/ruby/gems/1.8/gems/jruby-launcher-1.0.9-java$ ~/workspace/jruby/bin/jruby -S rspec ./spec/launcher_spec.rb
*** glibc detected *** /home/kingtim/workspace/jruby/lib/ruby/gems/1.8/gems/jruby-launcher-1.0.9-java/build/home/bin/jruby: free(): invalid pointer: 0x0930a4d0 ***
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x6ebc2)[0xb755ebc2]
/lib/i386-linux-gnu/libc.so.6(+0x6f862)[0xb755f862]
/lib/i386-linux-gnu/libc.so.6(cfree+0x6d)[0xb756294d]
/usr/lib/i386-linux-gnu/libstdc++.so.6(_ZdlPv+0x1f)[0xb773880f]
/usr/lib/i386-linux-gnu/libstdc++.so.6(_ZNSs4_Rep10_M_destroyERKSaIcE+0x1b)[0xb771fc4b]
/home/kingtim/workspace/jruby/lib/ruby/gems/1.8/gems/jruby-launcher-1.0.9-java/build/home/bin/jruby[0x804b9df]
/home/kingtim/workspace/jruby/lib/ruby/gems/1.8/gems/jruby-launcher-1.0.9-java/build/home/bin/jruby[0x80496f3]