tern
tern copied to clipboard
possibly emacs die(freeze) when focus out for a long time
I'm suffering the freezing of emacs several times when I'm leaving my PC with emacs opened, and the screen saver will appear, after a long time when I'm back, emacs freezed, buffer display nothing and cannot response to any key.
When I'm adding below line:
(add-hook 'focus-in-hook '(lambda()
(when (boundp 'tern-idle-time)
(setf tern-idle-time 2.5))
))
(add-hook 'focus-out-hook '(lambda()
(when (boundp 'tern-idle-time)
(setf tern-idle-time 1e10))
))
Things to be fine, without any freezing any more.
So maybe this can be added into tern?
That is, when focus out of the buffer, tern should not parse buffer any more.
Or some similar solution from core?
Thanks!
Firstly, the idle timer will fire only once, no matter how long the machine/editor is idle, so I don't think this is the actual problem. Your solution, in any case, doesn't do what you think it does, since tern-idle-time is only evaluated when tern-mode is enabled, so changing it in a hook like that will do exactly nothing.
I'd like to figure out what is actually happening. Have you tried having a verbose tern server running (tern --verbose --persistent in the project dir, before using Emacs/Tern in that project) and seeing what that outputs when a hang occurs?
OK! I'll try and figure out where the real problem is.
When the hang does, the whole frame just freezed, with blank buffer and no charaters on the screen.
Does tern can log into a file?
Does tern can log into a file?
No, but you can start a server yourself, and look at its output.