]> code.delx.au - gnu-emacs/blob - lisp/international/isearch-x.el
(create-fontset-from-fontset-spec): Typo in doc-string fixed.
[gnu-emacs] / lisp / international / isearch-x.el
1 ;;; isearch-x.el --- extended isearch handling commands
2
3 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
4 ;; Licensed to the Free Software Foundation.
5
6 ;; Keywords: multilingual, isearch
7
8 ;; Author: Kenichi HANDA <handa@etl.go.jp>
9 ;; Maintainer: Kenichi HANDA <handa@etl.go.jp>
10
11 ;; This file is part of GNU Emacs.
12
13 ;; GNU Emacs is free software; you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; any later version.
17
18 ;; GNU Emacs is distributed in the hope that it will be useful,
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;; GNU General Public License for more details.
22
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 ;; Boston, MA 02111-1307, USA.
27
28 ;;; Code:
29
30 ;;;###autoload
31 (defvar isearch-input-method nil
32 "Input method activated in interactive search.")
33
34 (defvar isearch-input-method-title nil
35 "Title string of input method activated in interactive search.")
36
37 ;;;###autoload
38 (defun isearch-toggle-specified-input-method ()
39 "Select an input method and turn it on in interactive search."
40 (interactive)
41 (setq isearch-input-method nil)
42 (let ((default-input-method nil))
43 (isearch-toggle-input-method)))
44
45 ;;;###autoload
46 (defun isearch-toggle-input-method ()
47 "Toggle input method in interactive search."
48 (interactive)
49 (if isearch-input-method
50 (setq isearch-input-method nil)
51 (setq isearch-input-method
52 (or default-input-method
53 (let ((overriding-terminal-local-map nil))
54 (read-input-method-name "Input method: "))))
55 (if isearch-input-method
56 (setq isearch-input-method-title
57 (nth 3 (assoc isearch-input-method input-method-alist)))
58 (ding)))
59 (isearch-update))
60
61 (defun isearch-input-method-after-insert-chunk-function ()
62 (funcall inactivate-current-input-method-function))
63
64 (defun isearch-process-search-multibyte-characters (last-char)
65 (let ((overriding-terminal-local-map nil)
66 ;; Let input method exit when a chunk is inserted.
67 (input-method-after-insert-chunk-hook
68 '(isearch-input-method-after-insert-chunk-function))
69 (input-method-inactivate-hook '(exit-minibuffer))
70 ;; Let input method work rather tersely.
71 (input-method-tersely-flag t)
72 str)
73 (setq unread-command-events (cons last-char unread-command-events))
74 (setq str (read-multilingual-string
75 (concat (isearch-message-prefix) isearch-message)
76 nil
77 isearch-input-method))
78 (isearch-process-search-string str str)))
79
80 ;;; isearch-x.el ends here