-
Notifications
You must be signed in to change notification settings - Fork 87
Crash on C-g after C-x #130
Comments
Hi, I haven't experienced this and I have a similar setup. What settings do you have for which-key and have you tried reproducing with |
I don't experience the same crashes with (custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:family "Roboto Mono" :foundry "outline" :slant normal :weight normal :height 98 :width normal :spacing c))))) If i run my config with this code commented out, I have no issues. But if I evaluate this, which-key crashes after a couple of C-x C-g. I get this issue regardless of which-key settings, but it does seem to trigger more often if the idle delay option is lower. (setq which-key-idle-delay 0.4) |
Possible fix for #130 When enabled this option avoids the use of fit-window-to-buffer to resize the popup. My profiling suggested that emacs was spending a lot of time in this function (and hanging sometimes) with different fonts. I noticed this with Roboto Mono on MSWindows, which should explain #130.
Try the new option in commit eb4a6f6 (setq which-key-allow-imprecise-window-fit t) In my tests it appears to me that for some reason that font slows down the calculation of window sizes. My emacs seemed noticeably laggy when I used that font. which-key was lagging in one particular area and this variable allows you to bypass that calculation. It shouldn't make a huge difference, but let me know if you notice problems. |
Sadly, it doesn't seem to help much. It's a really weird problem. It works fine with most fonts, but I've also seen this with |
Feels more like an upstream issue though. |
Hm, I don't know what to say. If you can profile which-key on your computer we might be able to narrow it down, but I'm not using windows at the moment, so I'm not sure what I can do on my side. |
Sorry for the delay. I've tried profiling this, but I can't really see a difference between using a "normal" font and a font that causes issues. Do you still want to see the result? As you said, this feels more like a general issue with Emacs using those fonts. I'll prepare a bug report to Emacs. Thanks for looking into this! |
Sure, I'll take a look, but it does sound like an upstream issue. What version of emacs are you on now? Have you tried 25.1? |
@kimgronqvist - Quick question- was there ever a response from upstream and a place where this is currently being discussed? I have the exact same issue, except I'm using the font Ubuntu Mono (powerline version) on Windows with native Emacs v25.0.90.3. |
@byronsanchez I believe this is the same bug: https://lists.gnu.org/archive/html/bug-gnu-emacs/2016-10/msg00334.html The workaround is supposed to be setting |
Thanks for the pointer @kimgronqvist |
@justbur I'm having the same issue as well. I was actually relieved to find this thread; this bug was driving me crazy and I was afraid that I was the only one. My current version info is as follows:
I.e., I'm on GNU Emacs 25.3 using the Emacs Mac Port by Yamamoto Mitsuharu. I'm also on macOS 10.13.5. It is possible that this issue is gone in Emacs 26, but I haven't used Emacs 26 yet and I can't remember reading anything about this bug in the |
@ylluminarious Can you reproduce it with another build of emacs like this one? |
@justbur I'll try. I'll let you know what I find. |
@justbur Still happens on Emacs 26. Although, it is quite mitigated by using the new I noticed previously that every time this issue happened, |
@ylluminarious I just tried getting emacs to crash with |
@justbur It seems to happen sporadically, not consistently. Perhaps try it out at various intervals while doing different things with Emacs. I haven't pinned down the all of the exact circumstances which cause the hang. |
@ylluminarious I'm not optimistic about finding this one on my own. Maybe you could seek help from emacs developers? |
Does setting |
@Compro-Prasad I'm not sure... I've been running Emacs with it set as such for about a day or two and I haven't noticed the hang yet, but that doesn't mean it won't occur at some point in the future. However, given that I haven't seen it occur yet, it suggests in my mind that perhaps this variable and this issue are related. Emacs does seem to be consuming somewhat more memory than before after setting this variable... although this is to be expected as it says in the variable's docstring as well as the fact that I have lots of things going on in Emacs. |
@Compro-Prasad I've been running with that setting for the better part of a week now, so I'd say yes. Setting |
@ylluminarious Sounds good, but I'm not sure I should change anything since it seems specific to a few users. I'd certainly keep this issue around, of course. |
@justbur Better mention in the README |
@Compro-Prasad done |
- enlarge font-face - which-key crashing issue justbur/emacs-which-key#130 - use option as meta too
- enlarge font-face - which-key crashing issue justbur/emacs-which-key#130 - use option as meta too
I've been able to reproduce this repeatedly with Emacs 26.3 on macOS. To consistently reproduce, I open a 307K file and then do Setting Using an empty emacs config and only loading which-key does seem to resolve the problem. My default configuration uses Doom Emacs. It's not clear what may be interacting. I noticed another user reporting the same issue on Reddit: https://www.reddit.com/r/emacs/comments/g1uk3c/emacs_gui_freezes/ |
Themes may cause some problems. Try loading the doom theme you use in an empty Emacs config. Try adding modeline if the theme doesn't cause the issue. |
The issue appears to only occur with the modeline that Doom uses by default. I switch to |
It seems that setting |
FWIW |
I'm also having this problem, and I'm using Doom Emacs on macOS. But unlike what @zwass mentioned, I could reproduce this even without enabling Doom's My way of reproducing this is basically the same as @zwass's:
And I was able to observe two different visual states when it hangs (they seem to show up randomly):
After it hangs, it seems only I'm quite new to ELisp programming, and don't really have any good idea how to debug this ... But I'm willing to help anyway. Please let me know if there's anything I can help. Thanks. |
I am using Doom Emacs on OSX (Catalina), and I see the same issue as @hyl0327 , though my files are pretty small. |
experiencing the same problem that @hyl0327 described |
Based on these reports, this still seems related to something doom is doing. If there's something doom is doing to cause this, it would be very helpful towards resolving the issue, but I have neither the time nor the interest in digging through the doom configuration to figure out what's wrong. If it's not a doom issue, it should be reproducible from vanilla emacs (emacs -Q) with which-key loaded of course. If someone can figure out a way to reliably reproduce the issue from that setup, I will look into it. I have not been able to reproduce it from my personal setup. |
I was able to replicate with vanila emacs with doom theme and doom modeline installed. |
Hi! Thanks for a great project, it's super useful.
However, I'm having some issues with frequent crashes on Windows with Emacs 25. If I press C-x followed by C-g (to abort the sequence), which-key almost always makes Emacs hang and become unresponsive.
This is on Windows 8 with Emacs 25.0.94.2.
Please let me know if you need to me to provide more information, or anything else I can do to help.
The text was updated successfully, but these errors were encountered: