1 ;;; isearch.el --- incremental search minor mode.
3 ;; Copyright (C) 1992, 1993 Free Software Foundation, Inc.
5 ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
7 ;; |$Date: 1993/12/25 00:50:10 $|$Revision: 1.58 $
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is distributed in the hope that it will be useful,
12 ;; but WITHOUT ANY WARRANTY. No author or distributor
13 ;; accepts responsibility to anyone for the consequences of using it
14 ;; or for whether it serves any particular purpose or works at all,
15 ;; unless he says so in writing. Refer to the GNU Emacs General Public
16 ;; License for full details.
18 ;; Everyone is granted permission to copy, modify and redistribute
19 ;; GNU Emacs, but only under the conditions described in the
20 ;; GNU Emacs General Public License. A copy of this license is
21 ;; supposed to have been given to you along with GNU Emacs so you
22 ;; can know your rights and responsibilities. It should be in a
23 ;; file named COPYING. Among other things, the copyright notice
24 ;; and this notice must be preserved on all copies.
28 ;;;====================================================================
31 ;; For programmed use of isearch-mode, e.g. calling (isearch-forward),
32 ;; isearch-mode behaves modally and does not return until the search
33 ;; is completed. It uses a recursive-edit to behave this way. Note:
34 ;; gnus does it wrong: (call-interactively 'isearch-forward).
36 ;; The key bindings active within isearch-mode are defined below in
37 ;; `isearch-mode-map' which is given bindings close to the default
38 ;; characters of the original isearch.el. With `isearch-mode',
39 ;; however, you can bind multi-character keys and it should be easier
40 ;; to add new commands. One bug though: keys with meta-prefix cannot
41 ;; be longer than two chars. Also see minibuffer-local-isearch-map
42 ;; for bindings active during `isearch-edit-string'.
44 ;; Note to emacs version 19 users: isearch-mode should work even if
45 ;; you switch windows with the mouse, in which case isearch-mode is
46 ;; terminated automatically before the switch. This is true of lemacs
47 ;; too, with a few more cleanups I've neglected in this release.
48 ;; No one has supplied patches for epoch yet.
50 ;; The search ring and completion commands automatically put you in
51 ;; the minibuffer to edit the string. This gives you a chance to
52 ;; modify the search string before executing the search. There are
53 ;; three commands to terminate the editing: C-s and C-r exit the
54 ;; minibuffer and search forward and reverse respectively, while C-m
55 ;; exits and does a nonincremental search.
57 ;; Exiting immediately from isearch uses isearch-edit-string instead
58 ;; of nonincremental-search, if search-nonincremental-instead is non-nil.
59 ;; The name of this option should probably be changed if we decide to
60 ;; keep the behavior. No point in forcing nonincremental search until
61 ;; the last possible moment.
64 ;; - Integrate the emacs 19 generalized command history.
65 ;; - Think about incorporating query-replace.
66 ;; - Hooks and options for failed search.
70 ;;; Changes before those recorded in ChangeLog:
72 ;;; Revision 1.4 92/09/14 16:26:02 liberte
73 ;;; Added prefix args to isearch-forward, etc. to switch between
74 ;;; string and regular expression searching.
75 ;;; Added some support for lemacs.
76 ;;; Added general isearch-highlight option - but only for lemacs so far.
77 ;;; Added support for frame switching in emacs 19.
78 ;;; Added word search option to isearch-edit-string.
79 ;;; Renamed isearch-quit to isearch-abort.
80 ;;; Numerous changes to comments and doc strings.
82 ;;; Revision 1.3 92/06/29 13:10:08 liberte
83 ;;; Moved modal isearch-mode handling into isearch-mode.
84 ;;; Got rid of buffer-local isearch variables.
85 ;;; isearch-edit-string used by ring adjustments, completion, and
86 ;;; nonincremental searching. C-s and C-r are additional exit commands.
87 ;;; Renamed all regex to regexp.
88 ;;; Got rid of found-start and found-point globals.
89 ;;; Generalized handling of upper-case chars.
91 ;;; Revision 1.2 92/05/27 11:33:57 liberte
92 ;;; Emacs version 19 has a search ring, which is supported here.
93 ;;; Other fixes found in the version 19 isearch are included here.
95 ;;; Also see variables search-caps-disable-folding,
96 ;;; search-nonincremental-instead, search-whitespace-regexp, and
97 ;;; commands isearch-toggle-regexp, isearch-edit-string.
99 ;;; semi-modal isearching is supported.
102 ;;; 3/18/92 Fixed invalid-regexp.
103 ;;; 3/18/92 Fixed yanking in regexps.
108 ;;;=========================================================================
111 ;; isearch-mode takes advantage of the features provided by several
112 ;; different versions of emacs. Rather than testing the version of
113 ;; emacs, several constants are defined, one for each of the features.
114 ;; Each of the tests below must work on any version of emacs.
115 ;; (Perhaps provide and featurep could be used for this purpose.)
117 (defconst isearch-gnu-emacs-events
(fboundp 'set-frame-height
)) ;; emacs 19
118 (defconst isearch-pre-command-hook-exists
(boundp 'pre-command-hook
)) ;; lemacs
119 (defconst isearch-event-data-type nil
) ;; lemacs
121 (defconst search-exit-option t
122 "*Non-nil means random control characters terminate incremental search.")
124 (defvar search-slow-window-lines
1
125 "*Number of lines in slow search display windows.
126 These are the short windows used during incremental search on slow terminals.
127 Negative means put the slow search window at the top (normally it's at bottom)
128 and the value is minus the number of lines.")
130 (defvar search-slow-speed
1200
131 "*Highest terminal speed at which to use \"slow\" style incremental search.
132 This is the style where a one-line window is created to show the line
133 that the search has reached.")
135 ;;;========================================================================
136 ;;; Some additional options and constants.
138 (defvar search-upper-case
'not-yanks
139 "*If non-nil, upper case chars disable case fold searching.
140 That is, upper and lower case chars must match exactly.
141 This applies no matter where the chars come from, but does not
142 apply to chars in regexps that are prefixed with `\\'.
143 If this value is `not-yanks', yanked text is always downcased.")
145 (defvar search-nonincremental-instead t
146 "*If non-nil, do a nonincremental search instead if exiting immediately.
147 Actually, `isearch-edit-string' is called to let you enter the search
148 string, and RET terminates editing and does a nonincremental search.")
150 (defconst search-whitespace-regexp
"\\s-+"
151 "*If non-nil, regular expression to match a sequence of whitespace chars.
152 You might want to use something like \"[ \\t\\r\\n]+\" instead.")
154 ;; I removed the * from the doc string because highlighting is not
155 ;; currently a clean thing to do. Once highlighting is made clean,
156 ;; this feature can be re-enabled and advertised.
157 (defvar search-highlight nil
158 "*Non-nil means incremental search highlights the current match.")
160 (defvar isearch-mode-hook nil
161 "Function(s) to call after starting up an incremental search.")
163 (defvar isearch-mode-end-hook nil
164 "Function(s) to call after terminating an incremental search.")
166 ;;;==================================================================
169 (defvar search-ring nil
170 "List of search string sequences.")
171 (defvar regexp-search-ring nil
172 "List of regular expression search string sequences.")
174 (defconst search-ring-max
16
175 "*Maximum length of search ring before oldest elements are thrown away.")
176 (defconst regexp-search-ring-max
16
177 "*Maximum length of regexp search ring before oldest elements are thrown away.")
179 (defvar search-ring-yank-pointer nil
180 "Index in `search-ring' of last string reused.
182 (defvar regexp-search-ring-yank-pointer nil
183 "Index in `regexp-search-ring' of last string reused.
186 (defvar search-ring-update nil
187 "*Non-nil if advancing or retreating in the search ring should cause search.
188 Default value, nil, means edit the string instead.")
190 ;;;====================================================
191 ;;; Define isearch-mode keymap.
193 (defvar isearch-mode-map nil
194 "Keymap for isearch-mode.")
199 (or (vectorp (nth 1 map
))
200 (error "The initialization of isearch-mode-map must be updated"))
201 ;; Give this map a vector 256 long, for dense binding
202 ;; of a larger range of ordinary characters.
203 (setcar (cdr map
) (make-vector 256 nil
))
205 ;; Make function keys, etc, exit the search.
206 (define-key map
[t] 'isearch-other-control-char)
207 ;; Control chars, by default, end isearch mode transparently.
208 ;; We need these explicit definitions because, in a dense keymap,
209 ;; the binding for t does not affect characters.
210 ;; We use a dense keymap to save space.
212 (define-key map (make-string 1 i) 'isearch-other-control-char)
215 ;; Printing chars extend the search string by default.
217 (while (< i (length (nth 1 map)))
218 (define-key map (vector i) 'isearch-printing-char)
221 ;; Several non-printing chars change the searching behavior.
222 (define-key map "\C-s" 'isearch-repeat-forward)
223 (define-key map "\C-r" 'isearch-repeat-backward)
224 (define-key map "\177" 'isearch-delete-char)
225 (define-key map "\C-g" 'isearch-abort)
227 (define-key map "\C-q" 'isearch-quote-char)
229 (define-key map "\r" 'isearch-exit)
230 (define-key map "\C-j" 'isearch-printing-char)
231 (define-key map "\t" 'isearch-printing-char)
232 (define-key map " " 'isearch-whitespace-chars)
234 (define-key map "\C-w" 'isearch-yank-word)
235 (define-key map "\C-y" 'isearch-yank-line)
236 (define-key map [mouse-2] 'isearch-yank-kill)
237 ;; This overrides the default binding for t.
238 (define-key map [down-mouse-2] 'nil)
240 ;; Bind the ASCII-equivalent "function keys" explicitly
241 ;; if we bind their equivalents,
242 ;; since otherwise the default binding would override.
243 ;; We bind [escape] below.
244 (define-key map [tab] 'isearch-printing-char)
245 (define-key map [kp-0] 'isearch-printing-char)
246 (define-key map [kp-1] 'isearch-printing-char)
247 (define-key map [kp-2] 'isearch-printing-char)
248 (define-key map [kp-3] 'isearch-printing-char)
249 (define-key map [kp-4] 'isearch-printing-char)
250 (define-key map [kp-5] 'isearch-printing-char)
251 (define-key map [kp-6] 'isearch-printing-char)
252 (define-key map [kp-7] 'isearch-printing-char)
253 (define-key map [kp-8] 'isearch-printing-char)
254 (define-key map [kp-9] 'isearch-printing-char)
255 (define-key map [kp-add] 'isearch-printing-char)
256 (define-key map [kp-subtract] 'isearch-printing-char)
257 (define-key map [kp-multiply] 'isearch-printing-char)
258 (define-key map [kp-divide] 'isearch-printing-char)
259 (define-key map [kp-decimal] 'isearch-printing-char)
260 (define-key map [kp-separator] 'isearch-printing-char)
261 (define-key map [kp-equal] 'isearch-printing-char)
262 (define-key map [kp-tab] 'isearch-printing-char)
263 (define-key map [kp-space] 'isearch-printing-char)
264 (define-key map [kp-enter] 'isearch-exit)
265 (define-key map [delete] 'isearch-delete-char)
266 (define-key map [backspace] 'isearch-delete-char)
267 (define-key map [return] 'isearch-exit)
268 (define-key map [newline] 'isearch-printing-char)
270 ;; Define keys for regexp chars * ? |.
271 ;; Nothing special for + because it matches at least once.
272 (define-key map "*" 'isearch-*-char)
273 (define-key map "?" 'isearch-*-char)
274 (define-key map "|" 'isearch-|-char)
276 ;;; Turned off because I find I expect to get the global definition--rms.
277 ;;; ;; Instead bind C-h to special help command for isearch-mode.
278 ;;; (define-key map "\C-h" 'isearch-mode-help)
280 ;; To handle local bindings with meta char prefix keys, define
281 ;; another full keymap. This must be done for any other prefix
282 ;; keys as well, one full keymap per char of the prefix key. It
283 ;; would be simpler to disable the global keymap, and/or have a
284 ;; default local key binding for any key not otherwise bound.
285 (let ((meta-map (make-sparse-keymap)))
286 (define-key map (char-to-string meta-prefix-char) meta-map)
287 (define-key map [escape] meta-map))
288 (define-key map (vector meta-prefix-char t) 'isearch-other-meta-char)
290 (define-key map "\M-n" 'isearch-ring-advance)
291 (define-key map "\M-p" 'isearch-ring-retreat)
292 (define-key map "\M-y" 'isearch-yank-kill)
294 (define-key map "\M-\t" 'isearch-complete)
296 ;; For emacs 19, switching frames should terminate isearch-mode
297 (if isearch-gnu-emacs-events
298 (define-key map [switch-frame] 'isearch-switch-frame-handler))
300 (setq isearch-mode-map map)
303 ;; Some bindings you may want to put in your isearch-mode-hook.
304 ;; Suggest some alternates...
305 ;; (define-key isearch-mode-map "\C-t" 'isearch-toggle-regexp)
306 ;; (define-key isearch-mode-map "\C-^" 'isearch-edit-string)
309 (defvar minibuffer-local-isearch-map nil
310 "Keymap for editing isearch strings in the minibuffer.")
312 (or minibuffer-local-isearch-map
313 (let ((map (copy-keymap minibuffer-local-map)))
314 (define-key map "\r" 'isearch-nonincremental-exit-minibuffer)
315 (define-key map "\M-n" 'isearch-ring-advance-edit)
316 (define-key map "\M-p" 'isearch-ring-retreat-edit)
317 (define-key map "\M-\t" 'isearch-complete-edit)
318 (define-key map "\C-s" 'isearch-forward-exit-minibuffer)
319 (define-key map "\C-r" 'isearch-reverse-exit-minibuffer)
320 (setq minibuffer-local-isearch-map map)
323 ;;;========================================================
324 ;; Internal variables declared globally for byte-compiler.
325 ;; These are all set with setq while isearching
326 ;; and bound locally while editing the search string.
328 (defvar isearch-forward nil) ; Searching in the forward direction.
329 (defvar isearch-regexp nil) ; Searching for a regexp.
330 (defvar isearch-word nil) ; Searching for words.
332 (defvar isearch-cmds nil) ; Stack of search status sets.
333 (defvar isearch-string "") ; The current search string.
334 (defvar isearch-message "") ; text-char-description version of isearch-string
336 (defvar isearch-success t) ; Searching is currently successful.
337 (defvar isearch-invalid-regexp nil) ; Regexp not well formed.
338 (defvar isearch-other-end nil) ; Start (end) of match if forward (backward).
339 (defvar isearch-wrapped nil) ; Searching restarted from the top (bottom).
340 (defvar isearch-barrier 0)
342 (defvar isearch-case-fold-search nil) ; case-fold-search while searching.
344 (defvar isearch-adjusted nil)
345 (defvar isearch-slow-terminal-mode nil)
346 ;;; If t, using a small window.
347 (defvar isearch-small-window nil)
348 (defvar isearch-opoint 0)
349 ;;; The window configuration active at the beginning of the search.
350 (defvar isearch-window-configuration nil)
351 (defvar isearch-old-local-map nil)
353 ;; Flag to indicate a yank occurred, so don't move the cursor.
354 (defvar isearch-yank-flag nil)
356 ;;; A function to be called after each input character is processed.
357 ;;; (It is not called after characters that exit the search.)
358 ;;; It is only set from an optional argument to `isearch-mode'.
359 (defvar isearch-op-fun nil)
361 ;;; Is isearch-mode in a recursive edit for modal searching.
362 (defvar isearch-recursive-edit nil)
364 ;;; Should isearch be terminated after doing one search?
365 (defvar isearch-nonincremental nil)
367 ;; New value of isearch-forward after isearch-edit-string.
368 (defvar isearch-new-forward nil)
371 ;;;==============================================================
372 ;; Minor-mode-alist changes - kind of redundant with the
373 ;; echo area, but if isearching in multiple windows, it can be useful.
375 (or (assq 'isearch-mode minor-mode-alist)
376 (nconc minor-mode-alist
377 (list '(isearch-mode isearch-mode))))
379 (defvar isearch-mode nil) ;; Name of the minor mode, if non-nil.
380 (make-variable-buffer-local 'isearch-mode)
382 (define-key global-map "\C-s" 'isearch-forward)
383 (define-key esc-map "\C-s" 'isearch-forward-regexp)
384 (define-key global-map "\C-r" 'isearch-backward)
385 (define-key esc-map "\C-r" 'isearch-backward-regexp)
387 ;;;===============================================================
388 ;;; Entry points to isearch-mode.
389 ;;; These four functions should replace those in loaddefs.el
390 ;;; An alternative is to defalias isearch-forward etc to isearch-mode,
391 ;;; and look at this-command to set the options accordingly.
393 (defun isearch-forward (&optional regexp-p no-recursive-edit)
395 Do incremental search forward.
396 With a prefix argument, do an incremental regular expression search instead.
398 As you type characters, they add to the search string and are found.
399 The following non-printing keys are bound in `isearch-mode-map'.
401 Type \\[isearch-delete-char] to cancel characters from end of search string.
402 Type \\[isearch-exit] to exit, leaving point at location found.
403 Type LFD (C-j) to match end of line.
404 Type \\[isearch-repeat-forward] to search again forward,\
405 \\[isearch-repeat-backward] to search again backward.
406 Type \\[isearch-yank-word] to yank word from buffer onto end of search\
407 string and search for it.
408 Type \\[isearch-yank-line] to yank rest of line onto end of search string\
410 Type \\[isearch-quote-char] to quote control character to search for it.
411 \\[isearch-abort] while searching or when search has failed cancels input\
413 been found successfully.
414 \\[isearch-abort] when search is successful aborts and moves point to\
417 Also supported is a search ring of the previous 16 search strings.
418 Type \\[isearch-ring-advance] to search for the next item in the search ring.
419 Type \\[isearch-ring-retreat] to search for the previous item in the search\
421 Type \\[isearch-complete] to complete the search string using the search ring.
423 The above keys, bound in `isearch-mode-map', are often controlled by
424 options; do M-x apropos on search-.* to find them.
425 Other control and meta characters terminate the search
426 and are then executed normally (depending on `search-exit-option').
428 If this function is called non-interactively, it does not return to
429 the calling function until the search is done."
432 (isearch-mode t (not (null regexp-p)) nil (not no-recursive-edit)))
434 (defun isearch-forward-regexp (&optional not-regexp no-recursive-edit)
436 Do incremental search forward for regular expression.
437 With a prefix argument, do a regular string search instead.
438 Like ordinary incremental search except that your input
439 is treated as a regexp. See \\[isearch-forward] for more info."
441 (isearch-mode t (null not-regexp) nil (not no-recursive-edit)))
443 (defun isearch-backward (&optional regexp-p no-recursive-edit)
445 Do incremental search backward.
446 With a prefix argument, do a regular expression search instead.
447 See \\[isearch-forward] for more information."
449 (isearch-mode nil (not (null regexp-p)) nil (not no-recursive-edit)))
451 (defun isearch-backward-regexp (&optional not-regexp no-recursive-edit)
453 Do incremental search backward for regular expression.
454 With a prefix argument, do a regular string search instead.
455 Like ordinary incremental search except that your input
456 is treated as a regexp. See \\[isearch-forward] for more info."
458 (isearch-mode nil (null not-regexp) nil (not no-recursive-edit)))
461 (defun isearch-mode-help ()
463 (describe-function 'isearch-forward)
467 ;;;==================================================================
468 ;; isearch-mode only sets up incremental search for the minor mode.
469 ;; All the work is done by the isearch-mode commands.
472 ;;(defconst isearch-commands '(isearch-forward isearch-backward
473 ;; isearch-forward-regexp isearch-backward-regexp)
474 ;; "List of commands for which isearch-mode does not recursive-edit.")
477 (defun isearch-mode (forward &optional regexp op-fun recursive-edit word-p)
478 "Start isearch minor mode. Called by isearch-forward, etc."
480 ;; Initialize global vars.
481 (setq isearch-forward forward
482 isearch-regexp regexp
484 isearch-op-fun op-fun
485 isearch-case-fold-search case-fold-search
491 isearch-barrier (point)
493 isearch-yank-flag nil
494 isearch-invalid-regexp nil
495 ;; Use (baud-rate) for now, for sake of other versions.
496 isearch-slow-terminal-mode (and (<= (baud-rate) search-slow-speed)
498 (* 4 search-slow-window-lines)))
499 isearch-other-end nil
500 isearch-small-window nil
502 isearch-opoint (point)
503 isearch-old-local-map (current-local-map)
504 search-ring-yank-pointer nil
505 regexp-search-ring-yank-pointer nil)
506 (if isearch-slow-terminal-mode
507 (setq isearch-window-configuration (current-window-configuration)))
509 ;; This was for Lucid Emacs. But now that we have pre-command-hook,
510 ;; it causes trouble.
511 ;; (if isearch-pre-command-hook-exists
512 ;; (add-hook 'pre-command-hook 'isearch-pre-command-hook))
513 (setq isearch-mode " Isearch") ;; forward? regexp?
514 (set-buffer-modified-p (buffer-modified-p)) ; update modeline
516 ;; It is ugly to show region highlighting while the search
517 ;; is going on. And we don't want the mark active at the end either.
518 (setq deactivate-mark t)
522 (use-local-map isearch-mode-map)
524 (run-hooks 'isearch-mode-hook)
526 ;; isearch-mode can be made modal (in the sense of not returning to
527 ;; the calling function until searching is completed) by entering
528 ;; a recursive-edit and exiting it when done isearching.
530 (let ((isearch-recursive-edit t))
535 ;;;====================================================
536 ;; Some high level utilities. Others below.
538 (defun isearch-update ()
539 ;; Called after each command to update the display.
540 (if (if isearch-event-data-type
541 (null unread-command-event)
542 (if isearch-gnu-emacs-events
543 (null unread-command-events)
544 (< unread-command-char 0)))
546 (if (not (input-pending-p))
548 (if (and isearch-slow-terminal-mode
549 (not (or isearch-small-window
550 (pos-visible-in-window-p))))
551 (let ((found-point (point)))
552 (setq isearch-small-window t)
553 (move-to-window-line 0)
554 (let ((window-min-height 1))
555 (split-window nil (if (< search-slow-window-lines 0)
556 (1+ (- search-slow-window-lines))
558 (1+ search-slow-window-lines)))))
559 (if (< search-slow-window-lines 0)
560 (progn (vertical-motion (- 1 search-slow-window-lines))
561 (set-window-start (next-window) (point))
562 (set-window-hscroll (next-window)
564 (set-window-hscroll (selected-window) 0))
566 (goto-char found-point)))
567 (if isearch-other-end
568 (if (< isearch-other-end (point)) ; isearch-forward?
569 (isearch-highlight isearch-other-end (point))
570 (isearch-highlight (point) isearch-other-end))
571 (isearch-dehighlight nil))
573 (setq ;; quit-flag nil not for isearch-mode
575 isearch-yank-flag nil)
579 (defun isearch-done (&optional nopush)
580 ;; Called by all commands that terminate isearch-mode.
581 ;; If NOPUSH is non-nil, we don't push the string on the search ring.
582 (use-local-map isearch-old-local-map)
583 ;; (setq pre-command-hook isearch-old-pre-command-hook) ; for lemacs
584 (isearch-dehighlight t)
585 (let ((found-start (window-start (selected-window)))
586 (found-point (point)))
587 (if isearch-window-configuration
588 (set-window-configuration isearch-window-configuration))
590 (if isearch-small-window
591 (goto-char found-point)
592 ;; Exiting the save-window-excursion clobbers window-start; restore it.
593 (set-window-start (selected-window) found-start t)))
595 ;; If there was movement, mark the starting position.
596 ;; Maybe should test difference between and set mark iff > threshold.
597 (if (/= (point) isearch-opoint)
599 (push-mark isearch-opoint t)
601 (or executing-macro (> (minibuffer-depth) 0)
602 (message "Mark saved where search started")))
603 ;; (message "") why is this needed?
606 (setq isearch-mode nil)
607 (set-buffer-modified-p (buffer-modified-p)) ;; update modeline
609 (if (and (> (length isearch-string) 0) (not nopush))
610 ;; Update the ring data.
612 (if (or (null regexp-search-ring)
613 (not (string= isearch-string (car regexp-search-ring))))
615 (setq regexp-search-ring
616 (cons isearch-string regexp-search-ring))
617 (if (> (length regexp-search-ring) regexp-search-ring-max)
618 (setcdr (nthcdr (1- search-ring-max) regexp-search-ring)
620 (if (or (null search-ring)
621 (not (string= isearch-string (car search-ring))))
623 (setq search-ring (cons isearch-string search-ring))
624 (if (> (length search-ring) search-ring-max)
625 (setcdr (nthcdr (1- search-ring-max) search-ring) nil))))))
627 (run-hooks 'isearch-mode-end-hook)
628 (if isearch-recursive-edit (exit-recursive-edit)))
630 ;;;=======================================================
631 ;;; Switching buffers should first terminate isearch-mode.
632 ;;; This is done quite differently for each variant of emacs.
633 ;;; For lemacs, see Exiting in lemacs below
635 ;; For Emacs 19, the frame switch event is handled.
636 (defun isearch-switch-frame-handler ()
637 (interactive) ;; Is this necessary?
638 ;; First terminate isearch-mode.
640 (handle-switch-frame (car (cdr (isearch-last-command-char)))))
642 ;;;========================================================
645 ;;;====================================================
646 ;; Commands active while inside of the isearch minor mode.
648 (defun isearch-exit ()
649 "Exit search normally.
650 However, if this is the first command after starting incremental
651 search and `search-nonincremental-instead' is non-nil, do a
652 nonincremental search instead via `isearch-edit-string'."
654 (if (and search-nonincremental-instead
655 (= 0 (length isearch-string)))
656 (let ((isearch-nonincremental t))
657 (isearch-edit-string)))
661 (defun isearch-edit-string ()
662 "Edit the search string in the minibuffer.
663 The following additional command keys are active while editing.
664 \\<minibuffer-local-isearch-map>
665 \\[exit-minibuffer] to resume incremental searching with the edited string.
666 \\[isearch-nonincremental-exit-minibuffer] to do one nonincremental search.
667 \\[isearch-forward-exit-minibuffer] to resume isearching forward.
668 \\[isearch-backward-exit-minibuffer] to resume isearching backward.
669 \\[isearch-ring-advance-edit] to replace the search string with the next item in the search ring.
670 \\[isearch-ring-retreat-edit] to replace the search string with the previous item in the search ring.
671 \\[isearch-complete-edit] to complete the search string using the search ring.
673 If first char entered is \\[isearch-yank-word], then do word search instead."
675 ;; This code is very hairy for several reasons, explained in the code.
676 ;; Mainly, isearch-mode must be terminated while editing and then restarted.
677 ;; If there were a way to catch any change of buffer from the minibuffer,
678 ;; this could be simplified greatly.
679 ;; Editing doesn't back up the search point. Should it?
682 (let ((isearch-nonincremental isearch-nonincremental)
684 ;; Locally bind all isearch global variables to protect them
685 ;; from recursive isearching.
686 ;; isearch-string -message and -forward are not bound
687 ;; so they may be changed. Instead, save the values.
688 (isearch-new-string isearch-string)
689 (isearch-new-message isearch-message)
690 (isearch-new-forward isearch-forward)
691 (isearch-new-word isearch-word)
693 (isearch-regexp isearch-regexp)
694 (isearch-op-fun isearch-op-fun)
695 (isearch-cmds isearch-cmds)
696 (isearch-success isearch-success)
697 (isearch-wrapped isearch-wrapped)
698 (isearch-barrier isearch-barrier)
699 (isearch-adjusted isearch-adjusted)
700 (isearch-yank-flag isearch-yank-flag)
701 (isearch-invalid-regexp isearch-invalid-regexp)
702 (isearch-other-end isearch-other-end)
703 (isearch-opoint isearch-opoint)
704 (isearch-slow-terminal-mode isearch-slow-terminal-mode)
705 (isearch-small-window isearch-small-window)
706 (isearch-recursive-edit isearch-recursive-edit)
707 ;; Save current configuration so we can restore it here.
708 (isearch-window-configuration (current-window-configuration))
711 ;; Actually terminate isearching until editing is done.
712 ;; This is so that the user can do anything without failure,
713 ;; like switch buffers and start another isearch, and return.
716 (exit nil)) ; was recursive editing
718 (isearch-message) ;; for read-char
720 (let* (;; Why does following read-char echo?
721 ;;(echo-keystrokes 0) ;; not needed with above message
722 (e (let ((cursor-in-echo-area t))
724 ;; Binding minibuffer-history-symbol to nil is a work-around
725 ;; for some incompatibility with gmhist.
726 (minibuffer-history-symbol))
727 ;; If the first character the user types when we prompt them
728 ;; for a string is the yank-word character, then go into
729 ;; word-search mode. Otherwise unread that character and
730 ;; read a key the normal way.
731 ;; Word search does not apply (yet) to regexp searches,
732 ;; no check is made here.
733 (message (isearch-message-prefix nil nil t))
734 (if (eq 'isearch-yank-word
735 (lookup-key isearch-mode-map (vector e)))
736 (setq isearch-word t ;; so message-prefix is right
739 (setq cursor-in-echo-area nil)
740 (setq isearch-new-string
742 (read-from-minibuffer (isearch-message-prefix)
744 minibuffer-local-isearch-map nil
746 isearch-new-message (mapconcat 'text-char-description
747 isearch-new-string "")))
748 ;; Always resume isearching by restarting it.
749 (isearch-mode isearch-forward
752 isearch-recursive-edit
755 ;; Copy new local values to isearch globals
756 (setq isearch-string isearch-new-string
757 isearch-message isearch-new-message
758 isearch-forward isearch-new-forward
759 isearch-word isearch-new-word))
761 ;; Empty isearch-string means use default.
762 (if (= 0 (length isearch-string))
763 (setq isearch-string (car (if isearch-regexp regexp-search-ring
765 ;; This used to set the last search string,
766 ;; but I think it is not right to do that here.
767 ;; Only the string actually used should be saved.
770 ;; Reinvoke the pending search.
774 (if isearch-nonincremental
776 ;; (sit-for 1) ;; needed if isearch-done does: (message "")
779 (quit ; handle abort-recursive-edit
780 (isearch-abort) ;; outside of let to restore outside global values
783 (defun isearch-nonincremental-exit-minibuffer ()
785 (setq isearch-nonincremental t)
788 (defun isearch-forward-exit-minibuffer ()
790 (setq isearch-new-forward t)
793 (defun isearch-reverse-exit-minibuffer ()
795 (setq isearch-new-forward nil)
799 (defun isearch-abort ()
800 "Abort incremental search mode if searching is successful, signalling quit.
801 Otherwise, revert to previous successful search and continue searching.
802 Use `isearch-exit' to quit without signalling."
804 ;; (ding) signal instead below, if quitting
807 ;; If search is successful, move back to starting point
808 ;; and really do quit.
809 (progn (goto-char isearch-opoint)
810 (isearch-done t) ; exit isearch
811 (signal 'quit nil)) ; and pass on quit signal
812 ;; If search is failing, rub out until it is once more successful.
813 (while (not isearch-success) (isearch-pop-state))
817 (defun isearch-repeat (direction)
818 ;; Utility for isearch-repeat-forward and -backward.
819 (if (eq isearch-forward (eq direction 'forward))
820 ;; C-s in forward or C-r in reverse.
821 (if (equal isearch-string "")
822 ;; If search string is empty, use last one.
824 (or (if isearch-regexp
825 (car regexp-search-ring)
829 (mapconcat 'isearch-text-char-description
831 ;; If already have what to search for, repeat it.
835 (goto-char (if isearch-forward (point-min) (point-max)))
836 (setq isearch-wrapped t))))
837 ;; C-s in reverse or C-r in forward, change direction.
838 (setq isearch-forward (not isearch-forward)))
840 (setq isearch-barrier (point)) ; For subsequent \| if regexp.
842 (if (equal isearch-string "")
843 (setq isearch-success t)
844 (if (and isearch-success (equal (match-end 0) (match-beginning 0)))
845 ;; If repeating a search that found
846 ;; an empty string, ensure we advance.
847 (if (if isearch-forward (eobp) (bobp))
848 ;; If there's nowhere to advance to, fail (and wrap next time).
850 (setq isearch-success nil)
852 (forward-char (if isearch-forward 1 -1))
859 (defun isearch-repeat-forward ()
860 "Repeat incremental search forwards."
862 (isearch-repeat 'forward))
864 (defun isearch-repeat-backward ()
865 "Repeat incremental search backwards."
867 (isearch-repeat 'backward))
869 (defun isearch-toggle-regexp ()
870 "Toggle regexp searching on or off."
871 ;; The status stack is left unchanged.
873 (setq isearch-regexp (not isearch-regexp))
874 (if isearch-regexp (setq isearch-word nil))
877 (defun isearch-delete-char ()
878 "Discard last input item and move point back.
879 If no previous match was done, just beep."
881 (if (null (cdr isearch-cmds))
887 (defun isearch-yank (chunk)
888 ;; Helper for isearch-yank-word and isearch-yank-line
889 ;; CHUNK should be word, line or kill.
895 (and (not isearch-forward) isearch-other-end
896 (goto-char isearch-other-end))
906 ;; Downcase the string if not supposed to case-fold yanked strings.
907 (if (and isearch-case-fold-search
908 (eq 'not-yanks search-upper-case))
909 (setq string (downcase string)))
910 (if isearch-regexp (setq string (regexp-quote string)))
911 (setq isearch-string (concat isearch-string string)
913 (concat isearch-message
914 (mapconcat 'isearch-text-char-description
916 ;; Don't move cursor in reverse search.
917 isearch-yank-flag t))
918 (isearch-search-and-update))
920 (defun isearch-yank-kill ()
921 "Pull string from kill ring into search string."
923 (isearch-yank 'kill))
925 (defun isearch-yank-word ()
926 "Pull next word from buffer into search string."
928 (isearch-yank 'word))
930 (defun isearch-yank-line ()
931 "Pull rest of line from buffer into search string."
933 (isearch-yank 'line))
936 (defun isearch-search-and-update ()
937 ;; Do the search and update the display.
938 (if (and (not isearch-success)
939 ;; unsuccessful regexp search may become
940 ;; successful by addition of characters which
941 ;; make isearch-string valid
942 (not isearch-regexp))
944 ;; In reverse search, adding stuff at
945 ;; the end may cause zero or many more chars to be
946 ;; matched, in the string following point.
947 ;; Allow all those possibilities without moving point as
948 ;; long as the match does not extend past search origin.
949 (if (and (not isearch-forward) (not isearch-adjusted)
951 (looking-at (if isearch-regexp isearch-string
952 (regexp-quote isearch-string)))
954 (or isearch-yank-flag
956 (min isearch-opoint isearch-barrier))))
957 (setq isearch-success t
958 isearch-invalid-regexp nil
959 isearch-other-end (match-end 0))
960 ;; Not regexp, not reverse, or no match at point.
961 (if (and isearch-other-end (not isearch-adjusted))
962 (goto-char (if isearch-forward isearch-other-end
965 (1+ isearch-other-end)))))
969 (if isearch-op-fun (funcall isearch-op-fun))
973 ;; *, ?, and | chars can make a regexp more liberal.
974 ;; They can make a regexp match sooner or make it succeed instead of failing.
975 ;; So go back to place last successful search started
976 ;; or to the last ^S/^R (barrier), whichever is nearer.
977 ;; + needs no special handling because the string must match at least once.
979 (defun isearch-*-char ()
980 "Handle * and ? specially in regexps."
985 (setq isearch-adjusted t)
986 (let ((cs (nth (if isearch-forward
987 5 ; isearch-other-end
989 (car (cdr isearch-cmds)))))
990 ;; (car isearch-cmds) is after last search;
991 ;; (car (cdr isearch-cmds)) is from before it.
992 (setq cs (or cs isearch-barrier))
995 (max cs isearch-barrier)
996 (min cs isearch-barrier))))))
997 (isearch-process-search-char (isearch-last-command-char)))
1000 (defun isearch-|-char ()
1001 "If in regexp search, jump to the barrier."
1005 (setq isearch-adjusted t)
1006 (goto-char isearch-barrier)))
1007 (isearch-process-search-char (isearch-last-command-char)))
1010 (defalias 'isearch-other-control-char 'isearch-other-meta-char)
1012 (defun isearch-other-meta-char ()
1013 "Exit the search normally and reread this key sequence.
1014 But only if `search-exit-option' is non-nil, the default.
1015 If it is the symbol `edit', the search string is edited in the minibuffer
1016 and the meta character is unread so that it applies to editing the string."
1018 (cond ((eq search-exit-option 'edit)
1019 (let ((key (this-command-keys)))
1020 (apply 'isearch-unread (listify-key-sequence key)))
1021 (isearch-edit-string))
1023 (let ((key (this-command-keys))
1026 (apply 'isearch-unread (listify-key-sequence key))
1027 ;; Properly handle scroll-bar and mode-line clicks
1028 ;; for which a dummy prefix event was generated as (aref key 0).
1029 (and (> (length key) 1)
1030 (symbolp (aref key 0))
1031 (listp (aref key 1))
1032 ;; These events now have a symbol; they used to have a list.
1033 ;; Accept either one. Other events have a number here.
1034 (not (numberp (posn-point (event-start (aref key 1)))))
1036 ;; If we got a mouse click, maybe it was read with the buffer
1037 ;; it was clicked on. If so, that buffer, not the current one,
1038 ;; is in isearch mode. So end the search in that buffer.
1039 (if (and (listp (aref key index))
1040 (setq window (posn-window (event-start (aref key index))))
1043 (set-buffer (window-buffer window))
1047 (isearch-process-search-string (this-command-keys)
1048 (this-command-keys)))))
1050 (defun isearch-quote-char ()
1051 "Quote special characters for incremental search."
1053 (isearch-process-search-char (read-quoted-char (isearch-message t))))
1055 (defun isearch-return-char ()
1056 "Convert return into newline for incremental search.
1059 (isearch-process-search-char ?\n))
1061 (defun isearch-printing-char ()
1062 "Add this ordinary printing character to the search string and search."
1064 (isearch-process-search-char (isearch-last-command-char)))
1066 (defun isearch-whitespace-chars ()
1067 "Match all whitespace chars, if in regexp mode.
1068 If you want to search for just a space, type C-q SPC."
1071 (if search-whitespace-regexp
1072 (isearch-process-search-string search-whitespace-regexp " ")
1073 (isearch-printing-char))
1075 ;; This way of doing word search doesn't correctly extend current search.
1076 ;; (setq isearch-word t)
1077 ;; (setq isearch-adjusted t)
1078 ;; (goto-char isearch-barrier)
1079 (isearch-printing-char))))
1081 (defun isearch-process-search-char (char)
1082 ;; Append the char to the search string, update the message and re-search.
1083 (isearch-process-search-string
1084 (isearch-char-to-string char)
1085 (isearch-text-char-description char)))
1087 (defun isearch-process-search-string (string message)
1088 (setq isearch-string (concat isearch-string string)
1089 isearch-message (concat isearch-message message))
1090 (isearch-search-and-update))
1093 ;;===========================================================
1096 (defun isearch-ring-adjust1 (advance)
1097 ;; Helper for isearch-ring-adjust
1098 (let* ((ring (if isearch-regexp regexp-search-ring search-ring))
1099 (length (length ring))
1100 (yank-pointer-name (if isearch-regexp
1101 'regexp-search-ring-yank-pointer
1102 'search-ring-yank-pointer))
1103 (yank-pointer (eval yank-pointer-name)))
1106 (set yank-pointer-name
1108 (mod (+ (or yank-pointer 0)
1111 (setq isearch-string (nth yank-pointer ring)
1112 isearch-message (mapconcat 'isearch-text-char-description
1113 isearch-string "")))))
1115 (defun isearch-ring-adjust (advance)
1116 ;; Helper for isearch-ring-advance and isearch-ring-retreat
1117 (if (cdr isearch-cmds) ;; is there more than one thing on stack?
1118 (isearch-pop-state))
1119 (isearch-ring-adjust1 advance)
1120 (isearch-push-state)
1121 (if search-ring-update
1125 (isearch-edit-string)
1128 (defun isearch-ring-advance ()
1129 "Advance to the next search string in the ring."
1130 ;; This could be more general to handle a prefix arg, but who would use it.
1132 (isearch-ring-adjust 'advance))
1134 (defun isearch-ring-retreat ()
1135 "Retreat to the previous search string in the ring."
1137 (isearch-ring-adjust nil))
1139 (defun isearch-ring-advance-edit (n)
1140 "Insert the next element of the search history into the minibuffer."
1142 (let* ((yank-pointer-name (if isearch-regexp
1143 'regexp-search-ring-yank-pointer
1144 'search-ring-yank-pointer))
1145 (yank-pointer (eval yank-pointer-name))
1146 (ring (if isearch-regexp regexp-search-ring search-ring))
1147 (length (length ring)))
1150 (set yank-pointer-name
1152 (mod (- (or yank-pointer 0) n)
1156 (insert (nth yank-pointer ring))
1157 (goto-char (point-max)))))
1159 (defun isearch-ring-retreat-edit (n)
1160 "Inserts the previous element of the search history into the minibuffer."
1162 (isearch-ring-advance-edit (- n)))
1164 ;;(defun isearch-ring-adjust-edit (advance)
1165 ;; "Use the next or previous search string in the ring while in minibuffer."
1166 ;; (isearch-ring-adjust1 advance)
1168 ;; (insert isearch-string))
1170 ;;(defun isearch-ring-advance-edit ()
1172 ;; (isearch-ring-adjust-edit 'advance))
1174 ;;(defun isearch-ring-retreat-edit ()
1175 ;; "Retreat to the previous search string in the ring while in the minibuffer."
1177 ;; (isearch-ring-adjust-edit nil))
1180 (defun isearch-complete1 ()
1181 ;; Helper for isearch-complete and isearch-complete-edit
1182 ;; Return t if completion OK, nil if no completion exists.
1183 (let* ((ring (if isearch-regexp regexp-search-ring search-ring))
1184 (alist (mapcar (function (lambda (string) (list string))) ring))
1185 (completion-ignore-case case-fold-search)
1186 (completion (try-completion isearch-string alist)))
1189 ;; isearch-string stays the same
1191 ((or completion ; not nil, must be a string
1192 (= 0 (length isearch-string))) ; shouldnt have to say this
1193 (if (equal completion isearch-string) ;; no extension?
1194 (if completion-auto-help
1195 (with-output-to-temp-buffer "*Isearch completions*"
1196 (display-completion-list
1197 (all-completions isearch-string alist))))
1198 (setq isearch-string completion))
1201 (message "No completion") ; waits a second if in minibuffer
1204 (defun isearch-complete ()
1205 "Complete the search string from the strings on the search ring.
1206 The completed string is then editable in the minibuffer.
1207 If there is no completion possible, say so and continue searching."
1209 (if (isearch-complete1)
1210 (isearch-edit-string)
1215 (defun isearch-complete-edit ()
1216 "Same as `isearch-complete' except in the minibuffer."
1218 (setq isearch-string (buffer-string))
1219 (if (isearch-complete1)
1222 (insert isearch-string))))
1225 ;;;==============================================================
1226 ;; The search status stack (and isearch window-local variables, not used).
1227 ;; Need a structure for this.
1229 (defun isearch-top-state ()
1230 (let ((cmd (car isearch-cmds)))
1231 (setq isearch-string (car cmd)
1232 isearch-message (car (cdr cmd))
1233 isearch-success (nth 3 cmd)
1234 isearch-forward (nth 4 cmd)
1235 isearch-other-end (nth 5 cmd)
1236 isearch-word (nth 6 cmd)
1237 isearch-invalid-regexp (nth 7 cmd)
1238 isearch-wrapped (nth 8 cmd)
1239 isearch-barrier (nth 9 cmd))
1240 (goto-char (car (cdr (cdr cmd))))))
1242 (defun isearch-pop-state ()
1243 (setq isearch-cmds (cdr isearch-cmds))
1247 (defun isearch-push-state ()
1249 (cons (list isearch-string isearch-message (point)
1250 isearch-success isearch-forward isearch-other-end
1252 isearch-invalid-regexp isearch-wrapped isearch-barrier)
1256 ;;;==================================================================
1259 (defun isearch-message (&optional c-q-hack ellipsis)
1260 ;; Generate and print the message string.
1261 (let ((cursor-in-echo-area ellipsis)
1263 (isearch-message-prefix c-q-hack ellipsis isearch-nonincremental)
1265 (isearch-message-suffix c-q-hack ellipsis)
1267 (if c-q-hack m (message "%s" m))))
1269 (defun isearch-message-prefix (&optional c-q-hack ellipsis nonincremental)
1270 ;; If about to search, and previous search regexp was invalid,
1271 ;; check that it still is. If it is valid now,
1272 ;; let the message we display while searching say that it is valid.
1273 (and isearch-invalid-regexp ellipsis
1275 (progn (re-search-forward isearch-string (point) t)
1276 (setq isearch-invalid-regexp nil))
1278 ;; If currently failing, display no ellipsis.
1279 (or isearch-success (setq ellipsis nil))
1280 (let ((m (concat (if isearch-success "" "failing ")
1281 (if isearch-wrapped "wrapped ")
1282 (if isearch-word "word " "")
1283 (if isearch-regexp "regexp " "")
1284 (if nonincremental "search" "I-search")
1285 (if isearch-forward ": " " backward: ")
1287 (aset m 0 (upcase (aref m 0)))
1291 (defun isearch-message-suffix (&optional c-q-hack ellipsis)
1292 (concat (if c-q-hack "^Q" "")
1293 (if isearch-invalid-regexp
1294 (concat " [" isearch-invalid-regexp "]")
1298 ;;;========================================================
1301 (defun isearch-search ()
1302 ;; Do the search with the current search string.
1303 (isearch-message nil t)
1304 (if (and isearch-case-fold-search search-upper-case)
1305 (setq isearch-case-fold-search
1306 (isearch-no-upper-case-p isearch-string isearch-regexp)))
1307 (condition-case lossage
1308 (let ((inhibit-quit nil)
1309 (case-fold-search isearch-case-fold-search))
1310 (if isearch-regexp (setq isearch-invalid-regexp nil))
1311 (setq isearch-success
1315 'word-search-forward 'word-search-backward))
1318 're-search-forward 're-search-backward))
1320 (if isearch-forward 'search-forward 'search-backward)))
1321 isearch-string nil t))
1323 (setq isearch-other-end
1324 (if isearch-forward (match-beginning 0) (match-end 0)))))
1326 (quit (isearch-unread ?\C-g)
1327 (setq isearch-success nil))
1330 (setq isearch-invalid-regexp (car (cdr lossage)))
1332 "\\`Premature \\|\\`Unmatched \\|\\`Invalid "
1333 isearch-invalid-regexp)
1334 (setq isearch-invalid-regexp "incomplete input")))
1336 ;; stack overflow in regexp search.
1337 (setq isearch-invalid-regexp (car (cdr lossage)))))
1341 ;; Ding if failed this time after succeeding last time.
1342 (and (nth 3 (car isearch-cmds))
1344 (goto-char (nth 2 (car isearch-cmds)))))
1348 ;;;========================================================
1351 (defvar isearch-overlay nil)
1353 (defun isearch-highlight (beg end)
1354 (if (null search-highlight)
1356 (or isearch-overlay (setq isearch-overlay (make-overlay beg end)))
1357 (move-overlay isearch-overlay beg end (current-buffer))
1358 (overlay-put isearch-overlay 'face
1359 (if (internal-find-face 'isearch nil)
1360 'isearch 'region))))
1362 (defun isearch-dehighlight (totally)
1364 (delete-overlay isearch-overlay)))
1366 ;;;===========================================================
1367 ;;; General utilities
1370 (defun isearch-no-upper-case-p (string regexp-flag)
1371 "Return t if there are no upper case chars in STRING.
1372 If REGEXP-FLAG is non-nil, disregard letters preceeded by `\\' (but not `\\\\')
1373 since they have special meaning in a regexp."
1374 (let ((case-fold-search nil))
1375 (not (string-match (if regexp-flag "\\(^\\|\\\\\\\\\\|[^\\]\\)[A-Z]"
1380 ;;;=================================================
1381 ;; Portability functions to support various Emacs versions.
1383 ;; To quiet the byte-compiler.
1384 (defvar unread-command-event)
1385 (defvar unread-command-events)
1386 (defvar last-command-event)
1388 (defun isearch-char-to-string (c)
1391 (if (and (symbolp c) (get c 'ascii-character))
1392 (make-string 1 (get c 'ascii-character))
1393 (make-string 1 (event-to-character c)))))
1395 (defun isearch-text-char-description (c)
1396 (if (and (integerp c) (or (< c ?\ ) (= c ?\^?)))
1397 (text-char-description c)
1398 (isearch-char-to-string c)))
1400 (defun isearch-unread (&rest char-or-events)
1401 ;; General function to unread characters or events.
1402 (if isearch-gnu-emacs-events
1403 (setq unread-command-events
1404 (append char-or-events unread-command-events))
1405 (let ((char (if (cdr char-or-events)
1407 (while (cdr char-or-events)
1408 (setq char-or-events (cdr char-or-events)))
1409 (+ 128 (car char-or-events)))
1410 (car char-or-events))))
1411 (if isearch-event-data-type
1412 (setq unread-command-event char)
1413 (setq unread-command-char char)))))
1415 (defun isearch-last-command-char ()
1416 ;; General function to return the last command character.
1417 (if isearch-event-data-type
1421 ;;; isearch.el ends here