You can send a SIGUSR2 to emacs, it might stop what it's doing and print out a trace, but not guaranteed though if it is stuck in some C-code.
@viebel, maybe I wasn't clear. I experience the same issues as you. A few weeks ago I had a blinking issues with the emacsformacosx version, and @jr0cket found other people with the same issue. So I moved to the brew version. The first I tried recommended by spacemacs for macos lead me also to the same issue, emacs not responsive at all, until I kill the process. I didn't spend time to try to find out where it come from. The bug seems random to me. My spacemacs.d directory is a fork with small changes from the practicalli's one, quite standard. All that details to tell, there may be other solutions, maybe the other emacs brew version.
Thank you for the clarification
I found a workaround for the case where the irresponsiness is caused by CIDER Repl buffer. Run emacsclient to open a new emacs frame. Kill the REPL buffer
so, frustrated by spac/emacs instability (generally poor performance, occasional crashes, and hangs on wide files and large repl output), i went as far as trying vscode for a couple of weeks, and it's not bad. it's certainly a lot more stable, and there are loads of good extensions. but CIDER is quite a lot better than calva, and pervasive helm is so much better than vscode's grab-bag of different UI for different nav tasks, and emacs windows and layouts are just great &c so i'm wondering - has anyone had any success with making spac/emacs (on macos) more stable ? e.g. are some versions better than others wrt crashing and wide files, are there any helpful tricks ?
I’ve seen reports of DOOM Emacs being better in those areas, haven’t tried myself
Conjure and neovim works well on a tortured macbook pro at the moment.
I haven't played around with lsp too much yet, we'll see what happens in a large codebase with lsp.
The primary reason I use neovim instead of spacemacs or cursive is the performance which is great.
How could it be that Emacs is not stable?
For me, Emacs has stable on Linux for the last decade. Even running nightly builds of Emacs 28 last year was stable for the few months I used them. I wonder if it's some other factor?
Emacs has been stable on Linux for me for the last decade, not sure how much more stable you are looking for. Most likely causes of instability are packages or the distribution of Emacs used conflicting with changes to an operating system. Its not that surprising to see issues with those running the new hardware and software for MacOSX, as thats a really big change. As MacOSX is a commercial operating system, its probably not surprising that less testing gets done upon it. This could be a source of issues.
@viebel :man-shrugging: i was having hard crashes every week or so, not sure why. performance is awful when a repl dumps a load of stuff, leading to pauses and sometimes crashes, and wide lines also lead to very poor performance
I'm trying a different build now... i was on railwaycats, now trying brew/emacs+ ... will see if that's any better
@jr0cket is there a way to limit the size of the REPL buffer size?
cider-repl-buffer-size-limit
with an integer value will limit the repl output. 1000 should be okay. I have it set to 100 as I dont use the REPL buffer in Cider directly
It can either be a setq in dotspacemacs/user-config or add it as a clojure layer variable
(clojure :variables
clojure-backend 'cider
clojure-enable-linters 'clj-kondo
clojure-toplevel-inside-comment-form t
cider-overlays-use-font-lock t
cider-repl-buffer-size-limit 100)
Avoid sending logs to the REPL buffer, especially if the logs generate proper log objects or very long strings... It wont take many lines of those to start to slow down Emacs.
1. cider-repl-buffer-size-limit doesn’t work 2. How do we avoid sending logs to the REPL buffer?
There is a suggestion in #emacs as to stable versions to use on MacOSX https://clojurians.slack.com/archives/C099W16KZ/p1613009517053300
thanks @jr0cket - i've been using the brew/emacs+ bottled version for the past few days, and haven't had any crashes yet
I am with you. I like emacs but the hangs, crashes, and general slowness are hard to deal with. I still find if i need to get something edited quickly it’s a lot nicer just using Vim
Thanks for the report on vscode. I was thinking about trying that out for similar reasons. I know a lot of the Clojure community is using intellij. I don't know if that's because it's really good or just people coming from java are familiar with it. Have you tried that one?
i've used intellij for java plenty... it has great refactoring support, but i don't like it 😃
i've gone back to spacemacs for now - the CIDER test loop is so much better i'm just more productive. i'm also trying a new emacs build - https://github.com/d12frosted/homebrew-emacs-plus from homebrew (i was previously on railwaycat) so we'll see how that goes
Too bad, I was hoping Cursive would be as good as cider. fwiw, I haven't had too many performance issues with https://emacsformacosx.com/. Or, at least, I blame my performance issues on the number of web browser tabs I have open. 🙂
Cursive seems relevant if you have a deep knowledge of using IntellJ and mostly code by static analysis of code rather than REPL. I have met quite a few developers using Cursive that never used the REPL. Calva is focusing a lot more on static analysis as it's building on LSP. I wonder if the repl will be used less with Calva too. I haven't found anything better than Cider for doing REPL driven development, although Conjure plugin for NeoVim is very good. So apparently is vim-iced.
i haven't tried to use cursive @bmaddy, so i can't comment on it - i'm pretty clear i don't want to use intellij, so i've not bothered with it. others may feel differently ofc
i'm generallly very happy with CIDER's functionality - it's just emacs instability that winds me up sometimes
calva does use lsp, but lots of stuff still seems to require a repl @jr0cket . its repl is ok, and code navigation through definitions and references etc is really nice. i tried to use it for a test driven workflow though, and the test runner feedback is quite deficient compared to CIDER's
i might give conjure and vim-iced a spin... i've never really tried serious editing with vim, but stuff like this makes me want to try it out : http://takac.github.io/2013/01/30/vim-grammar/