emacs Jedi disable #

720 Views Asked by At

I have a working version of JEDI with Emacs 24.3 on osx. The autocomplete feature is wonderful, except for when I want to comment things out! I frequently comment/uncomment portions of my code and was hoping there was a way to prevent JEDI's auto completion from coming up when I type #. Any advice or thoughts would be greatly appreciated!

edit: When I go to comment multiple lines I enter in # typically followed by DownArrow and LeftArrow, but what usually happens with JEDI enabled is this dialog pops up preventing me from moving to the following line until I make a selection: dialog that pops up

3

There are 3 best solutions below

0
On

One way to get around this issue would be to select the lines (region) you would like to comment out and hit M-;. This runs the command comment-dwim which comments out the selected region (or uncomments it, if it is currently commented out).

When used in conjunction with e.g. mark-lines which allows you to select the current line with a single key stroke, this makes for a really fast way of (un)commenting portions of your code, even if they span just one or two lines.

0
On

emacs-jedi dev here. If emacs-jedi works as you describe, then that's a bug.

But I cannot say what is wrong from the limited information I have. So, just general directions:

  1. First, always try to reproduce the misbehavior in a clean Emacs setting, described here http://tkf.github.io/emacs-jedi/latest/#quick-try

    This helps you to find out if your setting is wrong or if it is actually a bug in emacs-jedi.

  2. Give the output of M-x jedi:show-version-info. http://tkf.github.io/emacs-jedi/latest/#jedi:show-version-info

    This helps people diagnosing the problem.

  3. This is a guess from your screenshot but it seems that you have old version of popup.el. So maybe auto-complete.el could be old one if you install them at the same time. If you don't see the problem in the clean Emacs (step 1. I mentioned above) which installs newest libraries, then updating them could solve the problem.

Update

So, I found a way to reproduce the behavior which is close to what you mentioned: https://github.com/tkf/emacs-jedi/issues/147

But as I wrote in the issue, I think it is a rare case. If you find a case which could happen very frequently, then let me know.

0
On

You can try to use company-jedi for your python completion. This package doesn't have this problem.