Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Eyebrowse-mode fires before-change-functions hook on every movement #79

Open
vlthr opened this issue Mar 11, 2018 · 4 comments
Open

Eyebrowse-mode fires before-change-functions hook on every movement #79

vlthr opened this issue Mar 11, 2018 · 4 comments

Comments

@vlthr
Copy link

vlthr commented Mar 11, 2018

I am having an issue with the combination of eyebrowse with beacon-mode. The issue is that the beacon shown by beacon-mode displays incorrectly (does not disappear as it should).

The cause of this seems to be that beacon-mode hooks before-change-functions (see here), which is normally executed whenever changes are being made to a buffer. When eyebrowse-mode is active, this hook seems to be run with every movement made in the buffer. Does anyone know what this behavior is being caused by?

To check when the hook is being run I used the following:

(add-hook 'before-change-functions '(lambda (a b) (message "changed %s %s" a b)))
@wasamasa
Copy link
Owner

wasamasa commented Mar 11, 2018

This is the indicator which is created every time the modeline is redrawn. This happens due to the calls to format-spec which work upon a temporary buffer. In fact, you can prove that it's not Eyebrowse-specific with the following snippet:

(with-temp-buffer
  (dotimes (_ 100)
    (insert ".")))

Evaluating this will trigger before-change-functions at least a hundred times (for me a few times more due to my fancy eval commands). While I could look into making Eyebrowse call the modeline indicator less often, I have my doubts beacon-mode is doing the right thing here. Just because you can hook into something doesn't mean you should.

@vlthr
Copy link
Author

vlthr commented Mar 11, 2018

That makes sense - I didn't realise format-spec and with-temp-buffer would cause that hook to be run. With that in mind it makes more sense to implement a fix on beacon-mode's side.

Thanks!

@JSpenced
Copy link

Could this be related to why this function for me doesn't actually blink even though (beacon-blink) is specifically called. I just wanted beacon-blink to run after switching window configurations.:

(defun eyebrowse-switch-to-window-config-22 ()
  "Switch to window configuration 22."
  (interactive)
  (eyebrowse-switch-to-window-config 22)
  (beacon-blink))

@wasamasa
Copy link
Owner

wasamasa commented Mar 25, 2019 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants