-
Notifications
You must be signed in to change notification settings - Fork 31
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
Advice is active regardless of whether the mode is active #45
Comments
Actually, now that there's a buffer-local minor mode, is there a reason for this advice to exist? (As opposed to the minor mode taking care of it?) |
Also |
Thanks very much for your issue and analysis. Excusing myself as merely the maintainer, not the author, of this code, albeit one who relies on it every day, I am nervous of making changes. I would however be happy to review a pull request accompanied by the sort of exegesis you give above. If I simply removed the advice, wouldn't that mean that the global mode would never be disabled automatically? (I find that really useful.) Also, since the action of the advice is only to disable dtrt-indent settings, that seems fairly safe even if it's not being used. I agree that |
Ah, I see. I suspect you're right about the advice still being useful as-is, although you could possibly still do without it by just checking The processing for local variables changed a bit in 26.1, so it would be worth testing in both 25 and 26. |
Thanks again. I don't really have time to test in multiple Emacsen (unless someone can automate that in Travis‽) so I'm happy if it works in 26 (which I'm using). |
(defadvice hack-one-local-variable (before dtrt-indent-advise-hack-one-local-variable activate)
That
activate
means that the advice is immediately doing things if the library is loaded, regardless of whether the user intends fordtrt-indent
to be active.The version I had installed used a :global minor mode, and therefore I had written a fix to enable/disable the advice in the body of that mode. I see that the current code has switched to a globalized mode, so the situation is more awkward now, as people can enable the buffer-local minor mode independently of the global mode.
As such my intended fix isn't useful as a pull request; but I still think that advice should do as little as possible in cases where
dtrt-indent
isn't going to act.And in any case, there should be a defun
dtrt-indent-unload-function
which disables the advice (refer to(elisp) Unloading
).FWIW the following is what I'd written for the old global mode:
The text was updated successfully, but these errors were encountered: