diff --git a/elisp/mozc-posframe.el b/elisp/mozc-posframe.el index b7c1b2c..04b3a64 100644 --- a/elisp/mozc-posframe.el +++ b/elisp/mozc-posframe.el @@ -47,7 +47,9 @@ CANDIDATES is the list of candidates." pos (1+ pos) 'display `(space :align-to (,(- width right-width)))))) (posframe-show (current-buffer) - :position position)))) + :position position + :border-width 1 + :border-color (face-attribute 'default :foreground))))) (add-to-list 'mozc-candidate-dispatch-table '(posframe (clean-up . my/-mozc-cand-posframe-clean-up) diff --git a/init.el b/init.el index e084ecb..473d875 100644 --- a/init.el +++ b/init.el @@ -693,8 +693,20 @@ directory. Otherwise, run `find-file' on that file." (setq default-input-method "japanese-mozc") (with-eval-after-load 'mozc (defvar mozc-candidate-style) + (defvar mozc-candidate-dispatch-table) (require 'mozc-posframe) - (setq mozc-candidate-style 'posframe)) + (setq mozc-candidate-style 'posframe) + (defun my/-mozc-candidate-dispatch-posframe-in-echo-area (method &rest args) + "Make `mozc-candidate-dispatch' use posframe from the echo area. +METHOD and ARGS are as to `mozc-candidate-dispatch'." + (let* ((method-table (cdr (assq mozc-candidate-style + mozc-candidate-dispatch-table))) + (func (cdr (assq method method-table)))) + (if func + (apply func args) + (signal 'mozc-internal-error (list mozc-candidate-style method args))))) + (advice-add 'mozc-candidate-dispatch :override + #'my/-mozc-candidate-dispatch-posframe-in-echo-area)) (face-spec-set 'mozc-cand-overlay-focused-face '((t :foreground unspecified :background unspecified