New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows that match dimmer-buffer-exclusion-regexps
never un-dim when you switch back to Emacs
#43
Comments
This is a temporary change as there appears to be a small issue in dimmer.el where, when switching away from the frame, all windows get dimmed (which is fair -- I can see this making sense and I like the idea), but when switching back, all windows that are configured to be ignored by dimmer don't get un-dimmed. See gonewest818/dimmer.el#43 for the issue I raised about this.
Hey, good catch. Thank you for this report. I can imagine what that bug would be. The un-dimming handlers work from a buffer list that was pre-filtered with those regexps and predicates. However the "lost focus" handler dims every buffer without filtering. Solutions would be either: (a) continue dimming every buffer when focus is lost but force the re-processing of every buffer when focus is regained, or (b) filter which buffers are dimmed when focus is lost. Option (b) is simple to do but Option (a) seems more logical to me -- if focus is completely lost then (arguably) you aren't working on any emacs buffer and they should all be dimmed. Thoughts? |
Yeah, I think option (a) makes a lot more sense to me. The idea of having some buffers not dim when I'm moving around the frame, but every buffer dim when I move away from the frame to a different application or something sits well logically. I'd use it that way. |
Just confirming the bug. Even having |
@maronin Did you restart Emacs after toggling |
This is a candidate fix for #43. When regaining focus, we need to force the processing of all buffers and restore not only the current buffer, but also every buffer that was previously filtered due to the dimmer predicates.
I pushed a candidate fix for this on the "focus-fix" branch. I'll running this branch locally for a while to see if everything behaves well, and when I'm satisfied I'll merge it in. If you happen to use a package manager like quelpa or straight, can install from this branch and check if it works for you? |
I generally do everything with |
Okay, thank you. Something like this should work:
If you want, you can keep your existing declaration for |
For help with testing gonewest818/dimmer.el#43
I tried getting this going (throwing "quelpa" into the mix, I mean) with my config but it caused a few problems so I've had to back out for now. Sorry. I'll try and come back to it when I next get some downtime. |
thank you for putting in the time. In my testing so far the fix seems stable, so that’s encouraging. I’ll keep folks updated here. |
I just pushed an update to the branch that fixes some cases I hadn't considered earlier. Still, things are looking good. |
Backing out f56ba1e now that I'm running with the version of dimmer.el that has the fix. gonewest818/dimmer.el#43
@gonewest818 Dived in again and got quelpa working just fine with my config this time. Pulled |
fix #43 When regaining focus, force the processing of all buffers to restore to "undimmed" the current buffer as well as every buffer that was previously filtered by dimmer predicates.
I just merged the focus-fix branch to master. Wait for MELPA to pick up the change (an hour or two, typically), and then you can revert your config to retrieve from the repo. Thanks! |
Thanks again. Really appreciate it. |
I have dimmer configured to ignore my NeoTree window. I'm finding that if I switch away from Emacs altogether, all buffers dim (presumably down to
dimmer-watch-frame-focus-events
beingt
-- which is fine), including those that matchdimmer-buffer-exclusion-regexps
. As such, even the NeoTree buffer dims (which I think makes sense).However, when switching back, the NeoTree buffer doesn't un-dim. The upshot of this seems to be that when
dimmer-watch-frame-focus-events
ist
, and when you switch away from Emacs and back again, any window that is a match fordimmer-buffer-exclusion-regexps
will stay dim.I'm experiencing this with:
using GNU Emacs 26.3.
The text was updated successfully, but these errors were encountered: