modified term-mode-hook