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

Do not install a global advice on tabulated-list-revert #593

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

minad
Copy link
Contributor

@minad minad commented Feb 2, 2023

Instead define our own revert function for embark-collect-mode buffers. It is good practice to avoid advices, and global advices even more so.

(I did some advice cleaning in my Vertico and Corfu packages and then I also found this advice in Embark.)

Instead define our own revert function for embark-collect-mode buffers. It is
good practice to avoid advices, and global advices even more so.
@oantolin
Copy link
Owner

oantolin commented Feb 2, 2023

That does look a little better, thanks!

@oantolin oantolin merged commit 4882b39 into oantolin:master Feb 2, 2023
@oantolin
Copy link
Owner

oantolin commented Feb 2, 2023

You know, that entire hook and revert function could probably be removed now. I doubt anyone still uses them. It was useful back in the dark days when embark also had a completions UI.

@minad
Copy link
Contributor Author

minad commented Feb 2, 2023 via email

@oantolin
Copy link
Owner

oantolin commented Feb 2, 2023

In fact, if I recall, correctly I added it so Prot could have an easy way of resize the embark completions window to the minimum height needed for the candidates. :)

@minad
Copy link
Contributor Author

minad commented Feb 2, 2023 via email

@oantolin
Copy link
Owner

oantolin commented Feb 2, 2023

It's an extra hook so that it is not shared with non-embark tabulated lists, i.e., that way users can set it to a hook run whenever you revert an embark collect buffer but not when you revert some other tabulated list. For the purposes of the zebra-mode that is not important because the hook it adds is added locally any way.

@minad
Copy link
Contributor Author

minad commented Feb 2, 2023

Sure, I understand. But it is still almost useless since you can add a hook to embark-collect-mode-hook which then installs a local tabulated-list-revert-hook hook. I believe we can safely remove it. If there were many users, which would then avoid the aforementioned two hook indirection, it would be justified to keep it, but that does not seem to be the case?

@oantolin
Copy link
Owner

oantolin commented Feb 2, 2023

Yeah, I should remove it. And also fix zebra-mode! It uses the revert hook, because embark-live used to use revert, but since the new lighter embark-live came about it doesn't use reverting anymore. This means that zebra-mode doesn't actually update in embark-live buffers.

@minad
Copy link
Contributor Author

minad commented Feb 3, 2023

Btw, zebra mode should be rewritten anyway to not use overlays, which are too expensive for this use case. It would be better to use text properties.

Do you still use zebra mode? It is nice because of the funny name, but I would also not mind if it is removed or demoted to the wiki. :-P

@oantolin
Copy link
Owner

oantolin commented Feb 3, 2023

It is still the only sensible way to browse the kill-ring. Not that I actually browse the kill-ring that much.

@oantolin
Copy link
Owner

oantolin commented Feb 3, 2023

I personally wouldn't miss zebra mode if it were gone.

@oantolin
Copy link
Owner

oantolin commented Feb 3, 2023

I can live with 0 sensible ways to browse the kill-ring, I guess. 🤣

@oantolin
Copy link
Owner

oantolin commented Feb 3, 2023

I'll carefully clean these things up in the next few days.

@minad
Copy link
Contributor Author

minad commented Feb 3, 2023

And then release immediately! :)

minad added a commit to minad/embark that referenced this pull request Feb 10, 2023
Just opening this such that the discussion in oantolin#593 does not get lost.
Remove the zebra and the (almost useless) embark-collect-revert-hook.
Given how much code space the Zebra needs, I don't think it is
justified to keep it in captivity in our zoo. As alternative I suggest
a meerkat mode.
minad added a commit to minad/embark that referenced this pull request Feb 10, 2023
Just opening this such that the discussion in oantolin#593 does not get lost.
Remove the zebra and the (almost useless) embark-collect-revert-hook.
Given how much code space the Zebra needs, I don't think it is
justified to keep it in captivity in our zoo. As alternative I suggest
a meerkat mode.
@minad minad mentioned this pull request Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants