summaryrefslogtreecommitdiff
path: root/lisp/international/isearch-x.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2020-11-06 10:31:58 +0200
committerJuri Linkov <juri@linkov.net>2020-11-06 10:31:58 +0200
commitaf6891629d48f348b6458384898a637cc7ce16e7 (patch)
treee88c153ad14a9d4866548e5a24aa5d2fa1fa0247 /lisp/international/isearch-x.el
parent2180ccbe29701f274d8390355d13ee41cf9727be (diff)
downloademacs-af6891629d48f348b6458384898a637cc7ce16e7.tar.gz
emacs-af6891629d48f348b6458384898a637cc7ce16e7.tar.bz2
emacs-af6891629d48f348b6458384898a637cc7ce16e7.zip
Support transient input methods in Isearch mode (bug#44266)
* doc/emacs/mule.texi (Select Input Method): Rename transient-input-method to activate-transient-input-method. * doc/emacs/search.texi (Special Isearch): Document isearch-transient-input-method. * lisp/international/isearch-x.el (isearch-transient-input-method): New function. (isearch-process-search-multibyte-characters): Call 'deactivate-transient-input-method' after 'read-string'. * lisp/international/mule-cmds.el (mule-menu-keymap): Remove duplicate menu item 'describe-input-method'. Add new menu item 'activate-transient-input-method'. (default-transient-input-method): Rename from transient-input-method. (current-transient-input-method) (previous-transient-input-method): New buffer-local variables. (deactivate-input-method): Don't add current-transient-input-method to input-method-history. (toggle-input-method): Call deactivate-transient-input-method when current-transient-input-method is non-nil. (activate-transient-input-method): Rename from transient-input-method. (deactivate-transient-input-method): New function with body from renamed function transient-input-method. * lisp/isearch.el (isearch-menu-bar-map): Add new menu item 'isearch-transient-input-method'. (isearch-mode-map): Bind 'C-x \' to isearch-transient-input-method. (isearch-forward): Add isearch-transient-input-method to docstring. (isearch-message-prefix): Use shorter string for narrowed buffer.
Diffstat (limited to 'lisp/international/isearch-x.el')
-rw-r--r--lisp/international/isearch-x.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/international/isearch-x.el b/lisp/international/isearch-x.el
index d77234ec77b..f50f86a035f 100644
--- a/lisp/international/isearch-x.el
+++ b/lisp/international/isearch-x.el
@@ -51,6 +51,17 @@
(setq input-method-function nil)
(isearch-update))
+;;;###autoload
+(defun isearch-transient-input-method ()
+ "Activate transient input method in interactive search."
+ (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)
+ (isearch-update))
+
(defvar isearch-minibuffer-local-map
(let ((map (copy-keymap minibuffer-local-map)))
(define-key map [with-keyboard-coding] 'isearch-with-keyboard-coding)
@@ -117,6 +128,7 @@
(cons last-char unread-command-events))
;; Inherit current-input-method in a minibuffer.
str (read-string prompt isearch-message 'junk-hist nil t))
+ (deactivate-transient-input-method)
(if (or (not str) (< (length str) (length isearch-message)))
;; All inputs were deleted while the input method
;; was working.