-
Notifications
You must be signed in to change notification settings - Fork 85
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
Introduce apheleia-inhibit-functions #138
Introduce apheleia-inhibit-functions #138
Conversation
664b384
to
05ea832
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this will be very helpful. I think we can improve the design a little bit, though. define-globalized-minor-mode
already has a feature that is intended to accomplish conditional enabling of a minor mode:
Signature
(define-globalized-minor-mode GLOBAL-MODE MODE TURN-ON [KEY VALUE]... BODY...)
Documentation
Make a global mode GLOBAL-MODE corresponding to buffer-local minor MODE.
TURN-ON is a function that will be called with no args in every buffer
and that should try to turn MODE on if applicable for that buffer.
So, if we make the TURN-ON
function check apheleia--not-inhibited
before calling apheleia-mode
, I think it will accomplish the same, but more simply.
I don't mind changing that in your PR directly but I wanted to ask you your thoughts first.
I think that's totally fine. For me, my condition is a bit slow to run so I originally want to defer checking until saving is triggered, but I can just modify it to add to Cleaner code is superior, I'm in for |
Ok, cool. Yeah, I figured that if the user desired caching then they could simply implement that in their disable-function. |
How does this version look to you? |
We may need to dump those variables into the autoloads file, else
Edit: I don't think |
When running apheleia-mode-maybe without loading.
0999f44
to
66f30de
Compare
Yeah, sorry for the delay, that seems fine to me. Would be equally okay to autoload the variable individually. Looks like CI is failing, let me see if I can fix that. |
Ah yes it's just checkdoc. |
Thanks! |
Fixes #134
(I accidentally force-pushed #135 from a shallow repo)