Hooks extension point mechanism (as known, e.g., from GNU Emacs)