clojure-emacs/clojure-mode

Syntax `^:` causes Emacs to freeze.

ZachFontenot opened this issue · 3 comments

This happened to me about a half a year ago on Arch Linux with obviously older Emacs and older clojure-mode. Both using Prelude. I wasn't able to reproduce merely with clojure-mode, so steps include downloading prelude.

Expected behavior

Adding ^: to def and defn don't freeze emacs

Actual behavior

^: freezes emacs

Steps to reproduce the problem

Download Prelude Emacs. Open either a clj or cljs file. Type (def ^:something) or (defn ^:something) or even just (def ^:)/(defn ^:). I've reliably been able to reproduce if it doesn't happen initially by typing (defn ^:something) and then M-backspace to delete back to the colon. Will include a screen shot of cpu profiler.

Screen Shot 2021-05-16 at 2 20 43 PM

I know a screenshot is not necessarily the best, but I'm having trouble logging it otherwise.

Environment & Version information

clojure-mode version

clojure-mode (version 5.13.0)

Emacs version

GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin19.6.0, NS appkit-1894.60 Version 10.15.7 (Build 19H114))
of 2021-04-24

Operating system

MacOSX 10.15.7 Catalina

Also, it seems that after this happens and I quit via ctrl-g Emacs still consumes high cpu

vemv commented

It might be interesting to try reproducing this on CI.

For example one could have unit tests for these inputs. Having the build green would be a pretty good signal. Then if possible one could check if CPU was increased in said CI environment

If the issue can't be reproduced, perhaps flycheck or company-mode (per your screenshot) are making an assumption that isn't true. Maybe a race condtion? Given there's a timer involved.

vemv commented

Released as clojure-mode 5.15.0, which will be available within a couple hours