Ticket #241: migemo.diff

File migemo.diff, 2.8 kB (added by anonymous, 2 years ago)

オリジナルのmigemoに対するパッチ

  • migemo.el

    old new  
    146146(defvar migemo-process nil) 
    147147(defvar migemo-buffer nil) 
    148148(defvar migemo-current-input-method nil) 
     149(defvar migemo-input-method-function nil) 
    149150(defvar migemo-search-pattern nil) 
    150151(defvar migemo-pattern-alist nil) 
    151152(defvar migemo-frequent-pattern-alist nil) 
     
    533534  (when (and migemo-isearch-enable-p 
    534535             (boundp 'current-input-method)) 
    535536    (setq migemo-current-input-method current-input-method) 
    536     (when (and migemo-mw32-input-method 
    537                (stringp migemo-current-input-method) 
    538                (string= migemo-current-input-method migemo-mw32-input-method)) 
    539       (set-input-method nil)) 
     537    (setq migemo-input-method-function input-method-function) 
    540538    (setq current-input-method nil))) 
    541539 
    542540(defadvice isearch-done (after migemo-search-ad activate) 
     
    545543  (setq migemo-search-pattern-alist nil) 
    546544  (when (and migemo-isearch-enable-p 
    547545             (boundp 'current-input-method)) 
    548     (when (and migemo-mw32-input-method 
    549                (stringp migemo-current-input-method) 
    550                (string= migemo-current-input-method migemo-mw32-input-method)) 
    551       (set-input-method migemo-current-input-method)) 
    552     (setq current-input-method migemo-current-input-method))) 
     546    (if (and migemo-mw32-input-method 
     547             (and current-input-method 
     548                  (string= current-input-method migemo-mw32-input-method)) 
     549             (not (and migemo-current-input-method 
     550                       (string= migemo-current-input-method migemo-mw32-input-method)))) 
     551        (run-hooks 'mw32-ime-off-hook)) 
     552    (setq current-input-method migemo-current-input-method) 
     553    (setq input-method-function migemo-input-method-function))) 
    553554 
    554555(defcustom migemo-message-prefix-face 'highlight 
    555556  "*Face of minibuffer prefix" 
     
    629630    (interactive) 
    630631    (unless (or isearch-regexp isearch-word) 
    631632      (discard-input) 
    632       (setq migemo-isearch-enable-p (not migemo-isearch-enable-p))) 
     633      (if (setq migemo-isearch-enable-p (not migemo-isearch-enable-p)) 
     634          (when (boundp 'current-input-method) 
     635            (setq migemo-current-input-method current-input-method) 
     636            (setq migemo-input-method-function input-method-function) 
     637            (setq current-input-method nil) 
     638            (setq input-method-function nil)) 
     639        (when (boundp 'current-input-method) 
     640          (if (and migemo-mw32-input-method 
     641                   (and current-input-method 
     642                        (string= current-input-method migemo-mw32-input-method)) 
     643                   (not (and migemo-current-input-method 
     644                             (string= migemo-current-input-method migemo-mw32-input-method)))) 
     645              (run-hooks 'mw32-ime-off-hook)) 
     646          (setq current-input-method  migemo-current-input-method) 
     647          (setq input-method-function migemo-input-method-function)))) 
    633648    (when (fboundp 'isearch-lazy-highlight-new-loop) 
    634649      (let ((isearch-lazy-highlight-last-string nil)) 
    635650        (condition-case nil