]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove isearch-input-method-local-p and always set buffer-local input-method
authorJuri Linkov <juri@linkov.net>
Wed, 9 Dec 2020 19:30:47 +0000 (21:30 +0200)
committerJuri Linkov <juri@linkov.net>
Wed, 9 Dec 2020 19:30:47 +0000 (21:30 +0200)
* lisp/isearch.el (isearch-input-method-local-p): Remove defvar.
(isearch-mode): Don't set isearch-input-method-local-p.
Set buffer-local input-method-function to nil.
(isearch-done): When isearch-input-method-function is still non-nil,
set the buffer-local value of input-method-function.  (Bug#45005)

* lisp/international/isearch-x.el (isearch-toggle-specified-input-method)
(isearch-toggle-input-method, isearch-transient-input-method):
Don't set isearch-input-method-local-p to t.  Set buffer-local
input-method-function to nil.

* lisp/language/korea-util.el (isearch-toggle-korean-input-method)
(isearch-hangul-switch-symbol-ksc, isearch-hangul-switch-hanja):
Don't set isearch-input-method-local-p to t.  Set buffer-local
input-method-function to nil.

lisp/international/isearch-x.el
lisp/isearch.el
lisp/language/korea-util.el

index f50f86a035f1f37f7581ef7d6be61f4dbc22511c..867a3d869733fb1131e07e72f5cd2ae98a0dafa3 100644 (file)
@@ -35,9 +35,8 @@
   (interactive)
   (let ((overriding-terminal-local-map nil))
     (toggle-input-method t))
-  (setq isearch-input-method-function input-method-function
-       isearch-input-method-local-p t)
-  (setq input-method-function nil)
+  (setq isearch-input-method-function input-method-function)
+  (setq-local input-method-function nil)
   (isearch-update))
 
 ;;;###autoload
@@ -46,9 +45,8 @@
   (interactive)
   (let ((overriding-terminal-local-map nil))
     (toggle-input-method))
-  (setq isearch-input-method-function input-method-function
-       isearch-input-method-local-p t)
-  (setq input-method-function nil)
+  (setq isearch-input-method-function input-method-function)
+  (setq-local input-method-function nil)
   (isearch-update))
 
 ;;;###autoload
@@ -57,9 +55,8 @@
   (interactive)
   (let ((overriding-terminal-local-map nil))
     (activate-transient-input-method))
-  (setq isearch-input-method-function input-method-function
-       isearch-input-method-local-p t)
-  (setq input-method-function nil)
+  (setq isearch-input-method-function input-method-function)
+  (setq-local input-method-function nil)
   (isearch-update))
 
 (defvar isearch-minibuffer-local-map
index a0aa250c4b6a50eae0826e107a8dacf3fe8e0f4f..0d5c480c8d4f0d0912b1fd5e34b1c0358131a535 100644 (file)
@@ -965,10 +965,6 @@ Each element is an `isearch--state' struct where the slots are
 ;; The value of input-method-function when isearch is invoked.
 (defvar isearch-input-method-function nil)
 
-;; A flag to tell if input-method-function is locally bound when
-;; isearch is invoked.
-(defvar isearch-input-method-local-p nil)
-
 (defvar isearch--saved-overriding-local-map nil)
 
 ;; Minor-mode-alist changes - kind of redundant with the
@@ -1238,7 +1234,6 @@ used to set the value of `isearch-regexp-function'."
        search-ring-yank-pointer nil
        isearch-opened-overlays nil
        isearch-input-method-function input-method-function
-       isearch-input-method-local-p (local-variable-p 'input-method-function)
        regexp-search-ring-yank-pointer nil
 
        isearch-pre-scroll-point nil
@@ -1259,9 +1254,7 @@ used to set the value of `isearch-regexp-function'."
   ;; We must bypass input method while reading key.  When a user type
   ;; printable character, appropriate input method is turned on in
   ;; minibuffer to read multibyte characters.
-  (or isearch-input-method-local-p
-      (make-local-variable 'input-method-function))
-  (setq input-method-function nil)
+  (setq-local input-method-function nil)
 
   (looking-at "")
   (setq isearch-window-configuration
@@ -1418,8 +1411,8 @@ NOPUSH is t and EDIT is t."
        (set-window-group-start (selected-window) found-start t))))
 
   (setq isearch-mode nil)
-  (if isearch-input-method-local-p
-      (setq input-method-function isearch-input-method-function)
+  (if isearch-input-method-function
+      (setq-local input-method-function isearch-input-method-function)
     (kill-local-variable 'input-method-function))
 
   (if isearch-tool-bar-old-map
index 3821785da734c2b72ac41a4fefc97784fd84430d..36e1d20a22fccbde391e9a11196e1f013fb1c4b9 100644 (file)
   (interactive)
   (let ((overriding-terminal-local-map nil))
     (toggle-korean-input-method))
-  (setq isearch-input-method-function input-method-function
-       isearch-input-method-local-p t)
-  (setq input-method-function nil)
+  (setq isearch-input-method-function input-method-function)
+  (setq-local input-method-function nil)
   (isearch-update))
 
 (defun isearch-hangul-switch-symbol-ksc ()
   (interactive)
   (let ((overriding-terminal-local-map nil))
     (quail-hangul-switch-symbol-ksc))
-  (setq isearch-input-method-function input-method-function
-       isearch-input-method-local-p t)
-  (setq input-method-function nil)
+  (setq isearch-input-method-function input-method-function)
+  (setq-local input-method-function nil)
   (isearch-update))
 
 (defun isearch-hangul-switch-hanja ()
   (interactive)
   (let ((overriding-terminal-local-map nil))
     (quail-hangul-switch-hanja))
-  (setq isearch-input-method-function input-method-function
-       isearch-input-method-local-p t)
-  (setq input-method-function nil)
+  (setq isearch-input-method-function input-method-function)
+  (setq-local input-method-function nil)
   (isearch-update))
 
 ;; Information for setting and exiting Korean environment.