Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 643999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:20:37+00:00 2026-05-13T21:20:37+00:00

when I start swank through leiningen it accepts the next slime connection and off

  • 0

when I start swank through leiningen it accepts the next slime connection and off I go. I would really like to have several emacs instances connect to the same swank instance. Can I do this? can I do this through leiningen?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:20:37+00:00Added an answer on May 13, 2026 at 9:20 pm

    Well, you can start your first SLIME normally, then (require 'swank.swank) (or maybe it’s required by default… not sure), do (swank.swank/start-repl port) with port replaced by some port number and you can connect a second instance of SLIME to that newly created REPL.

    I’ve done it just now, with one Emacs connecting to a REPL started with lein swank, (swank.swank/start-repl 4006) in the first Emacs, M-x slime-connect in the second Emacs (providing 4006 as the port number), then I could do this:

    ; first Emacs 
    (def x 5)
    
    ; second Emacs
    x ; evaluates to 5
    (def y 1234)
    
    ; first Emacs
    y ; evaluates to 1234
    

    Cool, no? 🙂

    Update: Oh, BTW — (swank.swank/start-repl) starts the new REPL in the background and does not block the REPL you use to execute it. The return value is nil, so I’m not sure how to kill the new REPL…

    (Update 2: Removed something I’m no longer sure about.)

    Update 3: While the above method is perfectly general in that it makes it possible to connect an extra client regardless of how the original Swank instance has been started, it might be more convenient to start Swank with the command

    lein swank 4005 "localhost" :dont-close true
    

    The port and host name arguments must mentioned explicitly if :dont-close true is to be passed. 4005 and "localhost" are the default values.

    This will make it possible to disconnect from Swank and reconnect later, but also to connect a number of clients simultaneously.

    (I just noticed that this is possible while answering this new question on how to enable reconnections to Leiningen-started Swank; it suddenly occurred to me to check if :dont-close would also cause simultaneous connections to be accepted — and it does.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.