Fix Emacs hang when using doc-mode