没啥问题,我改了下切换的代码。
(if (and (eq system-type 'darwin) (fboundp 'mac-input-source))
(progn
(defvar ime-list '("im.rime.inputmethod.Squirrel.Hans" "com.apple.keylayout.ABC"))
(defun toggle-ime ()
(interactive)
(let* ((current-ime (mac-input-source))
(next-ime (or (cadr (member current-ime ime-list))
(car ime-list)))) ;; Cycle to the next IME or start from the beginning
(mac-select-input-source next-ime)))
;; Bind F13 to toggle IME
(global-set-key (kbd "<f13>") 'toggle-ime)))