Fix kkp for the latest update
This commit is contained in:
parent
4282129190
commit
641aa325dc
18
init.el
18
init.el
@ -432,18 +432,6 @@ directory. Otherwise, run `find-file' on that file."
|
|||||||
:defer nil
|
:defer nil
|
||||||
:config
|
:config
|
||||||
(global-kkp-mode 1)
|
(global-kkp-mode 1)
|
||||||
;; (defun my/-kkp-after-terminal-setup ()
|
|
||||||
;; ;; Make tab and backtab work properly
|
|
||||||
;; (define-key input-decode-map [(control ?i)] [tab])
|
|
||||||
;; (define-key input-decode-map [(control ?I)] [backtab])
|
|
||||||
;; (define-key input-decode-map [(control ?m)] [return]))
|
|
||||||
;; (defun my/-kkp-after-terminal-teardown (term)
|
|
||||||
;; (with-selected-frame (car (frames-on-display-list term))
|
|
||||||
;; (define-key input-decode-map [(control ?i)] nil t)
|
|
||||||
;; (define-key input-decode-map [(control ?I)] nil t)
|
|
||||||
;; (define-key input-decode-map [(control ?m)] nil t)))
|
|
||||||
;; (advice-add 'kkp--terminal-setup :after 'my/-kkp-after-terminal-setup)
|
|
||||||
;; (advice-add 'kkp--terminal-teardown :after 'my/-kkp-after-terminal-teardown)
|
|
||||||
(defun my/quoted-insert (arg)
|
(defun my/quoted-insert (arg)
|
||||||
"Insert the next character using read-key, not read-char."
|
"Insert the next character using read-key, not read-char."
|
||||||
(interactive "*p")
|
(interactive "*p")
|
||||||
@ -460,18 +448,18 @@ directory. Otherwise, run `find-file' on that file."
|
|||||||
(keymap-global-set "C-q" #'my/quoted-insert)
|
(keymap-global-set "C-q" #'my/quoted-insert)
|
||||||
(defun my/-kkp-fix-map-y-or-n-p (oldfun &rest args)
|
(defun my/-kkp-fix-map-y-or-n-p (oldfun &rest args)
|
||||||
"Fix `map-y-or-n-p' when used in a terminal with kkp enabled."
|
"Fix `map-y-or-n-p' when used in a terminal with kkp enabled."
|
||||||
(let ((status (kkp--terminal-has-active-kkp-p)))
|
(let ((status (kkp--this-terminal-has-active-kkp-p)))
|
||||||
(condition-case err
|
(condition-case err
|
||||||
(progn
|
(progn
|
||||||
(when status (kkp-disable-in-terminal))
|
(when status (kkp-disable-in-terminal))
|
||||||
(apply oldfun args))
|
(apply oldfun args))
|
||||||
(quit
|
(quit
|
||||||
;; We won't die in this case, so just re-enable kkp
|
;; We won't die in this case, so just re-enable kkp
|
||||||
(when (and status (not (kkp--terminal-has-active-kkp-p)))
|
(when (and status (not (kkp--this-terminal-has-active-kkp-p)))
|
||||||
(kkp-enable-in-terminal))
|
(kkp-enable-in-terminal))
|
||||||
(signal 'quit nil))
|
(signal 'quit nil))
|
||||||
(t
|
(t
|
||||||
(when (and status (not (kkp--terminal-has-active-kkp-p)))
|
(when (and status (not (kkp--this-terminal-has-active-kkp-p)))
|
||||||
;; this does async stuff that will make kitty send characters after
|
;; this does async stuff that will make kitty send characters after
|
||||||
;; Emacs exits. We prevent that by not re-enabling if this frame (or
|
;; Emacs exits. We prevent that by not re-enabling if this frame (or
|
||||||
;; Emacs) is about to die
|
;; Emacs) is about to die
|
||||||
|
Loading…
x
Reference in New Issue
Block a user