Permalink
Browse files

Finish rename of swank-clj to ritz

  • Loading branch information...
hugoduncan committed Jul 3, 2011
1 parent baac7db commit 9d883eeb11f5568b6982383e10c791458fc2aca2
Showing with 360 additions and 849 deletions.
  1. +16 −8 README.md
  2. +2 −2 build-elpa-package.sh
  3. +1 −1 finish-release.sh
  4. +4 −7 project.clj
  5. +0 −44 src/main/clojure/cake/tasks/swank_clj.clj
  6. +0 −22 src/main/clojure/leiningen/swank_clj.clj
  7. +1 −1 src/main/clojure/ritz/clj_contrib/macroexpand.clj
  8. +18 −18 src/main/clojure/ritz/commands/basic.clj
  9. +3 −3 src/main/clojure/ritz/commands/completion.clj
  10. +6 −6 src/main/clojure/ritz/commands/contrib.clj
  11. +9 −9 src/main/clojure/ritz/commands/contrib/swank_arglists.clj
  12. +1 −1 src/main/clojure/ritz/commands/contrib/swank_c_p_c.clj
  13. +1 −1 src/main/clojure/ritz/commands/contrib/swank_c_p_c/internal.clj
  14. +0 −98 src/main/clojure/ritz/commands/contrib/swank_clj.clj
  15. +6 −6 src/main/clojure/ritz/commands/contrib/swank_fuzzy.clj
  16. +8 −8 src/main/clojure/ritz/commands/debugger.clj
  17. +5 −5 src/main/clojure/ritz/commands/inspector.clj
  18. +4 −4 src/main/clojure/ritz/commands/xref.clj
  19. +4 −4 src/main/clojure/ritz/connection.clj
  20. +2 −2 src/main/clojure/ritz/executor.clj
  21. +1 −1 src/main/clojure/ritz/hooks.clj
  22. +3 −3 src/main/clojure/ritz/inspect.clj
  23. +32 −32 src/main/clojure/ritz/jpda/debug.clj
  24. +2 −2 src/main/clojure/ritz/jpda/disassemble.clj
  25. +3 −3 src/main/clojure/ritz/jpda/jdi.clj
  26. +4 −4 src/main/clojure/ritz/jpda/jdi_clj.clj
  27. +3 −3 src/main/clojure/ritz/jpda/jdi_vm.clj
  28. +1 −1 src/main/clojure/ritz/logging.clj
  29. +3 −3 src/main/clojure/ritz/main.clj
  30. +15 −15 src/main/clojure/ritz/proxy.clj
  31. +10 −10 src/main/clojure/ritz/repl.clj
  32. +4 −4 src/main/clojure/ritz/repl_utils/arglist.clj
  33. +1 −1 src/main/clojure/ritz/repl_utils/class_browse.clj
  34. +1 −1 src/main/clojure/ritz/repl_utils/clojure.clj
  35. +1 −1 src/main/clojure/ritz/repl_utils/compile.clj
  36. +4 −4 src/main/clojure/ritz/repl_utils/completion.clj
  37. +3 −3 src/main/clojure/ritz/repl_utils/doc.clj
  38. +2 −2 src/main/clojure/ritz/repl_utils/find.clj
  39. +1 −1 src/main/clojure/ritz/repl_utils/format.clj
  40. +3 −3 src/main/clojure/ritz/repl_utils/fuzzy_completion.clj
  41. +1 −1 src/main/clojure/ritz/repl_utils/helpers.clj
  42. +1 −1 src/main/clojure/ritz/repl_utils/java.clj
  43. +1 −1 src/main/clojure/ritz/repl_utils/mangle.clj
  44. +1 −1 src/main/clojure/ritz/repl_utils/sys.clj
  45. +1 −1 src/main/clojure/ritz/repl_utils/trace.clj
  46. +3 −3 src/main/clojure/ritz/rpc.clj
  47. +5 −5 src/main/clojure/ritz/rpc_server.clj
  48. +3 −3 src/main/clojure/ritz/rpc_socket_connection.clj
  49. +5 −5 src/main/clojure/ritz/socket_server.clj
  50. +11 −11 src/main/clojure/ritz/swank.clj
  51. +4 −4 src/main/clojure/ritz/swank/cl.clj
  52. +6 −6 src/main/clojure/ritz/swank/commands.clj
  53. +9 −9 src/main/clojure/ritz/swank/core.clj
  54. +7 −7 src/main/clojure/ritz/swank/indent.clj
  55. +3 −3 src/main/clojure/ritz/swank/messages.clj
  56. +1 −1 src/main/clojure/ritz/swank/utils.clj
  57. +0 −262 src/main/elisp/slime-clj.el
  58. +4 −4 src/test/clojure/ritz/commands/basic_test.clj
  59. +4 −4 src/test/clojure/ritz/commands/completion_test.clj
  60. +0 −51 src/test/clojure/ritz/commands/contrib/swank_clj_test.clj
  61. +3 −3 src/test/clojure/ritz/commands/contrib/swank_fuzzy_test.clj
  62. +7 −7 src/test/clojure/ritz/commands/debugger_test.clj
  63. +6 −6 src/test/clojure/ritz/commands/inspector_test.clj
  64. +4 −4 src/test/clojure/ritz/connection_test.clj
  65. +3 −3 src/test/clojure/ritz/inspect_test.clj
  66. +10 −10 src/test/clojure/ritz/jpda/debug_test.clj
  67. +5 −5 src/test/clojure/ritz/jpda/disassemble_test.clj
  68. +5 −5 src/test/clojure/ritz/jpda/jdi_clj_test.clj
  69. +4 −4 src/test/clojure/ritz/jpda/jdi_vm_test.clj
  70. +6 −6 src/test/clojure/ritz/proxy_test.clj
  71. +2 −2 src/test/clojure/ritz/repl_utils/arglist_test.clj
  72. +2 −2 src/test/clojure/ritz/repl_utils/class_browse_test.clj
  73. +2 −2 src/test/clojure/ritz/repl_utils/completion_test.clj
  74. +3 −3 src/test/clojure/ritz/repl_utils/doc_test.clj
  75. +2 −2 src/test/clojure/ritz/repl_utils/find_test.clj
  76. +2 −2 src/test/clojure/ritz/repl_utils/format_test.clj
  77. +7 −7 src/test/clojure/ritz/repl_utils/fuzzy_completion_test.clj
  78. +2 −2 src/test/clojure/ritz/repl_utils/mangle_test.clj
  79. +4 −4 src/test/clojure/ritz/repl_utils/trace_test.clj
  80. +2 −2 src/test/clojure/ritz/rpc_server_test.clj
  81. +2 −2 src/test/clojure/ritz/rpc_test.clj
  82. +2 −2 src/test/clojure/ritz/swank/core_test.clj
  83. +4 −4 src/test/clojure/ritz/swank/indent_test.clj
  84. +2 −2 src/test/clojure/ritz/swank/utils_test.clj
  85. +6 −6 src/test/clojure/ritz/swank_test.clj
  86. +3 −3 src/test/clojure/ritz/test_utils.clj
  87. +2 −2 start-release.sh
  88. +0 −17 update-slime-clj-package-version.sh
