Make save-some-buffers work with kkp

This commit is contained in:
Alexander Rosenberg 2024-05-04 03:08:25 -07:00
parent 9d3d6f5450
commit 08fa9c6497
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

12
init.el
View File

@ -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)