flymake-grammarly icon indicating copy to clipboard operation
flymake-grammarly copied to clipboard

flymake-grammarly makes the emacs daemon hang during the startup

Open algor512 opened this issue 2 years ago • 5 comments

I use GNU Emacs 28.2

A minimal init file init-debug.el to reproduce the bug:

(add-to-list 'load-path "/home/algor/.config/emacs/straight/build/flymake-grammarly")
(add-to-list 'load-path "/home/algor/.config/emacs/straight/build/grammarly")
(add-to-list 'load-path "/home/algor/.config/emacs/straight/build/request")
(add-to-list 'load-path "/home/algor/.config/emacs/straight/build/websocket")
(require 'flymake-grammarly)
(add-hook 'text-mode-hook 'flymake-grammarly-load)

Running /bin/emacs -q -l ~/.config/emacs/init-debug.el --bg-daemon the startup freezes, daemon doesn't start.

algor512 avatar Nov 15 '22 09:11 algor512

Thanks for reporting this issue to us!

Is there an error log for this? It's hard to guess what's going on without any error popping out. Maybe try load it after you have started the daemon?

jcs090218 avatar Nov 15 '22 11:11 jcs090218

There are no errors in logs, unfortunately.... After starting the daemon with the line (add-hook 'text-mode-hook 'flymake-grammarly-load) removed, I can run it by hand without any problems. Also I can launch Emacs daemon via running emacs and M-x server-start, it also doesn't lead to any problems.

Possibly emacs, running as a daemon from a terminal, is trying to open something in text mode (without an actual frame), so it runs the flymake-grammarly-load hook and for some reason this causes a freeze?

algor512 avatar Nov 15 '22 11:11 algor512

Maybe try flymake-grammarly-maybe-load instead? Don't know if that would make any differences. I think the cause is this package get activated (sending grammarly requests) right after some buffers without the correct setup.

I usually wrap it with with-eval-after-load 'flymake, then do the following. Hope that would work?

jcs090218 avatar Nov 15 '22 13:11 jcs090218

I've just noticed that it hangs even with the following init file...

(add-to-list 'load-path "/home/algor/.config/emacs/straight/build/flymake-grammarly")
(add-to-list 'load-path "/home/algor/.config/emacs/straight/build/grammarly")
(add-to-list 'load-path "/home/algor/.config/emacs/straight/build/request")
(add-to-list 'load-path "/home/algor/.config/emacs/straight/build/websocket")
(require 'flymake-grammarly)
;;(with-eval-after-load 'flymake
;;  (add-hook 'text-mode-hook 'flymake-grammarly-maybe-load))

algor512 avatar Nov 19 '22 12:11 algor512

It's weird, this package does nothing in the root level. It only registers the grammarly callbacks and it should be safe!...

jcs090218 avatar Nov 19 '22 13:11 jcs090218