Add workaround for non-terminating Emacs because of an error in the Hook.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>