diff --git a/init.el b/init.el index 160f24a..1fde547 100644 --- a/init.el +++ b/init.el @@ -200,7 +200,17 @@ Interactively, force the recompile if called with a prefix." ;; kitty keyboard protocol (use-package kkp :config - (global-kkp-mode 1)) + (global-kkp-mode 1) + (defun my/-kkp-fix-save-some-buffers (oldfun &optional arg pred) + "Fix `save-some-buffers' when used in a terminal with kkp enabled." + (let ((status (kkp--terminal-has-active-kkp-p))) + (unwind-protect + (progn + (when status (kkp--suspend-in-terminal)) + (funcall oldfun arg pred)) + (when status (kkp--resume-in-terminal))))) + (advice-add #'save-some-buffers :around + #'my/-kkp-fix-save-some-buffers)) ;; mozc (require 'mozc nil t)