From e988914505a694b00eaff60ca226400d998c19aa Mon Sep 17 00:00:00 2001 From: Karl Otness Date: Sat, 21 Apr 2018 23:01:11 -0400 Subject: [PATCH] Fix pre- and post-command-hook errors in term.el Before this patch, after the terminal process dies the command hooks added in term-mode's char mode would produce errors. This fix removes these hooks when the process dies. --- lisp/term.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/term.el b/lisp/term.el index cfb39c34e5..017b0221ec 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -1456,6 +1456,9 @@ term-handle-exit (let ((buffer-read-only nil) (omax (point-max)) (opoint (point))) + ;; Remove hooks to avoid errors due to dead process. + (remove-hook 'pre-command-hook #'term-set-goto-process-mark t) + (remove-hook 'post-command-hook #'term-goto-process-mark-maybe t) ;; Record where we put the message, so we can ignore it ;; later on. (goto-char omax) -- 2.17.0