Skip to content

Commit

Permalink
Merge pull request clojure-emacs#26 from edw/master
Browse files Browse the repository at this point in the history
Help clojure-mode pick unique-ish swank port numbers.

Avoid port conflicts if the random number generator hasn't been seeded.
  • Loading branch information
technomancy committed Jun 29, 2011
2 parents f93f26f + 42292ec commit a1e8d26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clojure-mode.el
Expand Up @@ -847,7 +847,7 @@ use (put-clojure-indent 'some-symbol 'defun)."
(defun clojure-jack-in ()
(interactive)
;; graaaahhhh--no closures in elisp (23)
(setq clojure-swank-port (+ 1024 (* (random 64512)))
(setq clojure-swank-port (- 65535 (mod (caddr (current-time)) 4096))
slime-net-coding-system 'utf-8-unix)

(let* ((swank-cmd (format clojure-swank-command clojure-swank-port))
Expand Down

0 comments on commit a1e8d26

Please sign in to comment.