From: Sean Whitton Date: Mon, 20 Jun 2022 21:33:51 +0000 (-0700) Subject: term-set-escape-char: Remove old binding from term-raw-escape-map X-Git-Tag: emacs-29.0.90~1447^2~1579 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=25e69968b05df4116ff669277386c1529c545d6b;p=emacs.git 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. --- 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))