feat: distinguish [C-m] key from RET
Now, uses can rebind ctrl+m by targeting [C-m] (or "<C-m>", same thing),
and it won't rebind RET. This will only work in GUI Emacs, however, and
there is no kkp support for this one.
Ref: 96d7e50f3e
This commit is contained in:
parent
4fc11b696e
commit
de1ffbca11
1 changed files with 11 additions and 0 deletions
|
@ -68,6 +68,17 @@ and Emacs states, and for non-evil users.")
|
|||
(key-binding (vconcat (cl-subseq keys 0 -1) [C-i]) nil t)))
|
||||
[C-i] [?\C-i])))
|
||||
|
||||
;; HACK: Same as C-i, but C-m is a little harder. There is no workaround for
|
||||
;; this for the terminal.
|
||||
(define-key input-decode-map
|
||||
[?\C-m] (cmd! (if (when-let ((keys (this-single-command-raw-keys)))
|
||||
(and (display-graphic-p)
|
||||
(not (cl-position 'return keys))
|
||||
(not (cl-position 'kp-return keys))
|
||||
;; Fall back if no <C-m> keybind can be found.
|
||||
(key-binding (vconcat (cl-subseq keys 0 -1) [C-m]) nil t)))
|
||||
[C-m] [?\C-m])))
|
||||
|
||||
|
||||
;;
|
||||
;;; Universal, non-nuclear escape
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue