Fix some more kkp stuff
This commit is contained in:
parent
998d5cf3fa
commit
04fa288627
18
init.el
18
init.el
@ -398,27 +398,27 @@ directory. Otherwise, run `find-file' on that file."
|
|||||||
(insert-and-inherit char)
|
(insert-and-inherit char)
|
||||||
(setq arg (1- arg))))))
|
(setq arg (1- arg))))))
|
||||||
(keymap-global-set "C-q" #'my/quoted-insert)
|
(keymap-global-set "C-q" #'my/quoted-insert)
|
||||||
(defun my/-kkp-fix-save-some-buffers (oldfun &optional arg pred)
|
(defun my/-kkp-fix-map-y-or-n-p (oldfun &rest args)
|
||||||
"Fix `save-some-buffers' 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--terminal-has-active-kkp-p)))
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(progn
|
(progn
|
||||||
(when status (kkp--terminal-teardown (kkp--selected-terminal)))
|
(when status (kkp--terminal-teardown (kkp--selected-terminal)))
|
||||||
(funcall oldfun arg pred))
|
(apply oldfun args))
|
||||||
(when (and status (not (kkp--terminal-has-active-kkp-p)))
|
(when (and status (not (kkp--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 exists. 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
|
||||||
(let ((will-die-p))
|
(let ((will-die))
|
||||||
(mapbacktrace
|
(mapbacktrace
|
||||||
(lambda (_evald func _args _flags)
|
(lambda (_evald func _args _flags)
|
||||||
(when (or (eq func 'save-buffers-kill-emacs)
|
(when (or (eq func 'save-buffers-kill-emacs)
|
||||||
(eq func 'server-save-buffers-kill-terminal))
|
(eq func 'server-save-buffers-kill-terminal))
|
||||||
(setq will-die-p t))))
|
(setq will-die t))))
|
||||||
(unless will-die-p
|
(unless will-die
|
||||||
(kkp-enable-in-terminal)))))))
|
(kkp-enable-in-terminal)))))))
|
||||||
(advice-add #'save-some-buffers :around
|
(advice-add #'map-y-or-n-p :around
|
||||||
#'my/-kkp-fix-save-some-buffers))
|
#'my/-kkp-fix-map-y-or-n-p))
|
||||||
|
|
||||||
;; mozc
|
;; mozc
|
||||||
(require 'mozc nil t)
|
(require 'mozc nil t)
|
||||||
|
Loading…
Reference in New Issue
Block a user