I am trying to create a buffer local advice to run some code when a minor mode is disabled. I looked through the documentation for add-function
and saw this
If PLACE is a symbol, its `default-value' will be affected.
Use (local 'SYMBOL) if you want to apply FUNCTION to SYMBOL buffer-locally.
Use (var VAR) if you want to apply FUNCTION to the (lexical) VAR.
however I have tried every variant of the code below that I could think of.
(advice-add (local 'company-mode) :after 'my-func)
I just get a variety of errors such as Symbol’s function definition is void: local
or Wrong type argument: symbolp, (local company-mode)
. I looked through the nadvice code and it seems like what I have should work, but it doesn't. How do I create a buffer local advice?