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

Python layer: fix the problem of ipython hanging on windows #2075

Closed
wants to merge 3 commits into from

Conversation

yqu212
Copy link
Contributor

@yqu212 yqu212 commented Jun 22, 2015

ipython hangs when called on windows. I reconfigure the python-shell-interpreter and python-shell-interpreter-args to run ipython on windows properly according to the suggestion from http://emacswiki.org/emacs/PythonProgrammingInEmacs, i.e.,

(setq python-shell-interpreter "python")
(setq python-shell-interpreter-args "-i c:\\python27\\scripts\\ipython-script.py")

python-shell-completion-string-code "';'.join(get_ipython().Completer.all_completions('''%s'''))\n")
(if (system-is-mswindows)
(setq python-shell-interpreter "python"
python-shell-interpreter-args "-i c:\\python27\\scripts\\ipython-script.py"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not a good idea to hardcode this since this is python version specific. Maybe a variable should be introduced, and the background explained in the readme.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I should have introduced a variable to hold the real path of ipython-script.py. However, I'm not familiar with elisp since I'm new to it. Can you help me?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK any variable listed in the :variables keyword for a layer is available to use. See e.g. the python-test-runner variable https://github.com/syl20bnr/spacemacs/blob/develop/contrib/!lang/python/packages.el#L129

You should be able to introduce a variable and then just use it instead of the text. You also want to set a default like this in the config.el file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the relative path to ipython-script.py with

(concat "-i " (file-name-directory (executable-find "ipython")) "ipython-script.py").

@syl20bnr
Copy link
Owner

@yqu212 thank you for the PR, is this PR still needed in 0.104 and above ? If yes, can you rebase this PR against last develop ?

@yqu212
Copy link
Contributor Author

yqu212 commented Oct 29, 2015

No. The problem seems to have been solved in 0.104. However, there is another problem of ipython which do not display correctly on windows. The above-mentioned solution also works for the new problem. So, I will contribute a new PR later.

@syl20bnr
Copy link
Owner

@yqu212 thanks 👍

@StreakyCobra
Copy link
Contributor

As the original poster is going to contribute a new PR, I'm closing this one.

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.

4 participants