Mercurial > emacs
comparison lisp/isearch.el @ 89969:3219f94257bc
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-34
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-514
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-522
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sat, 04 Sep 2004 09:14:28 +0000 |
parents | d8411455de48 661d52db56de |
children | cce1c0ee76ee |
comparison
equal
deleted
inserted
replaced
89968:1e9fa4848335 | 89969:3219f94257bc |
---|---|
54 ;; Exiting immediately from isearch uses isearch-edit-string instead | 54 ;; Exiting immediately from isearch uses isearch-edit-string instead |
55 ;; of nonincremental-search, if search-nonincremental-instead is non-nil. | 55 ;; of nonincremental-search, if search-nonincremental-instead is non-nil. |
56 ;; The name of this option should probably be changed if we decide to | 56 ;; The name of this option should probably be changed if we decide to |
57 ;; keep the behavior. No point in forcing nonincremental search until | 57 ;; keep the behavior. No point in forcing nonincremental search until |
58 ;; the last possible moment. | 58 ;; the last possible moment. |
59 | |
60 ;; TODO | |
61 ;; - Integrate the emacs 19 generalized command history. | |
62 ;; - Hooks and options for failed search. | |
63 | |
64 ;;; Change Log: | |
65 | |
66 ;; Changes before those recorded in ChangeLog: | |
67 | |
68 ;; Revision 1.4 92/09/14 16:26:02 liberte | |
69 ;; Added prefix args to isearch-forward, etc. to switch between | |
70 ;; string and regular expression searching. | |
71 ;; Added some support for lemacs. | |
72 ;; Added general isearch-highlight option - but only for lemacs so far. | |
73 ;; Added support for frame switching in emacs 19. | |
74 ;; Added word search option to isearch-edit-string. | |
75 ;; Renamed isearch-quit to isearch-abort. | |
76 ;; Numerous changes to comments and doc strings. | |
77 ;; | |
78 ;; Revision 1.3 92/06/29 13:10:08 liberte | |
79 ;; Moved modal isearch-mode handling into isearch-mode. | |
80 ;; Got rid of buffer-local isearch variables. | |
81 ;; isearch-edit-string used by ring adjustments, completion, and | |
82 ;; nonincremental searching. C-s and C-r are additional exit commands. | |
83 ;; Renamed all regex to regexp. | |
84 ;; Got rid of found-start and found-point globals. | |
85 ;; Generalized handling of upper-case chars. | |
86 | |
87 ;; Revision 1.2 92/05/27 11:33:57 liberte | |
88 ;; Emacs version 19 has a search ring, which is supported here. | |
89 ;; Other fixes found in the version 19 isearch are included here. | |
90 ;; | |
91 ;; Also see variables search-caps-disable-folding, | |
92 ;; search-nonincremental-instead, search-whitespace-regexp, and | |
93 ;; commands isearch-toggle-regexp, isearch-edit-string. | |
94 ;; | |
95 ;; semi-modal isearching is supported. | |
96 | |
97 ;; Changes for 1.1 | |
98 ;; 3/18/92 Fixed invalid-regexp. | |
99 ;; 3/18/92 Fixed yanking in regexps. | |
100 | 59 |
101 ;;; Code: | 60 ;;; Code: |
102 | 61 |
103 | 62 |
104 ;; Some additional options and constants. | 63 ;; Some additional options and constants. |
195 (defvar isearch-mode-hook nil | 154 (defvar isearch-mode-hook nil |
196 "Function(s) to call after starting up an incremental search.") | 155 "Function(s) to call after starting up an incremental search.") |
197 | 156 |
198 (defvar isearch-mode-end-hook nil | 157 (defvar isearch-mode-end-hook nil |
199 "Function(s) to call after terminating an incremental search.") | 158 "Function(s) to call after terminating an incremental search.") |
159 | |
160 (defvar isearch-wrap-function nil | |
161 "Function to call to wrap the search when search is failed. | |
162 If nil, move point to the beginning of the buffer for a forward search, | |
163 or to the end of the buffer for a backward search.") | |
164 | |
165 (defvar isearch-push-state-function nil | |
166 "Function to save a function restoring the mode-specific isearch state | |
167 to the search status stack.") | |
200 | 168 |
201 ;; Search ring. | 169 ;; Search ring. |
202 | 170 |
203 (defvar search-ring nil | 171 (defvar search-ring nil |
204 "List of search string sequences.") | 172 "List of search string sequences.") |
770 ;; (handle-switch-frame (car (cdr last-command-char)))) | 738 ;; (handle-switch-frame (car (cdr last-command-char)))) |
771 | 739 |
772 | 740 |
773 ;; The search status structure and stack. | 741 ;; The search status structure and stack. |
774 | 742 |
775 (defsubst isearch-string (frame) | 743 (defsubst isearch-string-state (frame) |
776 "Return the search string in FRAME." | 744 "Return the search string in FRAME." |
777 (aref frame 0)) | 745 (aref frame 0)) |
778 (defsubst isearch-message-string (frame) | 746 (defsubst isearch-message-state (frame) |
779 "Return the search string to display to the user in FRAME." | 747 "Return the search string to display to the user in FRAME." |
780 (aref frame 1)) | 748 (aref frame 1)) |
781 (defsubst isearch-point (frame) | 749 (defsubst isearch-point-state (frame) |
782 "Return the point in FRAME." | 750 "Return the point in FRAME." |
783 (aref frame 2)) | 751 (aref frame 2)) |
784 (defsubst isearch-success (frame) | 752 (defsubst isearch-success-state (frame) |
785 "Return the success flag in FRAME." | 753 "Return the success flag in FRAME." |
786 (aref frame 3)) | 754 (aref frame 3)) |
787 (defsubst isearch-forward-flag (frame) | 755 (defsubst isearch-forward-state (frame) |
788 "Return the searching-forward flag in FRAME." | 756 "Return the searching-forward flag in FRAME." |
789 (aref frame 4)) | 757 (aref frame 4)) |
790 (defsubst isearch-other-end (frame) | 758 (defsubst isearch-other-end-state (frame) |
791 "Return the other end of the match in FRAME." | 759 "Return the other end of the match in FRAME." |
792 (aref frame 5)) | 760 (aref frame 5)) |
793 (defsubst isearch-word (frame) | 761 (defsubst isearch-word-state (frame) |
794 "Return the search-by-word flag in FRAME." | 762 "Return the search-by-word flag in FRAME." |
795 (aref frame 6)) | 763 (aref frame 6)) |
796 (defsubst isearch-invalid-regexp (frame) | 764 (defsubst isearch-invalid-regexp-state (frame) |
797 "Return the regexp error message in FRAME, or nil if its regexp is valid." | 765 "Return the regexp error message in FRAME, or nil if its regexp is valid." |
798 (aref frame 7)) | 766 (aref frame 7)) |
799 (defsubst isearch-wrapped (frame) | 767 (defsubst isearch-wrapped-state (frame) |
800 "Return the search-wrapped flag in FRAME." | 768 "Return the search-wrapped flag in FRAME." |
801 (aref frame 8)) | 769 (aref frame 8)) |
802 (defsubst isearch-barrier (frame) | 770 (defsubst isearch-barrier-state (frame) |
803 "Return the barrier value in FRAME." | 771 "Return the barrier value in FRAME." |
804 (aref frame 9)) | 772 (aref frame 9)) |
805 (defsubst isearch-within-brackets (frame) | 773 (defsubst isearch-within-brackets-state (frame) |
806 "Return the in-character-class flag in FRAME." | 774 "Return the in-character-class flag in FRAME." |
807 (aref frame 10)) | 775 (aref frame 10)) |
808 (defsubst isearch-case-fold-search (frame) | 776 (defsubst isearch-case-fold-search-state (frame) |
809 "Return the case-folding flag in FRAME." | 777 "Return the case-folding flag in FRAME." |
810 (aref frame 11)) | 778 (aref frame 11)) |
779 (defsubst isearch-pop-fun-state (frame) | |
780 "Return the function restoring the mode-specific isearch state in FRAME." | |
781 (aref frame 12)) | |
811 | 782 |
812 (defun isearch-top-state () | 783 (defun isearch-top-state () |
813 (let ((cmd (car isearch-cmds))) | 784 (let ((cmd (car isearch-cmds))) |
814 (setq isearch-string (isearch-string cmd) | 785 (setq isearch-string (isearch-string-state cmd) |
815 isearch-message (isearch-message-string cmd) | 786 isearch-message (isearch-message-state cmd) |
816 isearch-success (isearch-success cmd) | 787 isearch-success (isearch-success-state cmd) |
817 isearch-forward (isearch-forward-flag cmd) | 788 isearch-forward (isearch-forward-state cmd) |
818 isearch-other-end (isearch-other-end cmd) | 789 isearch-other-end (isearch-other-end-state cmd) |
819 isearch-word (isearch-word cmd) | 790 isearch-word (isearch-word-state cmd) |
820 isearch-invalid-regexp (isearch-invalid-regexp cmd) | 791 isearch-invalid-regexp (isearch-invalid-regexp-state cmd) |
821 isearch-wrapped (isearch-wrapped cmd) | 792 isearch-wrapped (isearch-wrapped-state cmd) |
822 isearch-barrier (isearch-barrier cmd) | 793 isearch-barrier (isearch-barrier-state cmd) |
823 isearch-within-brackets (isearch-within-brackets cmd) | 794 isearch-within-brackets (isearch-within-brackets-state cmd) |
824 isearch-case-fold-search (isearch-case-fold-search cmd)) | 795 isearch-case-fold-search (isearch-case-fold-search-state cmd)) |
825 (goto-char (isearch-point cmd)))) | 796 (if (functionp (isearch-pop-fun-state cmd)) |
797 (funcall (isearch-pop-fun-state cmd) cmd)) | |
798 (goto-char (isearch-point-state cmd)))) | |
826 | 799 |
827 (defun isearch-pop-state () | 800 (defun isearch-pop-state () |
828 (setq isearch-cmds (cdr isearch-cmds)) | 801 (setq isearch-cmds (cdr isearch-cmds)) |
829 (isearch-top-state)) | 802 (isearch-top-state)) |
830 | 803 |
832 (setq isearch-cmds | 805 (setq isearch-cmds |
833 (cons (vector isearch-string isearch-message (point) | 806 (cons (vector isearch-string isearch-message (point) |
834 isearch-success isearch-forward isearch-other-end | 807 isearch-success isearch-forward isearch-other-end |
835 isearch-word | 808 isearch-word |
836 isearch-invalid-regexp isearch-wrapped isearch-barrier | 809 isearch-invalid-regexp isearch-wrapped isearch-barrier |
837 isearch-within-brackets isearch-case-fold-search) | 810 isearch-within-brackets isearch-case-fold-search |
811 (if isearch-push-state-function | |
812 (funcall isearch-push-state-function))) | |
838 isearch-cmds))) | 813 isearch-cmds))) |
839 | 814 |
840 | 815 |
841 ;; Commands active while inside of the isearch minor mode. | 816 ;; Commands active while inside of the isearch minor mode. |
842 | 817 |
1018 (exit-minibuffer)) | 993 (exit-minibuffer)) |
1019 | 994 |
1020 (defun isearch-cancel () | 995 (defun isearch-cancel () |
1021 "Terminate the search and go back to the starting point." | 996 "Terminate the search and go back to the starting point." |
1022 (interactive) | 997 (interactive) |
998 (if (functionp (isearch-pop-fun-state (car (last isearch-cmds)))) | |
999 (funcall (isearch-pop-fun-state (car (last isearch-cmds))) | |
1000 (car (last isearch-cmds)))) | |
1023 (goto-char isearch-opoint) | 1001 (goto-char isearch-opoint) |
1024 (isearch-done t) | 1002 (isearch-done t) ; exit isearch |
1025 (isearch-clean-overlays) | 1003 (isearch-clean-overlays) |
1026 (signal 'quit nil)) ; and pass on quit signal | 1004 (signal 'quit nil)) ; and pass on quit signal |
1027 | 1005 |
1028 (defun isearch-abort () | 1006 (defun isearch-abort () |
1029 "Abort incremental search mode if searching is successful, signaling quit. | 1007 "Abort incremental search mode if searching is successful, signaling quit. |
1030 Otherwise, revert to previous successful search and continue searching. | 1008 Otherwise, revert to previous successful search and continue searching. |
1031 Use `isearch-exit' to quit without signaling." | 1009 Use `isearch-exit' to quit without signaling." |
1033 ;; (ding) signal instead below, if quitting | 1011 ;; (ding) signal instead below, if quitting |
1034 (discard-input) | 1012 (discard-input) |
1035 (if isearch-success | 1013 (if isearch-success |
1036 ;; If search is successful, move back to starting point | 1014 ;; If search is successful, move back to starting point |
1037 ;; and really do quit. | 1015 ;; and really do quit. |
1038 (progn (goto-char isearch-opoint) | 1016 (progn |
1039 (setq isearch-success nil) | 1017 (setq isearch-success nil) |
1040 (isearch-done t) ; exit isearch | 1018 (isearch-cancel)) |
1041 (isearch-clean-overlays) | |
1042 (signal 'quit nil)) ; and pass on quit signal | |
1043 ;; If search is failing, or has an incomplete regexp, | 1019 ;; If search is failing, or has an incomplete regexp, |
1044 ;; rub out until it is once more successful. | 1020 ;; rub out until it is once more successful. |
1045 (while (or (not isearch-success) isearch-invalid-regexp) | 1021 (while (or (not isearch-success) isearch-invalid-regexp) |
1046 (isearch-pop-state)) | 1022 (isearch-pop-state)) |
1047 (isearch-update))) | 1023 (isearch-update))) |
1062 isearch-string "") | 1038 isearch-string "") |
1063 isearch-case-fold-search isearch-last-case-fold-search) | 1039 isearch-case-fold-search isearch-last-case-fold-search) |
1064 ;; If already have what to search for, repeat it. | 1040 ;; If already have what to search for, repeat it. |
1065 (or isearch-success | 1041 (or isearch-success |
1066 (progn | 1042 (progn |
1067 (goto-char (if isearch-forward (point-min) (point-max))) | 1043 (if isearch-wrap-function |
1044 (funcall isearch-wrap-function) | |
1045 (goto-char (if isearch-forward (point-min) (point-max)))) | |
1068 (setq isearch-wrapped t)))) | 1046 (setq isearch-wrapped t)))) |
1069 ;; C-s in reverse or C-r in forward, change direction. | 1047 ;; C-s in reverse or C-r in forward, change direction. |
1070 (setq isearch-forward (not isearch-forward))) | 1048 (setq isearch-forward (not isearch-forward))) |
1071 | 1049 |
1072 (setq isearch-barrier (point)) ; For subsequent \| if regexp. | 1050 (setq isearch-barrier (point)) ; For subsequent \| if regexp. |
1104 "Toggle regexp searching on or off." | 1082 "Toggle regexp searching on or off." |
1105 ;; The status stack is left unchanged. | 1083 ;; The status stack is left unchanged. |
1106 (interactive) | 1084 (interactive) |
1107 (setq isearch-regexp (not isearch-regexp)) | 1085 (setq isearch-regexp (not isearch-regexp)) |
1108 (if isearch-regexp (setq isearch-word nil)) | 1086 (if isearch-regexp (setq isearch-word nil)) |
1087 (setq isearch-success t isearch-adjusted t) | |
1109 (isearch-update)) | 1088 (isearch-update)) |
1110 | 1089 |
1111 (defun isearch-toggle-case-fold () | 1090 (defun isearch-toggle-case-fold () |
1112 "Toggle case folding in searching on or off." | 1091 "Toggle case folding in searching on or off." |
1113 (interactive) | 1092 (interactive) |
1116 (let ((message-log-max nil)) | 1095 (let ((message-log-max nil)) |
1117 (message "%s%s [case %ssensitive]" | 1096 (message "%s%s [case %ssensitive]" |
1118 (isearch-message-prefix nil nil isearch-nonincremental) | 1097 (isearch-message-prefix nil nil isearch-nonincremental) |
1119 isearch-message | 1098 isearch-message |
1120 (if isearch-case-fold-search "in" ""))) | 1099 (if isearch-case-fold-search "in" ""))) |
1121 (setq isearch-adjusted t) | 1100 (setq isearch-success t isearch-adjusted t) |
1122 (sit-for 1) | 1101 (sit-for 1) |
1123 (isearch-update)) | 1102 (isearch-update)) |
1124 | 1103 |
1125 (defun isearch-query-replace () | 1104 (defun isearch-query-replace (&optional regexp-flag) |
1126 "Start query-replace with string to replace from last search string." | 1105 "Start query-replace with string to replace from last search string." |
1127 (interactive) | 1106 (interactive) |
1128 (barf-if-buffer-read-only) | 1107 (barf-if-buffer-read-only) |
1108 (if regexp-flag (setq isearch-regexp t)) | |
1129 (let ((case-fold-search isearch-case-fold-search)) | 1109 (let ((case-fold-search isearch-case-fold-search)) |
1130 (isearch-done) | 1110 (isearch-done) |
1131 (isearch-clean-overlays) | 1111 (isearch-clean-overlays) |
1132 (and isearch-forward isearch-other-end (goto-char isearch-other-end)) | 1112 (if (and (< isearch-other-end (point)) |
1113 (not (and transient-mark-mode mark-active | |
1114 (< isearch-opoint (point))))) | |
1115 (goto-char isearch-other-end)) | |
1116 (set query-replace-from-history-variable | |
1117 (cons isearch-string | |
1118 (symbol-value query-replace-from-history-variable))) | |
1133 (perform-replace | 1119 (perform-replace |
1134 isearch-string | 1120 isearch-string |
1135 (query-replace-read-to isearch-string "Query replace" isearch-regexp) | 1121 (query-replace-read-to |
1136 t isearch-regexp isearch-word))) | 1122 isearch-string |
1123 (if isearch-regexp "Query replace regexp" "Query replace") | |
1124 isearch-regexp) | |
1125 t isearch-regexp isearch-word nil nil | |
1126 (if (and transient-mark-mode mark-active) (region-beginning)) | |
1127 (if (and transient-mark-mode mark-active) (region-end))))) | |
1137 | 1128 |
1138 (defun isearch-query-replace-regexp () | 1129 (defun isearch-query-replace-regexp () |
1139 "Start query-replace-regexp with string to replace from last search string." | 1130 "Start query-replace-regexp with string to replace from last search string." |
1140 (interactive) | 1131 (interactive) |
1141 (let ((query-replace-interactive t) | 1132 (isearch-query-replace t)) |
1142 (case-fold-search isearch-case-fold-search)) | |
1143 ;; Put search string into the right ring | |
1144 (setq isearch-regexp t) | |
1145 (isearch-done) | |
1146 (isearch-clean-overlays) | |
1147 (and isearch-forward isearch-other-end (goto-char isearch-other-end)) | |
1148 (call-interactively 'query-replace-regexp))) | |
1149 | 1133 |
1150 | 1134 |
1151 (defun isearch-delete-char () | 1135 (defun isearch-delete-char () |
1152 "Discard last input item and move point back. | 1136 "Discard last input item and move point back. |
1153 If no previous match was done, just beep." | 1137 If no previous match was done, just beep." |
1341 (when (and isearch-regexp (eq (not (isearch-backslash isearch-string)) | 1325 (when (and isearch-regexp (eq (not (isearch-backslash isearch-string)) |
1342 (not want-backslash)) | 1326 (not want-backslash)) |
1343 ;; We have to check 2 stack frames because the last might be | 1327 ;; We have to check 2 stack frames because the last might be |
1344 ;; invalid just because of a backslash. | 1328 ;; invalid just because of a backslash. |
1345 (or (not isearch-invalid-regexp) | 1329 (or (not isearch-invalid-regexp) |
1346 (not (isearch-invalid-regexp (cadr isearch-cmds))) | 1330 (not (isearch-invalid-regexp-state (cadr isearch-cmds))) |
1347 allow-invalid)) | 1331 allow-invalid)) |
1348 (if to-barrier | 1332 (if to-barrier |
1349 (progn (goto-char isearch-barrier) | 1333 (progn (goto-char isearch-barrier) |
1350 (setq isearch-adjusted t)) | 1334 (setq isearch-adjusted t)) |
1351 (let* ((stack isearch-cmds) | 1335 (let* ((stack isearch-cmds) |
1356 ;; removes all bracket-sets and groups that might be in the way, as | 1340 ;; removes all bracket-sets and groups that might be in the way, as |
1357 ;; well as partial \{\} constructs that the code below leaves behind. | 1341 ;; well as partial \{\} constructs that the code below leaves behind. |
1358 ;; Also skip over postfix operators -- though horrid, | 1342 ;; Also skip over postfix operators -- though horrid, |
1359 ;; 'ab?\{5,6\}+\{1,2\}*' is perfectly legal. | 1343 ;; 'ab?\{5,6\}+\{1,2\}*' is perfectly legal. |
1360 (while (and previous | 1344 (while (and previous |
1361 (or (isearch-invalid-regexp frame) | 1345 (or (isearch-invalid-regexp-state frame) |
1362 (let* ((string (isearch-string frame)) | 1346 (let* ((string (isearch-string-state frame)) |
1363 (lchar (aref string (1- (length string))))) | 1347 (lchar (aref string (1- (length string))))) |
1364 ;; The operators aren't always operators; check | 1348 ;; The operators aren't always operators; check |
1365 ;; backslashes. This doesn't handle the case of | 1349 ;; backslashes. This doesn't handle the case of |
1366 ;; operators at the beginning of the regexp not | 1350 ;; operators at the beginning of the regexp not |
1367 ;; being special, but then we should fall back to | 1351 ;; being special, but then we should fall back to |
1368 ;; the barrier anyway because it's all optional. | 1352 ;; the barrier anyway because it's all optional. |
1369 (if (isearch-backslash | 1353 (if (isearch-backslash |
1370 (isearch-string (car previous))) | 1354 (isearch-string-state (car previous))) |
1371 (eq lchar ?\}) | 1355 (eq lchar ?\}) |
1372 (memq lchar '(?* ?? ?+)))))) | 1356 (memq lchar '(?* ?? ?+)))))) |
1373 (setq stack previous previous (cdr previous) frame (car stack))) | 1357 (setq stack previous previous (cdr previous) frame (car stack))) |
1374 (when stack | 1358 (when stack |
1375 ;; `stack' now refers the most recent valid regexp that is not at | 1359 ;; `stack' now refers the most recent valid regexp that is not at |
1376 ;; all optional in its last term. Now dig one level deeper and find | 1360 ;; all optional in its last term. Now dig one level deeper and find |
1377 ;; what matched before that. | 1361 ;; what matched before that. |
1378 (let ((last-other-end (or (isearch-other-end (car previous)) | 1362 (let ((last-other-end (or (isearch-other-end-state (car previous)) |
1379 isearch-barrier))) | 1363 isearch-barrier))) |
1380 (goto-char (if isearch-forward | 1364 (goto-char (if isearch-forward |
1381 (max last-other-end isearch-barrier) | 1365 (max last-other-end isearch-barrier) |
1382 (min last-other-end isearch-barrier))) | 1366 (min last-other-end isearch-barrier))) |
1383 (setq isearch-adjusted t)))))) | 1367 (setq isearch-adjusted t)))))) |
1636 (setq prefix-arg arg) | 1620 (setq prefix-arg arg) |
1637 (command-execute scroll-command) | 1621 (command-execute scroll-command) |
1638 (let ((ab-bel (isearch-string-out-of-window isearch-point))) | 1622 (let ((ab-bel (isearch-string-out-of-window isearch-point))) |
1639 (if ab-bel | 1623 (if ab-bel |
1640 (isearch-back-into-window (eq ab-bel 'above) isearch-point) | 1624 (isearch-back-into-window (eq ab-bel 'above) isearch-point) |
1641 (or (eq (point) isearch-point) | 1625 (goto-char isearch-point))) |
1642 (goto-char isearch-point)))) | |
1643 (isearch-update)) | 1626 (isearch-update)) |
1644 (search-exit-option | 1627 (search-exit-option |
1645 (let (window) | 1628 (let (window) |
1646 (isearch-unread-key-sequence keylist) | 1629 (isearch-unread-key-sequence keylist) |
1647 (setq main-event (car unread-command-events)) | 1630 (setq main-event (car unread-command-events)) |
1911 isearch-within-brackets nil)) | 1894 isearch-within-brackets nil)) |
1912 (error nil))) | 1895 (error nil))) |
1913 ;; If currently failing, display no ellipsis. | 1896 ;; If currently failing, display no ellipsis. |
1914 (or isearch-success (setq ellipsis nil)) | 1897 (or isearch-success (setq ellipsis nil)) |
1915 (let ((m (concat (if isearch-success "" "failing ") | 1898 (let ((m (concat (if isearch-success "" "failing ") |
1899 (if isearch-adjusted "pending " "") | |
1916 (if (and isearch-wrapped | 1900 (if (and isearch-wrapped |
1901 (not isearch-wrap-function) | |
1917 (if isearch-forward | 1902 (if isearch-forward |
1918 (> (point) isearch-opoint) | 1903 (> (point) isearch-opoint) |
1919 (< (point) isearch-opoint))) | 1904 (< (point) isearch-opoint))) |
1920 "over") | 1905 "over") |
1921 (if isearch-wrapped "wrapped ") | 1906 (if isearch-wrapped "wrapped ") |
2006 (setq isearch-invalid-regexp (format "%s" lossage)))) | 1991 (setq isearch-invalid-regexp (format "%s" lossage)))) |
2007 | 1992 |
2008 (if isearch-success | 1993 (if isearch-success |
2009 nil | 1994 nil |
2010 ;; Ding if failed this time after succeeding last time. | 1995 ;; Ding if failed this time after succeeding last time. |
2011 (and (isearch-success (car isearch-cmds)) | 1996 (and (isearch-success-state (car isearch-cmds)) |
2012 (ding)) | 1997 (ding)) |
2013 (goto-char (isearch-point (car isearch-cmds))))) | 1998 (if (functionp (isearch-pop-fun-state (car isearch-cmds))) |
1999 (funcall (isearch-pop-fun-state (car isearch-cmds)) (car isearch-cmds))) | |
2000 (goto-char (isearch-point-state (car isearch-cmds))))) | |
2014 | 2001 |
2015 | 2002 |
2016 ;; Called when opening an overlay, and we are still in isearch. | 2003 ;; Called when opening an overlay, and we are still in isearch. |
2017 (defun isearch-open-overlay-temporary (ov) | 2004 (defun isearch-open-overlay-temporary (ov) |
2018 (if (not (null (overlay-get ov 'isearch-open-invisible-temporary))) | 2005 (if (not (null (overlay-get ov 'isearch-open-invisible-temporary))) |