-
Notifications
You must be signed in to change notification settings - Fork 12
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
el-patch convenience directives to emulate advice-add #37
Comments
Maybe this is a dumb question, but what's wrong with advice? |
No, it's not a dumb question. I was wondering this: if I get the feeling there's a reason why (in |
Uh, how would The point of |
Thanks, your answer cleared up my misunderstanding. I'm ready to close this issue but will wait one day until doing so unless you wanted to say anything else. |
@raxod502 what makes advice more robust and flexible? |
Because it doesn't need to be updated when the original code changes, unless it depends in some important functional way on the original function behavior. |
But , given that To be clear; I'm not trying to cause annoyance by nitpicking correctness; I'm trying to clarify my understanding. |
Yeah, I guess now that templates have been added, you could use them to achieve more or less the same thing as advice. I don't know that they would support stacking and ordering though. You can have arbitrarily many advices registered by different systems and they will all work together in a defined way. I don't think that would be the case with |
Makes sense, thank you. |
There are some functions that I can customize to my liking by either using
around
advice oroverriding
advice as opposed to copying the whole to my init file and using the el-patch directives. However, I'd still like the ability to track if any changes have occurred to the original definitions.I know that if I wanted to emulate overriding, for example, I can do:
(el-patch-defun my-fun (args) (el-patch-swap (long original definition that I don't want to copy into my init file...) (new definition))
However I'd like to be able to do something like:
(el-patch-defun my-fun (args) (el-patch-override (new-definition))
.Where
el-patch-override
would be the same asel-patch-swap
but using the whole definition.I think what I'm asking boils down to:
Does el-patch provide a way to reference the definition original function definition without writing it out?
Does el-patch provide a way to define my own custom directives (so I could create
el-patch-override
)?The text was updated successfully, but these errors were encountered: