-
Notifications
You must be signed in to change notification settings - Fork 23
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
Purpose fixes do not uninstall cleanly when purpose-mode is off #166
Comments
Yes, my original intention was that Just to be clear, we want:
We don't want, even as an option:
What I have in mind is the following:
There is an issue with lazy-loading and when to call (defun purpose-enable-fixes ()
(unless purpose--installed-fixes ; a variable that is initialized to nil
(purpose-fix-install)
(setq purpose--installed-fixes t))
;; ...
(when (featurep 'popwin)
(advice-add 'popwin:replicate-window-config :around 'purpose--fix-popwin-replicate))
;; ...
)
(defun purpose-disable-fixes ()
(when purpose--installed-fixes ; guard against turning off `purpose-mode` before even turning it on (technically possible)
;; ...
(when (featurep 'popwin)
(advice-remove 'popwin:replicate-window-config 'purpose--fix-popwin-replicate))
;; ...
)) |
Thanks for writing down your plan. Absolutely agree the fixes should be on when the mode is on, and off when the mode is off. However, I don't agree with removing I think if you want to go for explicitness, introducing |
I opted to add a hook named The code is actually simpler than how this sounds, just look in #180. I think the PR is fine, but just in case I marked you as a reviewer so tell me if you have any further suggestions. |
All those advices and others in
window-purpose-fixes.el
are not removed whenpurpose-mode
is turn off, so the lingering purpose customizations are still interfering all of these other packages.For the advices, we can probably introduce a
purpose-advice-add
util that memoize the advices, and removed en-mass inpurpose--remove-advices
. The other package specific purpose configs should be relatively easy to undo with some defvars as well.The text was updated successfully, but these errors were encountered: