comparison lisp/isearch.el @ 22775:ede5d8c1f929

(isearch-input-method-function): New variable. (isearch-input-method-local-p): New variable. (isearch-mode): Setup the above two variable. Set input-method-function to nil locally. (isearch-done): Restore the previous value of input-method-function.
author Kenichi Handa <handa@m17n.org>
date Sun, 19 Jul 1998 05:17:35 +0000
parents f148cf6092bb
children e74ff474ff9b
comparison
equal deleted inserted replaced
22774:a0909e59257d 22775:ede5d8c1f929
384 ;; New value of isearch-forward after isearch-edit-string. 384 ;; New value of isearch-forward after isearch-edit-string.
385 (defvar isearch-new-forward nil) 385 (defvar isearch-new-forward nil)
386 386
387 ;; Accumulate here the overlays opened during searching. 387 ;; Accumulate here the overlays opened during searching.
388 (defvar isearch-opened-overlays nil) 388 (defvar isearch-opened-overlays nil)
389
390 ;; The value of input-method-function when isearch is invoked.
391 (defvar isearch-input-method-function nil)
392
393 ;; A flag to tell if input-method-function is locally bound when
394 ;; isearch is invoked.
395 (defvar isearch-input-method-local-p nil)
389 396
390 ;; Minor-mode-alist changes - kind of redundant with the 397 ;; Minor-mode-alist changes - kind of redundant with the
391 ;; echo area, but if isearching in multiple windows, it can be useful. 398 ;; echo area, but if isearching in multiple windows, it can be useful.
392 399
393 (or (assq 'isearch-mode minor-mode-alist) 400 (or (assq 'isearch-mode minor-mode-alist)
521 isearch-just-started t 528 isearch-just-started t
522 529
523 isearch-opoint (point) 530 isearch-opoint (point)
524 search-ring-yank-pointer nil 531 search-ring-yank-pointer nil
525 isearch-opened-overlays nil 532 isearch-opened-overlays nil
533 isearch-input-method-function input-method-function
534 isearch-input-method-local-p (local-variable-p 'input-method-function)
526 regexp-search-ring-yank-pointer nil) 535 regexp-search-ring-yank-pointer nil)
536
537 ;; We must bypass input method while reading key. When a user type
538 ;; printable character, appropriate input method is turned on in
539 ;; minibuffer to read multibyte charactes.
540 (or isearch-input-method-local-p
541 (make-local-variable 'input-method-function))
542 (setq input-method-function nil)
543
527 (looking-at "") 544 (looking-at "")
528 (setq isearch-window-configuration 545 (setq isearch-window-configuration
529 (if isearch-slow-terminal-mode (current-window-configuration) nil)) 546 (if isearch-slow-terminal-mode (current-window-configuration) nil))
530 547
531 ;; Maybe make minibuffer frame visible and/or raise it. 548 ;; Maybe make minibuffer frame visible and/or raise it.
619 (push-mark isearch-opoint t) 636 (push-mark isearch-opoint t)
620 (or executing-kbd-macro (> (minibuffer-depth) 0) 637 (or executing-kbd-macro (> (minibuffer-depth) 0)
621 (message "Mark saved where search started")))))) 638 (message "Mark saved where search started"))))))
622 639
623 (setq isearch-mode nil) 640 (setq isearch-mode nil)
641 (if isearch-input-method-local-p
642 (setq input-method-function isearch-input-method-function)
643 (kill-local-variable 'input-method-function))
644
624 (force-mode-line-update) 645 (force-mode-line-update)
625 646
626 (if (and (> (length isearch-string) 0) (not nopush)) 647 (if (and (> (length isearch-string) 0) (not nopush))
627 ;; Update the ring data. 648 ;; Update the ring data.
628 (isearch-update-ring isearch-string isearch-regexp)) 649 (isearch-update-ring isearch-string isearch-regexp))