comparison lisp/isearch.el @ 2572:8784bb8514b0

Replaced all fsets with defaliases.
author Eric S. Raymond <esr@snark.thyrsus.com>
date Fri, 23 Apr 1993 07:31:14 +0000
parents 2e1c2b44df3a
children 30919bba8508
comparison
equal deleted inserted replaced
2571:b65cf676a09b 2572:8784bb8514b0
2 2
3 ;; Copyright (C) 1992 Free Software Foundation, Inc. 3 ;; Copyright (C) 1992 Free Software Foundation, Inc.
4 4
5 ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu> 5 ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
6 6
7 ;; |$Date: 1993/03/30 19:42:10 $|$Revision: 1.29 $ 7 ;; |$Date: 1993/04/14 19:40:53 $|$Revision: 1.30 $
8 8
9 ;; This file is not yet part of GNU Emacs, but it is based almost 9 ;; This file is not yet part of GNU Emacs, but it is based almost
10 ;; entirely on isearch.el which is part of GNU Emacs. 10 ;; entirely on isearch.el which is part of GNU Emacs.
11 11
12 ;; GNU Emacs is distributed in the hope that it will be useful, 12 ;; GNU Emacs is distributed in the hope that it will be useful,
36 ;; To use isearch-mode instead of the standard isearch.el, add the 36 ;; To use isearch-mode instead of the standard isearch.el, add the
37 ;; following to your .emacs file. The standard key bindings to 37 ;; following to your .emacs file. The standard key bindings to
38 ;; isearch-forward, etc, will then use isearch-mode instead of 38 ;; isearch-forward, etc, will then use isearch-mode instead of
39 ;; isearch. 39 ;; isearch.
40 40
41 ;; (fset 'isearch 'isearch-mode) 41 ;; (defalias 'isearch 'isearch-mode)
42 ;; (autoload 'isearch-mode "isearch-mode") 42 ;; (autoload 'isearch-mode "isearch-mode")
43 43
44 ;; For programmed use of isearch-mode, e.g. calling (isearch-forward), 44 ;; For programmed use of isearch-mode, e.g. calling (isearch-forward),
45 ;; isearch-mode behaves modally and does not return until the search 45 ;; isearch-mode behaves modally and does not return until the search
46 ;; is completed. It uses a recursive-edit to behave this way. Note: 46 ;; is completed. It uses a recursive-edit to behave this way. Note:
49 ;; If any package you use invokes isearching non-interactively to get 49 ;; If any package you use invokes isearching non-interactively to get
50 ;; the modal behavior described above, you must use the redefinitions 50 ;; the modal behavior described above, you must use the redefinitions
51 ;; of isearch-forward, etc. found in this file instead of those in 51 ;; of isearch-forward, etc. found in this file instead of those in
52 ;; loaddefs.el. The simplest way to ensure this is to just load 52 ;; loaddefs.el. The simplest way to ensure this is to just load
53 ;; isearch-mode explicitly in your .emacs instead of using the above 53 ;; isearch-mode explicitly in your .emacs instead of using the above
54 ;; fset and autoload. 54 ;; defalias and autoload.
55 55
56 ;; (load "isearch-mode") 56 ;; (load "isearch-mode")
57 57
58 ;; The key bindings active within isearch-mode are defined below in 58 ;; The key bindings active within isearch-mode are defined below in
59 ;; `isearch-mode-map' which is given bindings close to the default 59 ;; `isearch-mode-map' which is given bindings close to the default
90 ;;; Change Log: 90 ;;; Change Log:
91 91
92 ;;;==================================================================== 92 ;;;====================================================================
93 ;;; Change History 93 ;;; Change History
94 94
95 ;;; $Header: /gd/gnu/emacs/19.0/lisp/RCS/isearch.el,v 1.29 1993/03/30 19:42:10 rms Exp rms $ 95 ;;; $Header: /gd/gnu/emacs/19.0/lisp/RCS/isearch.el,v 1.30 1993/04/14 19:40:53 rms Exp eric $
96 ;;; $Log: isearch.el,v $ 96 ;;; $Log: isearch.el,v $
97 ; Revision 1.30 1993/04/14 19:40:53 rms
98 ; Doc fixes.
99 ;
97 ; Revision 1.29 1993/03/30 19:42:10 rms 100 ; Revision 1.29 1993/03/30 19:42:10 rms
98 ; (isearch-done): Customize the message about mark. 101 ; (isearch-done): Customize the message about mark.
99 ; 102 ;
100 ; Revision 1.28 1993/03/30 19:38:34 rms 103 ; Revision 1.28 1993/03/30 19:38:34 rms
101 ; (isearch-mode-map): Delete the binding for C-h. 104 ; (isearch-mode-map): Delete the binding for C-h.
470 (define-key esc-map "\C-r" 'isearch-backward-regexp) 473 (define-key esc-map "\C-r" 'isearch-backward-regexp)
471 474
472 ;;;=============================================================== 475 ;;;===============================================================
473 ;;; Entry points to isearch-mode. 476 ;;; Entry points to isearch-mode.
474 ;;; These four functions should replace those in loaddefs.el 477 ;;; These four functions should replace those in loaddefs.el
475 ;;; An alternative is to fset isearch-forward etc to isearch-mode, 478 ;;; An alternative is to defalias isearch-forward etc to isearch-mode,
476 ;;; and look at this-command to set the options accordingly. 479 ;;; and look at this-command to set the options accordingly.
477 480
478 (defun isearch-forward (&optional regexp-p no-recursive-edit) 481 (defun isearch-forward (&optional regexp-p no-recursive-edit)
479 "\ 482 "\
480 Do incremental search forward. 483 Do incremental search forward.
1069 (setq isearch-adjusted t) 1072 (setq isearch-adjusted t)
1070 (goto-char isearch-barrier))) 1073 (goto-char isearch-barrier)))
1071 (isearch-process-search-char (isearch-last-command-char))) 1074 (isearch-process-search-char (isearch-last-command-char)))
1072 1075
1073 1076
1074 (fset 'isearch-other-control-char 'isearch-other-meta-char) 1077 (defalias 'isearch-other-control-char 'isearch-other-meta-char)
1075 1078
1076 (defun isearch-other-meta-char () 1079 (defun isearch-other-meta-char ()
1077 "Exit the search normally and reread this key sequence. 1080 "Exit the search normally and reread this key sequence.
1078 But only if `search-exit-option' is non-nil, the default. 1081 But only if `search-exit-option' is non-nil, the default.
1079 If it is the symbol `edit', the search string is edited in the minibuffer 1082 If it is the symbol `edit', the search string is edited in the minibuffer
1431 (bufferp (extent-buffer isearch-extent)) 1434 (bufferp (extent-buffer isearch-extent))
1432 (buffer-name (extent-buffer isearch-extent))) 1435 (buffer-name (extent-buffer isearch-extent)))
1433 (set-extent-face isearch-extent 'default) 1436 (set-extent-face isearch-extent 'default)
1434 (isearch-dehighlight t))))) 1437 (isearch-dehighlight t)))))
1435 1438
1436 (fset 'isearch-highlight (symbol-function 'isearch-lemacs-highlight)) 1439 (defalias 'isearch-highlight (symbol-function 'isearch-lemacs-highlight))
1437 (fset 'isearch-dehighlight (symbol-function 'isearch-lemacs-dehighlight)) 1440 (defalias 'isearch-dehighlight (symbol-function 'isearch-lemacs-dehighlight))
1438 ) 1441 )
1439 1442
1440 ;;;=========================================================== 1443 ;;;===========================================================
1441 ;;; General utilities 1444 ;;; General utilities
1442 1445
1443 ;; (fset 'isearch-member-equal (symbol-function 'member)) ; for emacs 19 1446 ;; (defalias 'isearch-member-equal (symbol-function 'member)) ; for emacs 19
1444 1447
1445 (defun isearch-member-equal (item list) 1448 (defun isearch-member-equal (item list)
1446 "Return non-nil if ITEM is `equal' to some item in LIST. 1449 "Return non-nil if ITEM is `equal' to some item in LIST.
1447 Actually return the list whose car is that item." 1450 Actually return the list whose car is that item."
1448 (while (and list (not (equal item (car list)))) 1451 (while (and list (not (equal item (car list))))