Skip to content
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

The watcher causes the mode line to blink #21

Open
ThibautVerron opened this issue Jan 12, 2022 · 1 comment
Open

The watcher causes the mode line to blink #21

ThibautVerron opened this issue Jan 12, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ThibautVerron
Copy link

Hi,

The watcher changes the active buffer when calling the save function, which causes minor annoyance. For instance, if the mode line distinguishes between focused and unfocused buffers, it causes a blink every 2 seconds.

As far as I can tell, it's due to the call to magit-get-branch which uses a temporary buffer. Replacing the call with a direct system call "git rev-parse --abbrev-ref HEAD" should fix it.

More generally, I'm not sure that running the heartbeat function on a timer is the best way to proceed. Hooking into window-buffer-change-functions and window-selection-change-functions instead would have the double advantage of capturing buffers which are used for less than 2 seconds, and to avoid calling the function thousands of times if the active buffer doesn't change.

But those variables are only for emacs >= 27.1.

@ThibautVerron ThibautVerron changed the title Saving the heartbeat changes the buffer The watcher causes the mode line to blink Jan 12, 2022
@ThibautVerron
Copy link
Author

ThibautVerron commented Jan 12, 2022

Actually, I'm not sure that the cause for the blink is what I said.

When the watcher is called, the mode-line shows the work buffer as inactive. It remains that way until a key is pressed.

It also doesn't seem to happen for all buffers or all files.

Edit: And now, after a couple of restarts, it's completely gone. I know it was caused by activity watch because disabling and enabling the mode made the blink come and go, but if even I can't reproduce it anymore, I'm not sure if the issue should remain open.

@pauldub pauldub added enhancement New feature or request help wanted Extra attention is needed labels Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants