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

global minor mode to add advice to a reasonable default set of functions? #1

Open
wbolster opened this issue Feb 3, 2021 · 2 comments

Comments

@wbolster
Copy link

wbolster commented Feb 3, 2021

the readme explains that

Users can modify commands like shell-command-to-string using the inheritenv-add-advice macro.

💡 perhaps it would be nice to have a global minor mode inheritenv-mode (inheritenv-global-mode?) that does this for a reasonable default set of functions, such as shell-command-to-string, so that individuals don't have to figure out the details in the common case?

@purcell
Copy link
Owner

purcell commented Feb 3, 2021

Yes, that's potentially a good idea, but primarily for built-ins. Regarding other authors' packages, I think that where possible they should modify their code to do the right thing (e.g. by using inheritenv). I'd worry a little about making this package a dumping ground for workarounds. Of course, in envrc I now have a hard-coded workaround for shell-command-to-string, which is only enabled in envrc-mode, so that's kinda similar, and arguably an inheritenv-mode would be more appropriate.

If I provided such a mode, I'd do the usual thing of providing both a local minor mode and a globalized version of it, just for flexibility. envrc-mode could then unconditionally enable the local minor mode.

Thanks for the suggestion!

@astoff
Copy link

astoff commented Feb 10, 2021

Maybe it suffices to provide a suggested configuration in the Readme? Then users would know upfront which commands benefit from the advice.

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

No branches or pull requests

3 participants