2

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

tkf
  • 2,990
  • 18
  • 32
Robert
  • 129
  • 1
  • 1
  • 6
  • I do not get auto-completion in comments, what is the value of the variable `ac-disable-faces`? Just do `C-h v`ac-disable-faces`RET` emacs will pop up a help buffer with the variable's value. –  Mar 19 '14 at 13:27
  • I apologize for the previous comment, I had JEDI disabled so I wan't getting a value returned. Here is the result: ac-disable-faces is a variable defined in `auto-complete.el'. Its value is (font-lock-comment-face font-lock-string-face font-lock-doc-face) Documentation: Non-nil means disable automatic completion on specified faces. You can customize this variable. [back] – Robert Mar 19 '14 at 15:34
  • I just updated jedi and I observe the behavior you have reported. This seems to be a bug introduced due to some recent changes. This should reported to the emacs-jedi developers –  Mar 19 '14 at 16:03
  • Not exactly a solution but a workaround can be to set `ac-delay` to a larger value, default value is 0.1 that is completion is started after 0.1 seconds. Set it to a larger value (say 0.7) like so `(setq ac-delay 0.7)` this might help. –  Mar 19 '14 at 16:32

3 Answers3

2

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

proofit404
  • 281
  • 1
  • 13
0

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.

itsjeyd
  • 5,070
  • 2
  • 30
  • 49
0

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.

tkf
  • 2,990
  • 18
  • 32