Browse files

Honor :swank-options from project.clj.

  • Loading branch information...
1 parent 6b274ff commit 8dbaeb99cba78fc8107930aca2f34ec3b2269d54 @technomancy committed Mar 2, 2012
Showing with 11 additions and 8 deletions.
  1. +11 −8 lein-swank/src/leiningen/swank.clj
@@ -2,12 +2,15 @@
"Launch swank server for Emacs to connect."
(:require [ :as io]))
-(defn opts-list [port host opts]
- (apply concat (merge {:host host :port (Integer. port)
- :repl-out-root true :block true}
- (apply hash-map (map read-string opts)))))
+(defn opts-list [project-opts port host cli-opts]
+ (apply concat (merge {:repl-out-root true :block true
+ :host "localhost" :port 4005}
+ project-opts
+ (apply hash-map (map read-string cli-opts))
+ (if host {:host host})
+ (if port {:port port}))))
-(defn swank-form [project port host opts]
+(defn swank-form [project port host cli-opts]
;; bootclasspath workaround:
(when (:eval-in-leiningen project)
(require '[clojure walk template stacktrace]))
@@ -20,7 +23,7 @@
(require '~'swank.swank)
(require '~'swank.commands.basic)
(@(ns-resolve '~'swank.swank '~'start-server)
- ~@(opts-list port host opts))))
+ ~@(opts-list (:swank-options project) port host cli-opts))))
(def ^{:private true} jvm-opts
@@ -65,5 +68,5 @@
(eval-in-project (update-in (add-cdt-project-args project)
[:dependencies] conj ['swank-clojure "1.4.0"])
(swank-form project port host opts)))
- ([project port] (swank project port "localhost"))
- ([project] (swank project 4005)))
+ ([project port] (swank project port nil))
+ ([project] (swank project nil)))

0 comments on commit 8dbaeb9

Please sign in to comment.