pythonic-emacs / anaconda-mode

Code navigation, documentation lookup and completion for Python.
GNU General Public License v3.0
707 stars 87 forks source link

error in process filter: Quit when exiting completion with Ivy #342

Open dragoonpilot opened 5 years ago

dragoonpilot commented 5 years ago

Hello,

After triggering a completion with Ivy completion-at-point and exiting without selecting a candidate, there is an "error in process filter: Quit" message in the echo area along with a ~2 second hang where I am unable to do anything.

Here is my entire init.el:

(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
                    (not (gnutls-available-p))))
       (proto (if no-ssl "http" "https")))
  (when no-ssl
    (warn "\
Your version of Emacs does not support SSL connections,
which is unsafe because it allows man-in-the-middle attacks.
There are two things you can do about this warning:
1. Install an Emacs version that does support SSL and be safe.
2. Remove this warning from your init file so you won't see it again."))
  ;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
  (add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
  ;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
  (when (< emacs-major-version 24)
    ;; For important compatibility libraries like cl-lib
    (add-to-list 'package-archives (cons "gnu" (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)
(require 'ivy)
(require 'anaconda-mode)
(ivy-mode 1)
(pythonic-activate "/path/to/venv")
(add-hook 'python-mode-hook 'anaconda-mode)

Steps:

  1. Trigger a completion with C-M-i. I am able to see candidates and scroll through them with C-n and C-p.
  2. Exit the completion without selecting a candidate by pressing ESC 3 times or C-[ 3 times.
  3. "error in process filter: Quit" is shown in echo area. Emacs is frozen for 2-3 seconds.

Everything works fine if I select a candidate with C-m and exit the completion normally.

*anaconda-mode* buffer contents: anaconda_mode port 45293

*anaconda-socat* and *anaconda-response* are empty/non-existent.

System: Lubuntu 18.04 Emacs 26.1 Python 3.6.7 Output of pip freeze with activated venv:

Django==2.1.3
pkg-resources==0.0.0
pytz==2018.7

Thanks.

dragoonpilot commented 5 years ago

I noticed the same error occurs when I use ivy-xref to narrow the candidate list after running anaconda-mode-find-references. For the sake of completion, here are the steps to reproduce:

  1. Add the following to the config above
    (require 'ivy-xref)
    (setq xref-show-xrefs-function #'ivy-xref-show-xrefs)
  2. Find references with M-r. I am able to see candiates with ivy-xref.
  3. Exit the completion without selecting a candidate by pressing ESC 3 times or C-[ 3 times.
  4. "error in process filter: Quit" is shown in echo area. Emacs is frozen for 2-3 seconds.
hek14 commented 5 years ago

@welcometothenhk Anything solution about this issue? I'm also bothered by this error.

AlexLewandowski commented 5 years ago

Also encountering this. What is weird is that the issue goes away if debug-on-error is enabled... Having a nil condition (with debug-on-error set to when) works too. Disgustingly hacky but whatever.

CeleritasCelery commented 4 years ago

if you quit ivy with C-g instead of Esc does it still manifest the same issue?

dragoonpilot commented 4 years ago

if you quit ivy with C-g instead of Esc does it still manifest the same issue?

Yes, the same behavior occurs. When I created this issue, I was using evil-mode and wanted to use C-[ to abort everything so I never bothered testing C-g.

CeleritasCelery commented 4 years ago

I was doing some testing, and I have seen this issue show up but only sporadically. It looks like it only occurs the first time I try to complete and after that it works fine. Is that your experience as well, or does it occur every time?

dragoonpilot commented 4 years ago

This behavior occurs every time for me.

CeleritasCelery commented 4 years ago

Does it toggle a backtrace if you use toggle-debug-on-error? Also if you don’t use ivy is there still a pause? I am having a hard time reproducing this consistently.

dragoonpilot commented 4 years ago

I don't see a backtrace when debug on error is enabled, but the problem does go away (as @AlexLewandowski mentioned). The problem also goes away if I turn ivy mode off.

timlod commented 3 years ago

This bug still exists, and can also be reproduced when using selectrum instead of ivy. After invoking completion with C-M-i, it takes several C-gs or one and a wait of a second or two to resume.