View
@@ -1,20 +1,26 @@
-# swank-clj
+# ritz
-Refactored swank-clojure, with jpda debugging support.
+Ritz is a swank server for running [clojure](http://clojure.org) in
+[slime](http://common-lisp.net/project/slime).
+
+Ritz was originally based on
+[swank-clojure](http://github.com/technomancy/swank-clojure).
This is alpha quality.
-- Breaks on uncaught exceptions and breakpoints.
+## Features
+
+- Break on uncaught exceptions and breakpoints.
- Allows stepping from breakpoints
- Allows evaluation of expressions in the context of a stack frame
- Inspection of locals in any stack frame
- Disassembly of functions from symbol or stack frame
-Should work with clojure 1.3.0-alpha7.
+Should work with clojure 1.2.0, 1.2.1 and 1.3.0-alpha7.
## Install
-Add `[swank-clj "0.1.6"]` to your project.clj `:dev-dependencies`.
+Add `[ritz "0.1.6"]` to your project.clj `:dev-dependencies`.
Install the slime-clj.el contrib from [marmalade](http://marmalade-repo.org/).
@@ -57,15 +63,15 @@ classpath. e.g. for lein:
To run with jpda:
- lein swank-clj
+ lein ritz
To run without jpda:
- lein swank-clj 4005 localhost :server-ns swank-clj.repl
+ lein ritz 4005 localhost :server-ns ritz.repl
### Breakpoints
-To set a breakpoint, eval `swank-clj.el` from src/main/elisp, put the cursor
+To set a breakpoint, eval `ritz.el` from src/main/elisp, put the cursor
on the line where you want a breakpoint, and `M-x slime-line-breakpoint`.
Note that breakpoints disappear on recompilation at the moment.
@@ -107,6 +113,8 @@ the old code. Setting breakpoints by line number finds all the old code too.
## Roadmap
+Allow customisations of which exceptions are trapped by ritz.
+
A pure JDI backend, that doesn't require swank in the target VM is certainly a
possibility.
View
@@ -14,8 +14,8 @@ dest="slime-$VERSION"
rm -rf "marmalade/$dest" "marmalade/slime"
find slime | cpio -pd marmalade
-# remove the slime-clj contrib
-rm -f marmalade/slime/contrib/slime-clj.el
+# remove the ritz contrib
+rm -f marmalade/slime/contrib/ritz.el
# add an elpa style header
sed -i .bak \
View
@@ -19,7 +19,7 @@ echo -n "commiting project.clj, release notes and readme. enter to continue:" \
&& lein test \
&& lein jar, pom \
&& git flow release finish $version \
-&& scp swank-clj-${version}.jar pom.xml clojars: \
+&& scp ritz-${version}.jar pom.xml clojars: \
&& bash build-elpa-package.sh \
&& echo "Now push and upload to github and marmalade"
View
@@ -1,14 +1,11 @@
-(defproject swank-clj "0.1.7-SNAPSHOT"
- :description "Another swank for clojure"
+(defproject ritz "0.1.7-SNAPSHOT"
+ :description "Another swank server for clojure in SLIME"
:source-path "src/main/clojure"
:resources-path "src/main/resources"
:test-path "src/test/clojure"
- ;; :aot [swank-clj.main]
:dependencies [[org.clojure/clojure "1.2.1"]
[useful "0.4.0"]]
- :dev-dependencies [[swank-clojure "1.2.1"]
- [lein-swank-clj "1.0.0-SNAPSHOT"]
- [org.clojure/clojure "1.2.1" :classifier "sources"]
+ :dev-dependencies [[org.clojure/clojure "1.2.1" :classifier "sources"]
[lein-multi "1.0.0"]]
:multi-deps {"1.2.0" [[org.clojure/clojure "1.2.0"]
[clojure-source "1.2.0"]]
@@ -21,4 +18,4 @@
:repositories
{"sonatype-snapshots" "https://oss.sonatype.org/content/repositories/snapshots"
"sonatype" "https://oss.sonatype.org/content/repositories/releases/"}
- :tasks [cake.tasks.swank-clj])
+ :tasks [cake.tasks.ritz])
@@ -1,44 +0,0 @@
-(ns cake.tasks.swank-clj
- "A cake task for running swank-clj. Modified from cake.tasks.swank."
- (:use cake cake.core
- [useful.utils :only [if-ns]]
- [bake.core :only [current-context]]))
-
-(def current-port (atom nil))
-
-(defn- serve-swank
- "Run swank-clj connection thread in the project classloader."
- [context options]
- (bake (:use [bake.core :only [set-context!]])
- (:require swank-clj.socket-server)
- [context context options options]
- (let [start (ns-resolve 'swank-clj.socket-server 'start)
- opts {:encoding (or (System/getProperty "swank.encoding")
- "iso-latin-1-unix")}]
- (eval (:swank-init *project*))
- (set-context! context)
- (start (merge opts options)))))
-
-(if-ns (:use [swank-clj.socket-server :only [start]])
-
- (defn start-swank [options]
- (let [out (with-out-str (serve-swank (current-context) options))]
- (if (.contains out "java.net.BindException")
- (println "unable to start swank-clojure server, port already in use")
- (do (compare-and-set! current-port nil (:port options))
- (println "started swank-clojure server on port" @current-port)))))
-
- (defn start-swank [host]
- (println "error loading swank-clj.")
- (println
- "see http://clojure-cake.org/swank for installation instructions")))
-
-(deftask swank-clj #{compile-java}
- "Report status of swank-clj server and start it if not running."
- {opts :swank-clj}
- (if @current-port
- (println "swank-clj currently running on port" @current-port)
- (let [[host port & {:as options}] opts]
- (start-swank (merge {:host (or host "localhost")
- :port (or port 4005)}
- options)))))
@@ -1,22 +0,0 @@
-(ns leiningen.swank-clj
- (:use [leiningen.compile :only [eval-in-project]]))
-
-(defn swank-clj
- "Launch swank server for Emacs to connect. Optionally takes PORT and HOST."
- ([project port host & {:as opts}]
- (eval-in-project
- project
- `(do (require '~'swank-clj.socket-server)
- (import '~'java.io.File)
- (binding [*compile-path* ~(.getAbsolutePath
- (java.io.File.
- (or (:compile-path project)
- "./classes")))]
- (@(ns-resolve '~'swank-clj.socket-server '~'start)
- '~(merge
- (zipmap
- (map read-string (keys opts))
- (map read-string (vals opts)))
- {:port (Integer. port) :host host}))))))
- ([project port] (swank-clj project port "localhost"))
- ([project] (swank-clj project 4005)))
@@ -1,4 +1,4 @@
-(ns swank-clj.clj-contrib.macroexpand)
+(ns ritz.clj-contrib.macroexpand)
(def
^{:private true}
@@ -1,29 +1,29 @@
-(ns swank-clj.commands.basic
+(ns ritz.commands.basic
(:refer-clojure :exclude [load-file])
(:use
- [swank-clj.swank.commands :only [defslimefn]])
+ [ritz.swank.commands :only [defslimefn]])
(:require
- [swank-clj.clj-contrib.macroexpand :as macroexpand]
- [swank-clj.connection :as connection]
- [swank-clj.logging :as logging]
- [swank-clj.repl-utils.arglist :as arglist]
- [swank-clj.repl-utils.compile :as compile]
- [swank-clj.repl-utils.doc :as doc]
- [swank-clj.repl-utils.find :as find]
- [swank-clj.repl-utils.format :as format]
- [swank-clj.repl-utils.helpers :as helpers]
- [swank-clj.repl-utils.sys :as sys]
- [swank-clj.repl-utils.trace :as trace]
- [swank-clj.swank.core :as core]
- [swank-clj.swank.messages :as messages]
- [swank-clj.swank.utils :as utils]
+ [ritz.clj-contrib.macroexpand :as macroexpand]
+ [ritz.connection :as connection]
+ [ritz.logging :as logging]
+ [ritz.repl-utils.arglist :as arglist]
+ [ritz.repl-utils.compile :as compile]
+ [ritz.repl-utils.doc :as doc]
+ [ritz.repl-utils.find :as find]
+ [ritz.repl-utils.format :as format]
+ [ritz.repl-utils.helpers :as helpers]
+ [ritz.repl-utils.sys :as sys]
+ [ritz.repl-utils.trace :as trace]
+ [ritz.swank.core :as core]
+ [ritz.swank.messages :as messages]
+ [ritz.swank.utils :as utils]
[clojure.string :as string])
(:import
(java.io StringReader File)
(java.util.zip ZipFile)
(clojure.lang LineNumberingPushbackReader)))
-;; Note: For debugging purposes, keep bindings and with- macros out of commands,
+;; Note: For debugging purposes, keep bindings and with- macros out of commands
;; as they create catch sites.
;;;; Connection
@@ -82,7 +82,7 @@
(if exception
(do
(.printStackTrace exception)
- [:swank-clj.swank/abort exception])
+ [:ritz.swank/abort exception])
(connection/send-to-emacs connection (messages/repl-result result)))))
(defmacro with-out-str-and-value
@@ -1,9 +1,9 @@
-(ns swank-clj.commands.completion
+(ns ritz.commands.completion
"Symbol completion commands"
(:use
- [swank-clj.swank.commands :only [defslimefn]])
+ [ritz.swank.commands :only [defslimefn]])
(:require
- [swank-clj.repl-utils.completion :as completion]))
+ [ritz.repl-utils.completion :as completion]))
(defslimefn simple-completions [connection symbol-string package]
(try
@@ -1,14 +1,14 @@
-(ns swank-clj.commands.contrib
+(ns ritz.commands.contrib
(:use
- [swank-clj.logging :as logging]
- [swank-clj.repl-utils.helpers :as helpers]
- [swank-clj.swank.commands :only [defslimefn]]))
+ [ritz.logging :as logging]
+ [ritz.repl-utils.helpers :as helpers]
+ [ritz.swank.commands :only [defslimefn]]))
(defslimefn swank-require [connection keys]
- (binding [*ns* (the-ns 'swank-clj.commands.contrib)]
+ (binding [*ns* (the-ns 'ritz.commands.contrib)]
(doseq [k (if (seq? keys) keys (list keys))]
(try
- (require (symbol (str "swank-clj.commands.contrib." (name k))))
+ (require (symbol (str "ritz.commands.contrib." (name k))))
(catch java.io.FileNotFoundException e
(logging/trace
"Exception: %s\n%s" e (helpers/stack-trace-string e)))
@@ -1,13 +1,13 @@
-(ns swank-clj.commands.contrib.swank-arglists
+(ns ritz.commands.contrib.swank-arglists
(:use
- [swank-clj.swank.commands :only [defslimefn]])
+ [ritz.swank.commands :only [defslimefn]])
(:require
- [swank-clj.commands.basic :as basic]
- [swank-clj.connection :as connection]
- [swank-clj.logging :as logging]
- [swank-clj.repl-utils.arglist :as arglist]
- [swank-clj.swank.utils :as utils]
- [swank-clj.swank.commands :as commands]))
+ [ritz.commands.basic :as basic]
+ [ritz.connection :as connection]
+ [ritz.logging :as logging]
+ [ritz.repl-utils.arglist :as arglist]
+ [ritz.swank.utils :as utils]
+ [ritz.swank.commands :as commands]))
(defn position-in-arglist? [arglist pos]
@@ -64,7 +64,7 @@ TODO: The highlighted parameter is wrapped in ===> X <===."
(logging/trace "swank-arglists/autodoc")
(if (and raw-specs (seq? raw-specs))
(if-let [[arglists index] (arglist/arglist-at-terminal
- raw-specs :swank-clj/cursor-marker
+ raw-specs :ritz/cursor-marker
(connection/request-ns connection))]
(message-format raw-specs arglists index)
`:not-available)
@@ -1,4 +1,4 @@
-(ns swank-clj.commands.contrib.swank-c-p-c
+(ns ritz.commands.contrib.swank-c-p-c
(:use (swank util core commands)
(swank.commands completion)
(swank.util string clojure)
@@ -1,4 +1,4 @@
-(ns swank-clj.commands.contrib.swank-c-p-c.internal
+(ns ritz.commands.contrib.swank-c-p-c.internal
(:use (swank util core commands)
(swank.commands completion)
(swank.util string clojure)))
Oops, something went wrong.

0 comments on commit 9d883ee

Please sign in to comment.