Skip to content

Commit 81946cc

Browse files
committed
Merge branch 'release/0.1.7'
2 parents 75c9781 + 1ce2343 commit 81946cc

File tree

97 files changed

+870
-587
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+870
-587
lines changed

README.md

Lines changed: 69 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,67 @@
1-
# swank-clj
1+
# ritz
22

3-
Refactored swank-clojure, with jpda debugging support.
3+
Ritz is a swank server for running [clojure](http://clojure.org) in
4+
[slime](http://common-lisp.net/project/slime).
5+
6+
Ritz was originally based on
7+
[swank-clojure](http://github.com/technomancy/swank-clojure) and was
8+
originally called swank-clj. The last swank-clj release is 0.1.6.
49

510
This is alpha quality.
611

7-
- Breaks on uncaught exceptions and breakpoints.
12+
## Features
13+
14+
- Break on uncaught exceptions and breakpoints.
815
- Allows stepping from breakpoints
916
- Allows evaluation of expressions in the context of a stack frame
1017
- Inspection of locals in any stack frame
1118
- Disassembly of functions from symbol or stack frame
1219

13-
Should work with clojure 1.3.0-alpha7.
20+
Should work with clojure 1.2.0, 1.2.1 and 1.3.0-alpha7.
1421

1522
## Install
1623

17-
Add `[swank-clj "0.1.6"]` to your project.clj `:dev-dependencies`.
24+
### SLIME
1825

19-
Install the slime-clj.el contrib from [marmalade](http://marmalade-repo.org/).
26+
Install the slime-ritz.el contrib from [marmalade](http://marmalade-repo.org/).
2027

2128
A compatible slime.el is in slime/slime.el. It is available as a `package.el`
2229
package file you can
23-
[download](https://github.com/downloads/hugoduncan/swank-clj/slime-20101113.1.tar)
30+
[download](https://github.com/downloads/pallet/ritz/slime-20101113.1.tar)
2431
and install with `M-x package-install-file`. Note that you may need to remove
2532
this package to use
2633
[swank-clojure](https://github.com/technomancy/swank-clojure) again.
2734

35+
### Lein/Cake Project
36+
37+
Add `[ritz "0.1.7"]` to your project.clj `:dev-dependencies`.
38+
39+
### Lein Plugin
40+
41+
Run `lein plugin install ritz 0.1.7`.
42+
43+
### Maven Plugin
44+
45+
See [zi](https://github.com/pallet/zi).
46+
47+
### Sun/Oracle JDK
48+
49+
To use the Sun/Oracle JDK, you
50+
[need to add](http://download.oracle.com/javase/1.5.0/docs/tooldocs/findingclasses.html)
51+
`tools.jar` from your JDK install to your classpath. If you are using maven then
52+
there are
53+
[instructions in the FAQ](http://maven.apache.org/general.html#tools-jar-dependency).
54+
55+
For cake, add the following (with the correct jdk path), to
56+
`PROJECT_ROOT/.cake/config`:
57+
project.classpath = /usr/lib/jvm/java-6-sun/lib/tools.jar
58+
59+
For lein, add the tools.jar to the dev-resources-path:
60+
61+
:dev-resources-path "/usr/lib/jvm/java-6-sun/lib/tools.jar"
62+
63+
### Source Browsing
64+
2865
If you would like to browse into the clojure java sources then add the following
2966
to your `:dev-dependencies`, with the appropriate clojure version.
3067

@@ -34,19 +71,28 @@ For clojure 1.2.0, you will need the following instead:
3471

3572
[clojure-source "1.2.0"]
3673

74+
To be able to see Java sources when using openjdk, add the `src.zip` to you
75+
classpath. e.g. for lein:
76+
77+
:dev-resources-path "/usr/lib/jvm/java-6-openjdk/src.zip"
78+
3779
## Usage
3880

3981
To run with jpda:
4082

41-
lein swank-clj
83+
lein ritz
4284

4385
To run without jpda:
4486

45-
lein swank-clj 4005 localhost :server-ns swank-clj.repl
87+
lein ritz 4005 localhost :server-ns ritz.repl
88+
89+
To run with a maven project:
90+
91+
mvn zi:ritz
4692

4793
### Breakpoints
4894

49-
To set a breakpoint, eval `swank-clj.el` from src/main/elisp, put the cursor
95+
To set a breakpoint, eval `ritz.el` from src/main/elisp, put the cursor
5096
on the line where you want a breakpoint, and `M-x slime-line-breakpoint`.
5197

5298
Note that breakpoints disappear on recompilation at the moment.
@@ -63,15 +109,22 @@ To list breakpoints, use `M-x slime-list-breakpoints` or press `b` in the
63109
### Javadoc
64110

65111
Specify the location of local javadoc using `slime-javadoc-local-paths` in
66-
your `.emacs` file.
112+
your `.emacs` file. Note that this requires a connection, so should be in
113+
your `slime-connected-hook` or `ritz-connected-hook`. e.g.
114+
115+
(defun my-javadoc-setup ()
116+
(slime-javadoc-local-paths
117+
(list (concat (expand-file-name "~") "/lisp/docs/java"))))
67118

68-
`slime-javadoc`, bound to `C-c b` by default, will open javadoc in the
69-
browser you have set up in emacs.
119+
(add-hook 'slime-connected-hook 'my-javadoc-setup)
120+
121+
The command `slime-javadoc`, bound to `C-c b` by default, will open javadoc in
122+
the browser you have set up in emacs.
70123

71124
### SLIME configuration
72125

73126
If you use slime with multiple lisps, you can isolate clojure specific
74-
setup by using `slime-clj-connected-hook` and `slime-clj-repl-mode-hook`.
127+
setup by using `ritz-connected-hook` and `ritz-repl-mode-hook`.
75128

76129
## Open Problems
77130

@@ -81,6 +134,8 @@ the old code. Setting breakpoints by line number finds all the old code too.
81134

82135
## Roadmap
83136

137+
Allow customisations of which exceptions are trapped by ritz.
138+
84139
A pure JDI backend, that doesn't require swank in the target VM is certainly a
85140
possibility.
86141

ReleaseNotes.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
# Release Notes
22

3-
Current release is 0.1.6.
3+
Current release is 0.1.7.
4+
5+
* 0.1.7
6+
7+
- Add missing require for clojure.main
8+
9+
- Rename swank-clj to ritz
10+
11+
- Update cake task to use flatland/useful, since cake removed its cake.utils
12+
namespace.
13+
14+
- Improve the condition message to show keys for contrib.Condition
15+
Extra information is often attached to a Condition, and it is useful to
16+
be able to see this in the sldb trace.
17+
18+
- Ensure autodoc doesn't error on invalid symbols
19+
20+
- Implement slime autodoc
21+
422

523
* 0.1.6
624

build-elpa-package.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ dest="slime-$VERSION"
1414
rm -rf "marmalade/$dest" "marmalade/slime"
1515
find slime | cpio -pd marmalade
1616

17-
# remove the slime-clj contrib
18-
rm -f marmalade/slime/contrib/slime-clj.el
17+
# remove the ritz contrib
18+
rm -f marmalade/slime/contrib/ritz.el
1919

2020
# add an elpa style header
2121
sed -i .bak \

finish-release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ echo -n "commiting project.clj, release notes and readme. enter to continue:" \
1919
&& lein test \
2020
&& lein jar, pom \
2121
&& git flow release finish $version \
22-
&& scp swank-clj-${version}.jar pom.xml clojars: \
22+
&& scp ritz-${version}.jar pom.xml clojars: \
2323
&& bash build-elpa-package.sh \
2424
&& echo "Now push and upload to github and marmalade"
2525

project.clj

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
(defproject swank-clj "0.1.6"
2-
:description "Another swank for clojure"
1+
(defproject ritz "0.1.7"
2+
:description "Another swank server for clojure in SLIME"
33
:source-path "src/main/clojure"
44
:resources-path "src/main/resources"
55
:test-path "src/test/clojure"
6-
;; :aot [swank-clj.main]
7-
:dependencies [[org.clojure/clojure "1.2.0"]]
8-
:dev-dependencies [[swank-clojure "1.2.1"]
9-
[lein-swank-clj "1.0.0-SNAPSHOT"]
10-
[clojure-source "1.2.0"]]
6+
:dependencies [[org.clojure/clojure "1.2.1"]
7+
[useful "0.4.0"]]
8+
:dev-dependencies [[org.clojure/clojure "1.2.1" :classifier "sources"]
9+
[lein-multi "1.0.0"]]
10+
:multi-deps {"1.2.0" [[org.clojure/clojure "1.2.0"]
11+
[clojure-source "1.2.0"]]
12+
"1.3" [[org.clojure/clojure "1.3.0-master-SNAPSHOT"]
13+
[org.clojure/clojure "1.3.0-master-SNAPSHOT"
14+
:classifier "sources"]]
15+
"1.3.0-alpha8" [[org.clojure/clojure "1.3.0-alpha8"]
16+
[org.clojure/clojure "1.3.0-alpha8"
17+
:classifier "sources"]]}
1118
:repositories
1219
{"sonatype-snapshots" "https://oss.sonatype.org/content/repositories/snapshots"
1320
"sonatype" "https://oss.sonatype.org/content/repositories/releases/"}
14-
:tasks [cake.tasks.swank-clj])
21+
:tasks [cake.tasks.ritz])
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
(ns cake.tasks.swank-clj
2-
"A cake task for running swank-clj. Modified from cake.tasks.swank."
1+
(ns cake.tasks.ritz
2+
"A cake task for running ritz. Modified from cake.tasks.swank."
33
(:use cake cake.core
4-
[cake.utils.useful :only [if-ns]]
4+
[useful.utils :only [if-ns]]
55
[bake.core :only [current-context]]))
66

77
(def current-port (atom nil))
88

99
(defn- serve-swank
10-
"Run swank-clj connection thread in the project classloader."
10+
"Run ritz connection thread in the project classloader."
1111
[context options]
1212
(bake (:use [bake.core :only [set-context!]])
13-
(:require swank-clj.socket-server)
13+
(:require ritz.socket-server)
1414
[context context options options]
15-
(let [start (ns-resolve 'swank-clj.socket-server 'start)
15+
(let [start (ns-resolve 'ritz.socket-server 'start)
1616
opts {:encoding (or (System/getProperty "swank.encoding")
1717
"iso-latin-1-unix")}]
1818
(eval (:swank-init *project*))
1919
(set-context! context)
2020
(start (merge opts options)))))
2121

22-
(if-ns (:use [swank-clj.socket-server :only [start]])
22+
(if-ns (:use [ritz.socket-server :only [start]])
2323

2424
(defn start-swank [options]
2525
(let [out (with-out-str (serve-swank (current-context) options))]
@@ -29,15 +29,15 @@
2929
(println "started swank-clojure server on port" @current-port)))))
3030

3131
(defn start-swank [host]
32-
(println "error loading swank-clj.")
32+
(println "error loading ritz.")
3333
(println
3434
"see http://clojure-cake.org/swank for installation instructions")))
3535

36-
(deftask swank-clj #{compile-java}
37-
"Report status of swank-clj server and start it if not running."
38-
{opts :swank-clj}
36+
(deftask ritz #{compile-java}
37+
"Report status of ritz server and start it if not running."
38+
{opts :ritz}
3939
(if @current-port
40-
(println "swank-clj currently running on port" @current-port)
40+
(println "ritz currently running on port" @current-port)
4141
(let [[host port & {:as options}] opts]
4242
(start-swank (merge {:host (or host "localhost")
4343
:port (or port 4005)}
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
(ns leiningen.swank-clj
1+
(ns leiningen.ritz
22
(:use [leiningen.compile :only [eval-in-project]]))
33

4-
(defn swank-clj
4+
(defn ritz
55
"Launch swank server for Emacs to connect. Optionally takes PORT and HOST."
66
([project port host & {:as opts}]
77
(eval-in-project
88
project
9-
`(do (require '~'swank-clj.socket-server)
9+
`(do (require '~'ritz.socket-server)
1010
(import '~'java.io.File)
1111
(binding [*compile-path* ~(.getAbsolutePath
1212
(java.io.File.
1313
(or (:compile-path project)
1414
"./classes")))]
15-
(@(ns-resolve '~'swank-clj.socket-server '~'start)
15+
(@(ns-resolve '~'ritz.socket-server '~'start)
1616
'~(merge
1717
(zipmap
1818
(map read-string (keys opts))
1919
(map read-string (vals opts)))
2020
{:port (Integer. port) :host host}))))))
21-
([project port] (swank-clj project port "localhost"))
22-
([project] (swank-clj project 4005)))
21+
([project port] (ritz project port "localhost"))
22+
([project] (ritz project 4005)))

src/main/clojure/swank_clj/clj_contrib/macroexpand.clj renamed to src/main/clojure/ritz/clj_contrib/macroexpand.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(ns swank-clj.clj-contrib.macroexpand)
1+
(ns ritz.clj-contrib.macroexpand)
22

33
(def
44
^{:private true}

src/main/clojure/swank_clj/commands/basic.clj renamed to src/main/clojure/ritz/commands/basic.clj

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1-
(ns swank-clj.commands.basic
1+
(ns ritz.commands.basic
22
(:refer-clojure :exclude [load-file])
33
(:use
4-
[swank-clj.swank.commands :only [defslimefn]])
4+
[ritz.swank.commands :only [defslimefn]])
55
(:require
6-
[swank-clj.clj-contrib.macroexpand :as macroexpand]
7-
[swank-clj.connection :as connection]
8-
[swank-clj.logging :as logging]
9-
[swank-clj.repl-utils.compile :as compile]
10-
[swank-clj.repl-utils.doc :as doc]
11-
[swank-clj.repl-utils.find :as find]
12-
[swank-clj.repl-utils.format :as format]
13-
[swank-clj.repl-utils.helpers :as helpers]
14-
[swank-clj.repl-utils.sys :as sys]
15-
[swank-clj.repl-utils.trace :as trace]
16-
[swank-clj.swank.core :as core]
17-
[swank-clj.swank.messages :as messages]
18-
[swank-clj.swank.utils :as utils]
6+
[ritz.clj-contrib.macroexpand :as macroexpand]
7+
[ritz.connection :as connection]
8+
[ritz.logging :as logging]
9+
[ritz.repl-utils.arglist :as arglist]
10+
[ritz.repl-utils.compile :as compile]
11+
[ritz.repl-utils.doc :as doc]
12+
[ritz.repl-utils.find :as find]
13+
[ritz.repl-utils.format :as format]
14+
[ritz.repl-utils.helpers :as helpers]
15+
[ritz.repl-utils.sys :as sys]
16+
[ritz.repl-utils.trace :as trace]
17+
[ritz.swank.core :as core]
18+
[ritz.swank.messages :as messages]
19+
[ritz.swank.utils :as utils]
1920
[clojure.string :as string])
2021
(:import
2122
(java.io StringReader File)
2223
(java.util.zip ZipFile)
2324
(clojure.lang LineNumberingPushbackReader)))
2425

25-
;; Note: For debugging purposes, keep bindings and with- macros out of commands,
26+
;; Note: For debugging purposes, keep bindings and with- macros out of commands
2627
;; as they create catch sites.
2728

2829
;;;; Connection
@@ -81,7 +82,7 @@
8182
(if exception
8283
(do
8384
(.printStackTrace exception)
84-
[:swank-clj.swank/abort exception])
85+
[:ritz.swank/abort exception])
8586
(connection/send-to-emacs connection (messages/repl-result result)))))
8687

8788
(defmacro with-out-str-and-value
@@ -272,7 +273,10 @@
272273
;;;; Operator messages
273274
(defslimefn operator-arglist [connection name package]
274275
(try
275-
(doc/arglist (read-string name) (utils/maybe-ns package))
276+
(logging/trace "operator-arglist %s %s" name package)
277+
(when-let [arglist (arglist/arglist
278+
(read-string name) (utils/maybe-ns package))]
279+
(pr-str arglist))
276280
(catch Throwable t nil)))
277281

278282
;;;; Package Commands

src/main/clojure/swank_clj/commands/completion.clj renamed to src/main/clojure/ritz/commands/completion.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
(ns swank-clj.commands.completion
1+
(ns ritz.commands.completion
22
"Symbol completion commands"
33
(:use
4-
[swank-clj.swank.commands :only [defslimefn]])
4+
[ritz.swank.commands :only [defslimefn]])
55
(:require
6-
[swank-clj.repl-utils.completion :as completion]))
6+
[ritz.repl-utils.completion :as completion]))
77

88
(defslimefn simple-completions [connection symbol-string package]
99
(try

0 commit comments

Comments
 (0)