Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple jshint-mode servers to run simultaneously (allows multiple emacs windows) #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

init-js
Copy link

@init-js init-js commented Oct 17, 2014

The first flymake-jshint starts a server on the base port (3003), but subsequent windows (either in console or graphical mode) fail to enable flymake-jshint due to the port being already in use. Reusing the same server for all lint request would work only as long as the initial window is kept open (flymake processes are cleaned up on exit).

This pull request changes it so that each window starts its own server on the first available port in a range (3003 to 3100). At the time the node process is started in emacs, the port is not known, so there is a bit of emacs lisp code in there to extract the port from the subprocess' stdout. The end result is that multiple emacs windows open can all benefit from the syntax checking.

(heads up: the branch also has a commit to close issue #32)

   Patch fs to get missing existsSync.
… port)

  Allows multiple emacs programs to be open and benefit from jshint-mode
  at the same time. A server is started on the lowest unused port in the
  (configurable) range 3003 to 3100.

  The server gets a new argument --lastport INT. The flymake-hook filters
  stdout for the "Server started" message and extracts the port from there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant