Company hangs Emacs in Geiser REPL
Steps to reproduce:
-
M-x run-racket
. - In the Geiser REPL,
(require xrepl)
. - Start typing
(values 1 2)
.
In my setup (on an OS X virtual machine), this causes Emacs to hang after typing (v
. If I'm in a terminal Emacs, that's it—I have to restart Emacs. However, if I'm in a windowed Emacs (emacsw
), I can regain control by pressing C-g C-g C-g
.
Turning off company-mode
prevents the freeze from occurring.
This also happens occasionally in other, non-xrepl
situations. However, this case is the most reproducible one I have found.
Following the instructions in this Stack Exchange question, I produced the following stack trace:
Debugger entered--Lisp error: (quit)
accept-process-output(#<process Racket REPL> 3.0)
byte-code("\305\306 \236A!)\205'\n\307\n\310\311 \"A\"*?\205'\312\f\313\245\"\210\202\207" [con c id proc timeout tq-process :tq gethash assoc :completed accept-process-output 10] 5)
byte-code("\303\304\305#\211\nB\306\216\304\307\310\217+\207" [timeout -with-timeout-timer- with-timeout-timers run-with-timer nil #[nil "\300\301\211\"\207" [throw timeout] 3] ((cancel-timer -with-timeout-timer-)) (byte-code "\305\306 \236A!)\205'\n\307\n\310\311 \"A\"*?\205'\312\f\313\245\"\210\202\207" [con c id proc timeout tq-process :tq gethash assoc :completed accept-process-output 10] 5) ((error (byte-code "\301\236\302\241)\207" [req :continuation nil] 2)))] 5)
geiser-con--send-string/wait((t (:filter . comint-output-filter) (:tq ((nil "\\(\n\\(mzscheme\\|racket\\)@[^ ]*> \\)" ((:id . 82) (:string . ",geiser-eval #f #f ,apply geiser:completions (\"s\")") (:continuation . geiser-eval--set-sync-retort) (:buffer . #<buffer * Racket REPL *>) (:connection t (:filter . comint-output-filter) #1 (:tq-filter lambda (p s) (geiser-con--tq-filter ... s)) (:eot . "\\(\n\\(mzscheme\\|racket\\)@[^ ]*> \\)") (:prompt . "\\(mzscheme\\|racket\\)@[^ ]*> ") (:debug-prompt) (:is-debugging) (:count . 83) (:completed . #s(hash-table size 65 test eql weakness value rehash-size 1.5 rehash-threshold 0.8 data ( ...))))) . geiser-con--process-completed-request) (",geiser-eval #f #f ,apply geiser:completions (\"v\")\n" "\\(\n\\(mzscheme\\|racket\\)@[^ ]*> \\)" ((:id . 83) (:string . ",geiser-eval #f #f ,apply geiser:completions (\"v\")") (:continuation . geiser-eval--set-sync-retort) (:buffer . #<buffer * Racket REPL *>) (:connection t (:filter . comint-output-filter) #1 (:tq-filter lambda (p s) (geiser-con--tq-filter ... s)) (:eot . "\\(\n\\(mzscheme\\|racket\\)@[^ ]*> \\)") (:prompt . "\\(mzscheme\\|racket\\)@[^ ]*> ") (:debug-prompt) (:is-debugging) (:count . 83) (:completed . #s(hash-table size 65 test eql weakness value rehash-size 1.5 rehash-threshold 0.8 data ( ...))))) . geiser-con--process-completed-request)) #<process Racket REPL> . #<buffer tq-temp-Racket REPL-153340>) (:tq-filter lambda (p s) (geiser-con--tq-filter (quote (((nil "\\(\n\\(mzscheme\\|racket\\)@[^ ]*> \\)" (... ... ... ... ...) . geiser-con--process-completed-request) (",geiser-eval #f #f ,apply geiser:completions (\"v\")\n" "\\(\n\\(mzscheme\\|racket\\)@[^ ]*> \\)" (... ... ... ... ...) . geiser-con--process-completed-request)) #<process Racket REPL> . #<buffer tq-temp-Racket REPL-153340>)) s)) (:eot . "\\(\n\\(mzscheme\\|racket\\)@[^ ]*> \\)") (:prompt . "\\(mzscheme\\|racket\\)@[^ ]*> ") (:debug-prompt) (:is-debugging) (:count . 83) (:completed . #s(hash-table size 65 test eql weakness value rehash-size 1.5 rehash-threshold 0.8 data ( ...)))) ",geiser-eval #f #f ,apply geiser:completions (\"v\")" geiser-eval--set-sync-retort nil nil)
geiser-eval--send/wait((:eval (:ge completions "v")) nil nil)
geiser-completion--symbol-list("v")
geiser-completion--complete("v" nil)
geiser-completion--thing-at-point(nil nil)
geiser-completion--for-symbol()
completion--capf-wrapper(geiser-completion--for-symbol optimist)
run-hook-wrapped(completion--capf-wrapper geiser-completion--for-symbol optimist)
company--capf-data-real()
company--capf-data()
company-capf(prefix)
#[0 "\n\203 \nC\202\n\211\205\233\211@\3009\204\306!\203<9\2036\307N\310=\2046\307N?\205@\311!\205@\312!\202@\313\312\"\240\210\300\242\203\224\314\300\242!\203\216\315\300\242!\211\301\316\f!\240\210\301\242:\204w
\203i\317\320!\210\301\242\310=\203\216\321\322!\210\202\216
\203\300\242\323\301\242!\210\324\325\326 \"\210\327\330!\210\331\332\301\242\"\210A\266\202\202\n\207" [(nil) (nil) company-backend company-backends company-prefix company--manual-action functionp company-init t company-init-backend prefix company--multi-backend-adapter company--good-prefix-p company--prefix-str company-calculate-candidates message "No completion found" company-cancel unique company-update-candidates run-hook-with-args company-completion-started-hook company-explicit-action-p company-call-frontends show throw --cl-block-nil-- company--manual-prefix] 6 "\n\n(fn)"]()
funcall(#[0 "\n\203 \nC\202\n\211\205\233\211@\3009\204\306!\203<9\2036\307N\310=\2046\307N?\205@\311!\205@\312!\202@\313\312\"\240\210\300\242\203\224\314\300\242!\203\216\315\300\242!\211\301\316\f!\240\210\301\242:\204w
\203i\317\320!\210\301\242\310=\203\216\321\322!\210\202\216
\203\300\242\323\301\242!\210\324\325\326 \"\210\327\330!\210\331\332\301\242\"\210A\266\202\202\n\207" [(nil) (nil) company-backend company-backends company-prefix company--manual-action functionp company-init t company-init-backend prefix company--multi-backend-adapter company--good-prefix-p company--prefix-str company-calculate-candidates message "No completion found" company-cancel unique company-update-candidates run-hook-with-args company-completion-started-hook company-explicit-action-p company-call-frontends show throw --cl-block-nil-- company--manual-prefix] 6 "\n\n(fn)"])
company--begin-new()
company--perform()
#[0 "\301 \210\207" [company-candidates company--perform] 1 "\n\n(fn)"]()
funcall(#[0 "\301 \210\207" [company-candidates company--perform] 1 "\n\n(fn)"])
company-auto-begin()
company-idle-begin(#<buffer * Racket REPL *> #<window 26 on * Racket REPL *> 193 55)
apply(company-idle-begin (#<buffer * Racket REPL *> #<window 26 on * Racket REPL *> 193 55))
byte-code("r\301\302H\303H\"\210)\301\207" [timer apply 5 6] 4)
timer-event-handler([t 22510 65082 123683 nil company-idle-begin (#<buffer * Racket REPL *> #<window 26 on * Racket REPL *> 193 55) nil 0])
Likely this is due to the Geiser or Racket functions called to look up completions hanging (which causes Company to hang).