Richard Stallman wrote:
Then in `flymake-mode' a call to the functions
`flymake-add-survivor' and `flymake-remove-survivor \(which was
defined by the macro called above) must be done.
This seems like a very cumbersome interface. I think it is very
unclean to dynamically change `permanent-local' properties. That's
the sort of thing that we are sure to regret.
We should use my mechanism instead. It is simple and clean.
That is very fine with me.
I suggest then adding something like this to the end of add-hook:
(when (and local
(get function 'permanent-local-in-hooks))
(put hook 'permanent-local-hook t)
Then in kill-local-variables check for the property
'permanent-local-hook and handle the hook accordingly.
I can see no reasonable way to remove the property 'permanent-local-hook
from the hook variable. (The problem is that properties do not have
buffer local values. It could be simulated by having a buffer local
variable carrying the propery, but I see no reason to make it that
complicated.)