Browse files

fix classpath setup to work with .emacs customization, swank-clojure-…

…project, and EVERYTHING
  • Loading branch information...
1 parent 7c7ecdd commit ffeafa47479f73bb62d6eec6ec11b9bd66271fb7 @shoover shoover committed Dec 31, 2009
Showing with 18 additions and 10 deletions.
  1. +18 −10 default.el
28 default.el
@@ -30,28 +30,36 @@
(add-to-list 'load-path (concat clojure-home "clojure-mode/"))
(require 'clojure-mode)
- (add-to-list 'load-path (concat clojure-home "swank-clojure/"))
- (setq swank-clojure-jar-home (concat clojure-home "lib"))
- (require 'swank-clojure)
- ;; The user may setq this in ~/.emacs. By now it's either defined there
- ;; or in the require call above, so it's safe to add.
- (add-to-list 'swank-clojure-classpath
- (concat clojure-home "swank-clojure/src"))
;; swank-clojure-project expects every dependency to live under the
;; project. Clojure Box users may not be up to speed with Leiningen
;; so we append whatever the initial classpath was onto what
;; swank-clojure-project thinks the classpath should be. Project
;; jars and dirs come first, then initial swank-clojure-classpath
;; stuff, so the project can always override the Clojure version or
;; swank or anything else.
- (defvar clojure-box-initial-classpath swank-clojure-classpath)
+ (defvar clojure-box-initial-classpath nil)
+ (defadvice swank-clojure-project (before init-clojure-box-classpath)
+ (setq clojure-box-initial-classpath swank-clojure-classpath))
(add-hook 'swank-clojure-project-hook
(lambda ()
(setq swank-clojure-classpath
(append swank-clojure-classpath
+ (add-to-list 'load-path (concat clojure-home "swank-clojure/"))
+ (setq swank-clojure-jar-home (concat clojure-home "lib"))
+ (require 'swank-clojure)
+ ;; Classpath hackery. The user may setq this in ~/.emacs for
+ ;; personal jars and dirs. If not, swank-clojure sets up the
+ ;; defaults. Here we make sure the defaults are added to the end if
+ ;; the user set the variable, in case they didn't add everything we
+ ;; need.
+ (dolist (item (swank-clojure-default-classpath))
+ (add-to-list 'swank-clojure-classpath item 'append))
+ ;; And of course we need our swank sources in there.
+ (add-to-list 'swank-clojure-classpath
+ (concat clojure-home "swank-clojure/src"))
;; Start the REPL

0 comments on commit ffeafa4

Please sign in to comment.