Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I am in js-mode.
The screenshot shows where I typed the = and emacs is completely frozen. No C-g, Esc, or q does anything.
I have no idea how to even start debugging this.
Try a triple <ESC>. Also edit your question and add the result of running the following command in a terminal: ps -C emacs -o f,s,uid,pid,ppid,tid,c,pri,ni,vsz,sz,rss,addr,wchan,stat,tty,time,cmd (assuming you are running on Linux - you might have to modify the command slightly on other Unixes; see the ps(1) man page - I don't know what to do on Windows). You can also try strace -p <PID> where <PID> is the process id of the Emacs process: see the pid column of the ps command. Move the mouse over the Emacs frame and see if strace produces any additional output ...
It normally does a poll and blocks on pselect until some event happens and then there should a flurry of activity for a bit and then another poll will happen and the pselect will block until the next event. But if you move the mouse over the Emacs frame, and nothing happens in the strace output, then it is well and truly hung. You might want to edit your question and add the last few lines of the strace output as well, although it might be not useful: if the strace is started after the hang, the only thing that will appear is the last system call Emacs did - maybe...
If a syntax highlighting rule, for some reasons, loops forever it could cause Emacs to hang. Try disabling font-lock before you type the = character. If Emacs doesn't hang then we can narrow down the search to the font-lock rules. I can provide some guidance on how to do this.
ps -C emacs -o f,s,uid,pid,ppid,tid,c,pri,ni,vsz,sz,rss,addr,wchan,stat,tty,time,cmd
(assuming you are running on Linux - you might have to modify the command slightly on other Unixes; see the ps(1) man page - I don't know what to do on Windows). You can also trystrace -p <PID>
where<PID>
is the process id of the Emacs process: see thepid
column of theps
command. Move the mouse over the Emacs frame and see ifstrace
produces any additional output ...poll
and blocks onpselect
until some event happens and then there should a flurry of activity for a bit and then anotherpoll
will happen and thepselect
will block until the next event. But if you move the mouse over the Emacs frame, and nothing happens in thestrace
output, then it is well and truly hung. You might want to edit your question and add the last few lines of the strace output as well, although it might be not useful: if the strace is started after the hang, the only thing that will appear is the last system call Emacs did - maybe...=
character. If Emacs doesn't hang then we can narrow down the search to the font-lock rules. I can provide some guidance on how to do this.