(These probably aren't great name examples). The advantage of the latter is that if the hook function is changed everything will work out, whereas re-doing add-hook with a changed anonymous function will result in both the new and old anonymous functions being run.
i.e. instead of this:
use this:
(These probably aren't great name examples). The advantage of the latter is that if the hook function is changed everything will work out, whereas re-doing
add-hook
with a changed anonymous function will result in both the new and old anonymous functions being run.