branch: externals/mct
commit 1d254a0bb7e8596dc2c17351cc9ec2bffa4de014
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>
Handle backspace or DEL in mct-tcm
For a discussion, see issue 25:
<https://gitlab.com/protesilaos/mct/-/issues/25>.
---
mct-tcm.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/mct-tcm.el b/mct-tcm.el
index 4058a3631d..b2100ae032 100644
--- a/mct-tcm.el
+++ b/mct-tcm.el
@@ -81,10 +81,12 @@ place, the current session is treated as if it belongs to
the
(setq-local mct-live-update-delay 0)
(setq-local mct-minimum-input 0)
;; FIXME 2022-02-24: Why does Emacs 27 insert twice? In other
- ;; words, why does it add the character even if the following is
+ ;; words, why does it add the character even if the `insert' is
;; commented out?
(when (>= emacs-major-version 28)
- (insert char)))))
+ (if (eq char 127) ; DEL or <backspace>
+ (delete-char -1)
+ (insert char))))))
(defun mct-tcm--setup-redirect-self-insert ()
"Set up `mct-tcm--redirect-self-insert'."