aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Otness2018-04-21 23:01:11 -0400
committerEli Zaretskii2018-04-22 20:06:50 +0300
commitd6e2c593180934926fa4cc5b58fdab82b20f5f14 (patch)
treefa91f17df79d95916ea2b34d7aadc1d8fd8e5fec
parent6cf83131e263fd66fb0ae224bf83b1909b66157d (diff)
downloademacs-d6e2c593180934926fa4cc5b58fdab82b20f5f14.tar.gz
emacs-d6e2c593180934926fa4cc5b58fdab82b20f5f14.zip
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 (term-handle-exit): Remove pre-command-hook and post-command-hook because the process is dead. (Bug#31236) Copyright-paperwork-exempt: yes
-rw-r--r--lisp/term.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/term.el b/lisp/term.el
index 6860ea69342..75c27797838 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -1484,6 +1484,9 @@ The main purpose is to get rid of the local keymap."
1484 (let ((buffer-read-only nil) 1484 (let ((buffer-read-only nil)
1485 (omax (point-max)) 1485 (omax (point-max))
1486 (opoint (point))) 1486 (opoint (point)))
1487 ;; Remove hooks to avoid errors due to dead process.
1488 (remove-hook 'pre-command-hook #'term-set-goto-process-mark t)
1489 (remove-hook 'post-command-hook #'term-goto-process-mark-maybe t)
1487 ;; Record where we put the message, so we can ignore it 1490 ;; Record where we put the message, so we can ignore it
1488 ;; later on. 1491 ;; later on.
1489 (goto-char omax) 1492 (goto-char omax)