From 25e69968b05df4116ff669277386c1529c545d6b Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 20 Jun 2022 14:33:51 -0700 Subject: [PATCH] term-set-escape-char: Remove old binding from term-raw-escape-map * lisp/term.el (term-set-escape-char): When replacing the escape char, remove the binding of the old escape char in term-raw-escape-map. --- lisp/term.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lisp/term.el b/lisp/term.el index f81cbf72930..94bf13e9736 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -1052,11 +1052,10 @@ underlying shell." "Change `term-escape-char' and keymaps that depend on it." (when term-escape-char ;; Undo previous term-set-escape-char. - (define-key term-raw-map term-escape-char 'term-send-raw)) + (define-key term-raw-map term-escape-char 'term-send-raw) + (define-key term-raw-escape-map term-escape-char nil t)) (setq term-escape-char (if (vectorp key) key (vector key))) (define-key term-raw-map term-escape-char term-raw-escape-map) - ;; FIXME: If we later call term-set-escape-char again with another key, - ;; we should undo this binding. (define-key term-raw-escape-map term-escape-char 'term-send-raw)) (term-set-escape-char (or term-escape-char ?\C-c)) -- 2.39.2