Mercurial > emacs
comparison lisp/international/isearch-x.el @ 17052:d0d7b244b1d0
Initial revision
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Thu, 20 Feb 1997 07:02:49 +0000 |
parents | |
children | 70194012fb3a |
comparison
equal
deleted
inserted
replaced
17051:fd0b17a79b07 | 17052:d0d7b244b1d0 |
---|---|
1 ;;; isearch-x.el --- extended isearch handling commands | |
2 | |
3 ;; Copyright (C) 1995 Free Software Foundation, Inc. | |
4 ;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. | |
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 | |
25 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
26 | |
27 ;;; Code: | |
28 | |
29 ;;;###autoload | |
30 (defun isearch-toggle-specified-input-method () | |
31 "Select and toggle specified input method in interactive search." | |
32 (interactive) | |
33 ;; Let the command `toggle-input-method' ask users to select input | |
34 ;; method interactively. | |
35 (setq default-input-method nil) | |
36 (isearch-toggle-input-method)) | |
37 | |
38 ;;;###autoload | |
39 (defun isearch-toggle-input-method () | |
40 "Toggle input method in interactive search." | |
41 (interactive) | |
42 (if isearch-multibyte-characters-flag | |
43 (setq isearch-multibyte-characters-flag nil) | |
44 (condition-case nil | |
45 (progn | |
46 (if (null default-input-method) | |
47 (let ((overriding-terminal-local-map nil)) | |
48 ;; No input method has ever been selected. Select one | |
49 ;; interactively now. This also sets | |
50 ;; `default-input-method-title' to the title of the | |
51 ;; selected input method. | |
52 (toggle-input-method) | |
53 ;; And, inactivate it for the moment. | |
54 (toggle-input-method))) | |
55 (setq isearch-multibyte-characters-flag t)) | |
56 (error (ding)))) | |
57 (isearch-update)) | |
58 | |
59 (defun isearch-input-method-after-insert-chunk-function () | |
60 (funcall inactivate-current-input-method-function)) | |
61 | |
62 (defun isearch-process-search-multibyte-characters (last-char) | |
63 (let* ((overriding-terminal-local-map nil) | |
64 ;; Let input method exit when a chunk is inserted. | |
65 (input-method-after-insert-chunk-hook | |
66 '(isearch-input-method-after-insert-chunk-function)) | |
67 (input-method-inactivate-hook '(exit-minibuffer)) | |
68 ;; Let input method work rather tersely. | |
69 (input-method-tersely-flag t) | |
70 str) | |
71 (setq unread-command-events (cons last-char unread-command-events)) | |
72 (setq str (read-multilingual-string (concat (isearch-message-prefix) | |
73 isearch-message))) | |
74 (isearch-process-search-string str str))) | |
75 | |
76 ;;; isearch-x.el ends here |