anaconda-mode icon indicating copy to clipboard operation
anaconda-mode copied to clipboard

error in process filter: Quit when exiting completion with Ivy

Open dragoonpilot opened this issue 5 years ago • 10 comments

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 avatar Nov 28 '18 05:11 dragoonpilot

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)
  1. Find references with M-r. I am able to see candiates with ivy-xref.
  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.

dragoonpilot avatar Nov 29 '18 03:11 dragoonpilot

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

hek14 avatar May 06 '19 15:05 hek14

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.

AlexLewandowski avatar Jun 10 '19 20:06 AlexLewandowski

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

CeleritasCelery avatar Sep 17 '19 04:09 CeleritasCelery

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.

dragoonpilot avatar Sep 19 '19 01:09 dragoonpilot

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?

CeleritasCelery avatar Sep 19 '19 03:09 CeleritasCelery

This behavior occurs every time for me.

dragoonpilot avatar Sep 19 '19 03:09 dragoonpilot

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.

CeleritasCelery avatar Sep 19 '19 04:09 CeleritasCelery

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.

dragoonpilot avatar Sep 19 '19 04:09 dragoonpilot

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.

timlod avatar Feb 01 '21 11:02 timlod