aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Malabarba2015-10-21 17:07:08 +0100
committerArtur Malabarba2015-10-21 17:11:09 +0100
commitab65b33f8c67d5341dae21fc03053e6202077d90 (patch)
tree0f175a887740e61717856e71c1e97f6c70b9d7d3
parentf6ece2420c3dc6f3dde06c7f8722f5b0b7e1ef4a (diff)
downloademacs-ab65b33f8c67d5341dae21fc03053e6202077d90.tar.gz
emacs-ab65b33f8c67d5341dae21fc03053e6202077d90.zip
* lisp/isearch.el: Rename word search to regexp-function search
`isearch-word' went well beyond its original purpose, and the name no longer makes sense. It is now called `isearch-regexp-function', and it's value should always be a function that converts a string to a regexp (though setting it to t is still supported for now). (isearch-word): Make obsolete. (isearch-regexp-function): New variable. (isearch-mode, isearch-done, isearch--state, isearch--set-state) (with-isearch-suspended, isearch-toggle-regexp) (isearch-toggle-word, isearch-toggle-symbol) (isearch-toggle-character-fold, isearch-query-replace) (isearch-occur, isearch-highlight-regexp) (isearch-search-and-update, isearch-message-prefix) (isearch-search-fun-default, isearch-search) (isearch-lazy-highlight-new-loop, isearch-lazy-highlight-search): Use it. (isearch-lazy-highlight-regexp-function): New var. (isearch-lazy-highlight-word): Make obsolete. (isearch--describe-regexp-mode): New function. (isearch--describe-word-mode): Make obsolete. * lisp/info.el (Info-isearch-search): Use the new var. * lisp/replace.el (replace-search, replace-highlight): Use the new var. * lisp/obsolete/longlines.el (longlines-search-function): Use the new var. * lisp/hexl.el (hexl-isearch-search-function): Use the new var. * lisp/cedet/semantic/senator.el (senator-isearch-search-fun): Use the new var.
-rw-r--r--lisp/cedet/semantic/senator.el2
-rw-r--r--lisp/hexl.el2
-rw-r--r--lisp/info.el6
-rw-r--r--lisp/isearch.el127
-rw-r--r--lisp/obsolete/longlines.el2
-rw-r--r--lisp/replace.el4
6 files changed, 77 insertions, 66 deletions
diff --git a/lisp/cedet/semantic/senator.el b/lisp/cedet/semantic/senator.el
index 372e1d920e7..544abff8dd1 100644
--- a/lisp/cedet/semantic/senator.el
+++ b/lisp/cedet/semantic/senator.el
@@ -813,7 +813,7 @@ Use a senator search function when semantic isearch mode is enabled."
813 (concat (if senator-isearch-semantic-mode 813 (concat (if senator-isearch-semantic-mode
814 "senator-" 814 "senator-"
815 "") 815 "")
816 (cond (isearch-word "word-") 816 (cond (isearch-regexp-function "word-")
817 (isearch-regexp "re-") 817 (isearch-regexp "re-")
818 (t "")) 818 (t ""))
819 "search-" 819 "search-"
diff --git a/lisp/hexl.el b/lisp/hexl.el
index 4aa76d23cb7..499253e931f 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -406,7 +406,7 @@ You can use \\[hexl-find-file] to visit a file in Hexl mode.
406 406
407 407
408(defun hexl-isearch-search-function () 408(defun hexl-isearch-search-function ()
409 (if (and (not isearch-regexp) (not isearch-word)) 409 (if (and (not isearch-regexp) (not isearch-regexp-function))
410 (lambda (string &optional bound noerror count) 410 (lambda (string &optional bound noerror count)
411 (funcall 411 (funcall
412 (if isearch-forward 're-search-forward 're-search-backward) 412 (if isearch-forward 're-search-forward 're-search-backward)
diff --git a/lisp/info.el b/lisp/info.el
index bd12d568291..b11330b1430 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -2114,14 +2114,14 @@ If DIRECTION is `backward', search in the reverse direction."
2114 search-whitespace-regexp))) 2114 search-whitespace-regexp)))
2115 (Info-search 2115 (Info-search
2116 (cond 2116 (cond
2117 (isearch-word 2117 (isearch-regexp-function
2118 ;; Lax version of word search 2118 ;; Lax version of word search
2119 (let ((lax (not (or isearch-nonincremental 2119 (let ((lax (not (or isearch-nonincremental
2120 (eq (length string) 2120 (eq (length string)
2121 (length (isearch--state-string 2121 (length (isearch--state-string
2122 (car isearch-cmds)))))))) 2122 (car isearch-cmds))))))))
2123 (if (functionp isearch-word) 2123 (if (functionp isearch-regexp-function)
2124 (funcall isearch-word string lax) 2124 (funcall isearch-regexp-function string lax)
2125 (word-search-regexp string lax)))) 2125 (word-search-regexp string lax))))
2126 (isearch-regexp string) 2126 (isearch-regexp string)
2127 (t (regexp-quote string))) 2127 (t (regexp-quote string)))
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 4fc9b380ec7..26e6eb1d7d4 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -551,13 +551,16 @@ This is like `describe-bindings', but displays only Isearch keys."
551 551
552(defvar isearch-forward nil) ; Searching in the forward direction. 552(defvar isearch-forward nil) ; Searching in the forward direction.
553(defvar isearch-regexp nil) ; Searching for a regexp. 553(defvar isearch-regexp nil) ; Searching for a regexp.
554(defvar isearch-word nil 554(defvar isearch-regexp-function nil
555 "Regexp-based search mode for words/symbols. 555 "Regexp-based search mode for words/symbols.
556If t, do incremental search for a sequence of words, ignoring punctuation. 556If the value is a function (e.g. `isearch-symbol-regexp'), it is
557If the value is a function (e.g. `isearch-symbol-regexp'), it is called to 557called to convert a plain search string to a regexp used by
558convert the search string to a regexp used by regexp search functions. 558regexp search functions.
559The property `isearch-message-prefix' put on this function specifies the 559The symbol property `isearch-message-prefix' put on this function
560prefix string displayed in the search message.") 560specifies the prefix string displayed in the search message.")
561;; We still support setting this to t for backwards compatibility.
562(define-obsolete-variable-alias 'isearch-word
563 'isearch-regexp-function "25.1")
561 564
562(defvar isearch-lax-whitespace t 565(defvar isearch-lax-whitespace t
563 "If non-nil, a space will match a sequence of whitespace chars. 566 "If non-nil, a space will match a sequence of whitespace chars.
@@ -840,7 +843,7 @@ See the command `isearch-forward-symbol' for more information."
840(put 'character-fold-to-regexp 'isearch-message-prefix "char-fold ") 843(put 'character-fold-to-regexp 'isearch-message-prefix "char-fold ")
841(defvar character-fold-search) 844(defvar character-fold-search)
842 845
843(defun isearch-mode (forward &optional regexp op-fun recursive-edit word) 846(defun isearch-mode (forward &optional regexp op-fun recursive-edit regexp-function)
844 "Start Isearch minor mode. 847 "Start Isearch minor mode.
845It is called by the function `isearch-forward' and other related functions. 848It is called by the function `isearch-forward' and other related functions.
846 849
@@ -856,16 +859,16 @@ does not return to the calling function until the search is completed.
856To behave this way it enters a recursive-edit and exits it when done 859To behave this way it enters a recursive-edit and exits it when done
857isearching. 860isearching.
858 861
859The arg WORD, if t, does incremental search for a sequence of words, 862The arg REGEXP-FUNCTION, if non-nil, should be a function. It is
860ignoring punctuation. If the value is a function, it is called to 863used to set the value of `isearch-regexp-function'."
861convert the search string to a regexp used by regexp search functions."
862 864
863 ;; Initialize global vars. 865 ;; Initialize global vars.
864 (setq isearch-forward forward 866 (setq isearch-forward forward
865 isearch-regexp regexp 867 isearch-regexp regexp
866 isearch-word (or word (and character-fold-search 868 isearch-regexp-function (or regexp-function
867 (not regexp) 869 (and character-fold-search
868 'character-fold-to-regexp)) 870 (not regexp)
871 'character-fold-to-regexp))
869 isearch-op-fun op-fun 872 isearch-op-fun op-fun
870 isearch-last-case-fold-search isearch-case-fold-search 873 isearch-last-case-fold-search isearch-case-fold-search
871 isearch-case-fold-search case-fold-search 874 isearch-case-fold-search case-fold-search
@@ -1029,7 +1032,7 @@ NOPUSH is t and EDIT is t."
1029 1032
1030 (if isearch-resume-in-command-history 1033 (if isearch-resume-in-command-history
1031 (let ((command `(isearch-resume ,isearch-string ,isearch-regexp 1034 (let ((command `(isearch-resume ,isearch-string ,isearch-regexp
1032 ,isearch-word ,isearch-forward 1035 ,isearch-regexp-function ,isearch-forward
1033 ,isearch-message 1036 ,isearch-message
1034 ',isearch-case-fold-search))) 1037 ',isearch-case-fold-search)))
1035 (unless (equal (car command-history) command) 1038 (unless (equal (car command-history) command)
@@ -1131,7 +1134,7 @@ REGEXP if non-nil says use the regexp search ring."
1131 (success isearch-success) 1134 (success isearch-success)
1132 (forward isearch-forward) 1135 (forward isearch-forward)
1133 (other-end isearch-other-end) 1136 (other-end isearch-other-end)
1134 (word isearch-word) 1137 (word isearch-regexp-function)
1135 (error isearch-error) 1138 (error isearch-error)
1136 (wrapped isearch-wrapped) 1139 (wrapped isearch-wrapped)
1137 (barrier isearch-barrier) 1140 (barrier isearch-barrier)
@@ -1157,7 +1160,7 @@ REGEXP if non-nil says use the regexp search ring."
1157 isearch-success (isearch--state-success cmd) 1160 isearch-success (isearch--state-success cmd)
1158 isearch-forward (isearch--state-forward cmd) 1161 isearch-forward (isearch--state-forward cmd)
1159 isearch-other-end (isearch--state-other-end cmd) 1162 isearch-other-end (isearch--state-other-end cmd)
1160 isearch-word (isearch--state-word cmd) 1163 isearch-regexp-function (isearch--state-word cmd)
1161 isearch-error (isearch--state-error cmd) 1164 isearch-error (isearch--state-error cmd)
1162 isearch-wrapped (isearch--state-wrapped cmd) 1165 isearch-wrapped (isearch--state-wrapped cmd)
1163 isearch-barrier (isearch--state-barrier cmd) 1166 isearch-barrier (isearch--state-barrier cmd)
@@ -1213,7 +1216,7 @@ If MSG is non-nil, use variable `isearch-message', otherwise `isearch-string'."
1213 "Exit Isearch mode, run BODY, and reinvoke the pending search. 1216 "Exit Isearch mode, run BODY, and reinvoke the pending search.
1214You can update the global isearch variables by setting new values to 1217You can update the global isearch variables by setting new values to
1215`isearch-new-string', `isearch-new-message', `isearch-new-forward', 1218`isearch-new-string', `isearch-new-message', `isearch-new-forward',
1216`isearch-new-word', `isearch-new-case-fold'." 1219`isearch-new-regexp-function', `isearch-new-case-fold'."
1217 ;; This code is very hairy for several reasons, explained in the code. 1220 ;; This code is very hairy for several reasons, explained in the code.
1218 ;; Mainly, isearch-mode must be terminated while editing and then restarted. 1221 ;; Mainly, isearch-mode must be terminated while editing and then restarted.
1219 ;; If there were a way to catch any change of buffer from the minibuffer, 1222 ;; If there were a way to catch any change of buffer from the minibuffer,
@@ -1230,7 +1233,7 @@ You can update the global isearch variables by setting new values to
1230 (isearch-new-string isearch-string) 1233 (isearch-new-string isearch-string)
1231 (isearch-new-message isearch-message) 1234 (isearch-new-message isearch-message)
1232 (isearch-new-forward isearch-forward) 1235 (isearch-new-forward isearch-forward)
1233 (isearch-new-word isearch-word) 1236 (isearch-new-regexp-function isearch-regexp-function)
1234 (isearch-new-case-fold isearch-case-fold-search) 1237 (isearch-new-case-fold isearch-case-fold-search)
1235 1238
1236 (isearch-regexp isearch-regexp) 1239 (isearch-regexp isearch-regexp)
@@ -1296,13 +1299,13 @@ You can update the global isearch variables by setting new values to
1296 isearch-regexp 1299 isearch-regexp
1297 isearch-op-fun 1300 isearch-op-fun
1298 nil 1301 nil
1299 isearch-word) 1302 isearch-regexp-function)
1300 1303
1301 ;; Copy new local values to isearch globals 1304 ;; Copy new local values to isearch globals
1302 (setq isearch-string isearch-new-string 1305 (setq isearch-string isearch-new-string
1303 isearch-message isearch-new-message 1306 isearch-message isearch-new-message
1304 isearch-forward isearch-new-forward 1307 isearch-forward isearch-new-forward
1305 isearch-word isearch-new-word 1308 isearch-regexp-function isearch-new-regexp-function
1306 isearch-case-fold-search isearch-new-case-fold)) 1309 isearch-case-fold-search isearch-new-case-fold))
1307 1310
1308 ;; Empty isearch-string means use default. 1311 ;; Empty isearch-string means use default.
@@ -1493,7 +1496,7 @@ Use `isearch-exit' to quit without signaling."
1493 ;; The status stack is left unchanged. 1496 ;; The status stack is left unchanged.
1494 (interactive) 1497 (interactive)
1495 (setq isearch-regexp (not isearch-regexp)) 1498 (setq isearch-regexp (not isearch-regexp))
1496 (if isearch-regexp (setq isearch-word nil)) 1499 (if isearch-regexp (setq isearch-regexp-function nil))
1497 (setq isearch-success t isearch-adjusted t) 1500 (setq isearch-success t isearch-adjusted t)
1498 (isearch-update)) 1501 (isearch-update))
1499 1502
@@ -1501,26 +1504,30 @@ Use `isearch-exit' to quit without signaling."
1501 "Toggle word searching on or off." 1504 "Toggle word searching on or off."
1502 ;; The status stack is left unchanged. 1505 ;; The status stack is left unchanged.
1503 (interactive) 1506 (interactive)
1504 (setq isearch-word (if (eq isearch-word t) nil t)) 1507 (setq isearch-regexp-function
1505 (if isearch-word (setq isearch-regexp nil)) 1508 (if (memq isearch-regexp-function '(t word-search-regexp))
1509 nil #'word-search-regexp))
1510 (when isearch-regexp-function (setq isearch-regexp nil))
1506 (setq isearch-success t isearch-adjusted t) 1511 (setq isearch-success t isearch-adjusted t)
1507 (isearch-update)) 1512 (isearch-update))
1508 1513
1509(defun isearch-toggle-symbol () 1514(defun isearch-toggle-symbol ()
1510 "Toggle symbol searching on or off." 1515 "Toggle symbol searching on or off."
1511 (interactive) 1516 (interactive)
1512 (setq isearch-word (unless (eq isearch-word 'isearch-symbol-regexp) 1517 (setq isearch-regexp-function
1513 'isearch-symbol-regexp)) 1518 (unless (eq isearch-regexp-function #'isearch-symbol-regexp)
1514 (if isearch-word (setq isearch-regexp nil)) 1519 'isearch-symbol-regexp))
1520 (when isearch-regexp-function (setq isearch-regexp nil))
1515 (setq isearch-success t isearch-adjusted t) 1521 (setq isearch-success t isearch-adjusted t)
1516 (isearch-update)) 1522 (isearch-update))
1517 1523
1518(defun isearch-toggle-character-fold () 1524(defun isearch-toggle-character-fold ()
1519 "Toggle character folding in searching on or off." 1525 "Toggle character folding in searching on or off."
1520 (interactive) 1526 (interactive)
1521 (setq isearch-word (unless (eq isearch-word #'character-fold-to-regexp) 1527 (setq isearch-regexp-function
1522 #'character-fold-to-regexp)) 1528 (unless (eq isearch-regexp-function #'character-fold-to-regexp)
1523 (if isearch-word (setq isearch-regexp nil)) 1529 #'character-fold-to-regexp))
1530 (when isearch-regexp-function (setq isearch-regexp nil))
1524 (setq isearch-success t isearch-adjusted t) 1531 (setq isearch-success t isearch-adjusted t)
1525 (isearch-update)) 1532 (isearch-update))
1526 1533
@@ -1767,12 +1774,12 @@ replacements from Isearch is `M-s w ... M-%'."
1767 (query-replace-read-to 1774 (query-replace-read-to
1768 isearch-string 1775 isearch-string
1769 (concat "Query replace" 1776 (concat "Query replace"
1770 (isearch--describe-word-mode (or delimited isearch-word) t) 1777 (isearch--describe-regexp-mode (or delimited isearch-regexp-function) t)
1771 (if isearch-regexp " regexp" "") 1778 (if isearch-regexp " regexp" "")
1772 (if backward " backward" "") 1779 (if backward " backward" "")
1773 (if (and transient-mark-mode mark-active) " in region" "")) 1780 (if (and transient-mark-mode mark-active) " in region" ""))
1774 isearch-regexp) 1781 isearch-regexp)
1775 t isearch-regexp (or delimited isearch-word) nil nil 1782 t isearch-regexp (or delimited isearch-regexp-function) nil nil
1776 (if (and transient-mark-mode mark-active) (region-beginning)) 1783 (if (and transient-mark-mode mark-active) (region-beginning))
1777 (if (and transient-mark-mode mark-active) (region-end)) 1784 (if (and transient-mark-mode mark-active) (region-end))
1778 backward)) 1785 backward))
@@ -1799,9 +1806,9 @@ characters in that string."
1799 (interactive 1806 (interactive
1800 (let* ((perform-collect (consp current-prefix-arg)) 1807 (let* ((perform-collect (consp current-prefix-arg))
1801 (regexp (cond 1808 (regexp (cond
1802 ((functionp isearch-word) 1809 ((functionp isearch-regexp-function)
1803 (funcall isearch-word isearch-string)) 1810 (funcall isearch-regexp-function isearch-string))
1804 (isearch-word (word-search-regexp isearch-string)) 1811 (isearch-regexp-function (word-search-regexp isearch-string))
1805 (isearch-regexp isearch-string) 1812 (isearch-regexp isearch-string)
1806 (t (regexp-quote isearch-string))))) 1813 (t (regexp-quote isearch-string)))))
1807 (list regexp 1814 (list regexp
@@ -1850,9 +1857,9 @@ and reads its face argument using `hi-lock-read-face-name'."
1850 (isearch-done nil t) 1857 (isearch-done nil t)
1851 (isearch-clean-overlays)) 1858 (isearch-clean-overlays))
1852 (require 'hi-lock nil t) 1859 (require 'hi-lock nil t)
1853 (let ((regexp (cond ((functionp isearch-word) 1860 (let ((regexp (cond ((functionp isearch-regexp-function)
1854 (funcall isearch-word isearch-string)) 1861 (funcall isearch-regexp-function isearch-string))
1855 (isearch-word (word-search-regexp isearch-string)) 1862 (isearch-regexp-function (word-search-regexp isearch-string))
1856 (isearch-regexp isearch-string) 1863 (isearch-regexp isearch-string)
1857 ((if (and (eq isearch-case-fold-search t) 1864 ((if (and (eq isearch-case-fold-search t)
1858 search-upper-case) 1865 search-upper-case)
@@ -2057,9 +2064,9 @@ With argument, add COUNT copies of the character."
2057 (setq case-fold-search 2064 (setq case-fold-search
2058 (isearch-no-upper-case-p isearch-string isearch-regexp))) 2065 (isearch-no-upper-case-p isearch-string isearch-regexp)))
2059 (looking-at (cond 2066 (looking-at (cond
2060 ((functionp isearch-word) 2067 ((functionp isearch-regexp-function)
2061 (funcall isearch-word isearch-string t)) 2068 (funcall isearch-regexp-function isearch-string t))
2062 (isearch-word (word-search-regexp isearch-string t)) 2069 (isearch-regexp-function (word-search-regexp isearch-string t))
2063 (isearch-regexp isearch-string) 2070 (isearch-regexp isearch-string)
2064 (t (regexp-quote isearch-string))))) 2071 (t (regexp-quote isearch-string)))))
2065 (error nil)) 2072 (error nil))
@@ -2514,20 +2521,22 @@ If there is no completion possible, say so and continue searching."
2514 (isearch-message-suffix c-q-hack))) 2521 (isearch-message-suffix c-q-hack)))
2515 (if c-q-hack m (let ((message-log-max nil)) (message "%s" m))))) 2522 (if c-q-hack m (let ((message-log-max nil)) (message "%s" m)))))
2516 2523
2517(defun isearch--describe-word-mode (word-mode &optional space-before) 2524(defun isearch--describe-regexp-mode (regexp-function &optional space-before)
2518 "Make a string for describing WORD-MODE. 2525 "Make a string for describing REGEXP-FUNCTION.
2519If SPACE-BEFORE is non-nil, put a space before, instead of after, 2526If SPACE-BEFORE is non-nil, put a space before, instead of after,
2520the word mode." 2527the word mode."
2521 (let ((description 2528 (let ((description
2522 (cond ((and (symbolp word-mode) 2529 (cond ((and (symbolp regexp-function)
2523 (get word-mode 'isearch-message-prefix)) 2530 (get regexp-function 'isearch-message-prefix))
2524 (get word-mode 'isearch-message-prefix)) 2531 (get regexp-function 'isearch-message-prefix))
2525 (word-mode "word ") 2532 (regexp-function "word ")
2526 (t "")))) 2533 (t ""))))
2527 (if space-before 2534 (if space-before
2528 ;; Move space from the end to the beginning. 2535 ;; Move space from the end to the beginning.
2529 (replace-regexp-in-string "\\(.*\\) \\'" " \\1" description) 2536 (replace-regexp-in-string "\\(.*\\) \\'" " \\1" description)
2530 description))) 2537 description)))
2538(define-obsolete-function-alias 'isearch--describe-word-mode
2539 'isearch--describe-regexp-mode "25.1")
2531 2540
2532(defun isearch-message-prefix (&optional ellipsis nonincremental) 2541(defun isearch-message-prefix (&optional ellipsis nonincremental)
2533 ;; If about to search, and previous search regexp was invalid, 2542 ;; If about to search, and previous search regexp was invalid,
@@ -2556,7 +2565,7 @@ the word mode."
2556 (if np (setq prefix (concat np prefix))))) 2565 (if np (setq prefix (concat np prefix)))))
2557 isearch-filter-predicate) 2566 isearch-filter-predicate)
2558 prefix) 2567 prefix)
2559 (isearch--describe-word-mode isearch-word) 2568 (isearch--describe-regexp-mode isearch-regexp-function)
2560 (if isearch-regexp "regexp " "") 2569 (if isearch-regexp "regexp " "")
2561 (cond 2570 (cond
2562 (multi-isearch-file-list "multi-file ") 2571 (multi-isearch-file-list "multi-file ")
@@ -2603,7 +2612,7 @@ Can be changed via `isearch-search-fun-function' for special needs."
2603(defun isearch-search-fun-default () 2612(defun isearch-search-fun-default ()
2604 "Return default functions to use for the search." 2613 "Return default functions to use for the search."
2605 (cond 2614 (cond
2606 (isearch-word 2615 (isearch-regexp-function
2607 (lambda (string &optional bound noerror count) 2616 (lambda (string &optional bound noerror count)
2608 ;; Use lax versions to not fail at the end of the word while 2617 ;; Use lax versions to not fail at the end of the word while
2609 ;; the user adds and removes characters in the search string 2618 ;; the user adds and removes characters in the search string
@@ -2615,8 +2624,8 @@ Can be changed via `isearch-search-fun-function' for special needs."
2615 (car isearch-cmds)))))))) 2624 (car isearch-cmds))))))))
2616 (funcall 2625 (funcall
2617 (if isearch-forward #'re-search-forward #'re-search-backward) 2626 (if isearch-forward #'re-search-forward #'re-search-backward)
2618 (if (functionp isearch-word) 2627 (if (functionp isearch-regexp-function)
2619 (funcall isearch-word string lax) 2628 (funcall isearch-regexp-function string lax)
2620 (word-search-regexp string lax)) 2629 (word-search-regexp string lax))
2621 bound noerror count)))) 2630 bound noerror count))))
2622 ((and isearch-regexp isearch-regexp-lax-whitespace 2631 ((and isearch-regexp isearch-regexp-lax-whitespace
@@ -2721,7 +2730,7 @@ update the match data, and return point."
2721 ((and (not isearch-regexp) 2730 ((and (not isearch-regexp)
2722 (string-match "\\`Regular expression too big" isearch-error)) 2731 (string-match "\\`Regular expression too big" isearch-error))
2723 (cond 2732 (cond
2724 (isearch-word 2733 (isearch-regexp-function
2725 (setq isearch-error "Too many words")) 2734 (setq isearch-error "Too many words"))
2726 ((and isearch-lax-whitespace search-whitespace-regexp) 2735 ((and isearch-lax-whitespace search-whitespace-regexp)
2727 (setq isearch-error "Too many spaces for whitespace matching")))))) 2736 (setq isearch-error "Too many spaces for whitespace matching"))))))
@@ -2964,7 +2973,7 @@ since they have special meaning in a regexp."
2964;; - `isearch-string' is expected to contain the current search 2973;; - `isearch-string' is expected to contain the current search
2965;; string as entered by the user; 2974;; string as entered by the user;
2966;; - the type of the current search is expected to be given by 2975;; - the type of the current search is expected to be given by
2967;; `isearch-word' and `isearch-regexp'; 2976;; `isearch-regexp-function' and `isearch-regexp';
2968;; - the direction of the current search is expected to be given by 2977;; - the direction of the current search is expected to be given by
2969;; `isearch-forward'; 2978;; `isearch-forward';
2970;; - the variable `isearch-error' is expected to be true 2979;; - the variable `isearch-error' is expected to be true
@@ -2985,7 +2994,9 @@ since they have special meaning in a regexp."
2985(defvar isearch-lazy-highlight-regexp nil) 2994(defvar isearch-lazy-highlight-regexp nil)
2986(defvar isearch-lazy-highlight-lax-whitespace nil) 2995(defvar isearch-lazy-highlight-lax-whitespace nil)
2987(defvar isearch-lazy-highlight-regexp-lax-whitespace nil) 2996(defvar isearch-lazy-highlight-regexp-lax-whitespace nil)
2988(defvar isearch-lazy-highlight-word nil) 2997(defvar isearch-lazy-highlight-regexp-function nil)
2998(define-obsolete-variable-alias 'isearch-lazy-highlight-word
2999 'isearch-lazy-highlight-regexp-function "25.1")
2989(defvar isearch-lazy-highlight-forward nil) 3000(defvar isearch-lazy-highlight-forward nil)
2990(defvar isearch-lazy-highlight-error nil) 3001(defvar isearch-lazy-highlight-error nil)
2991 3002
@@ -3024,8 +3035,8 @@ by other Emacs features."
3024 isearch-case-fold-search)) 3035 isearch-case-fold-search))
3025 (not (eq isearch-lazy-highlight-regexp 3036 (not (eq isearch-lazy-highlight-regexp
3026 isearch-regexp)) 3037 isearch-regexp))
3027 (not (eq isearch-lazy-highlight-word 3038 (not (eq isearch-lazy-highlight-regexp-function
3028 isearch-word)) 3039 isearch-regexp-function))
3029 (not (eq isearch-lazy-highlight-lax-whitespace 3040 (not (eq isearch-lazy-highlight-lax-whitespace
3030 isearch-lax-whitespace)) 3041 isearch-lax-whitespace))
3031 (not (eq isearch-lazy-highlight-regexp-lax-whitespace 3042 (not (eq isearch-lazy-highlight-regexp-lax-whitespace
@@ -3065,7 +3076,7 @@ by other Emacs features."
3065 isearch-lazy-highlight-regexp isearch-regexp 3076 isearch-lazy-highlight-regexp isearch-regexp
3066 isearch-lazy-highlight-lax-whitespace isearch-lax-whitespace 3077 isearch-lazy-highlight-lax-whitespace isearch-lax-whitespace
3067 isearch-lazy-highlight-regexp-lax-whitespace isearch-regexp-lax-whitespace 3078 isearch-lazy-highlight-regexp-lax-whitespace isearch-regexp-lax-whitespace
3068 isearch-lazy-highlight-word isearch-word 3079 isearch-lazy-highlight-regexp-function isearch-regexp-function
3069 isearch-lazy-highlight-forward isearch-forward) 3080 isearch-lazy-highlight-forward isearch-forward)
3070 (unless (equal isearch-string "") 3081 (unless (equal isearch-string "")
3071 (setq isearch-lazy-highlight-timer 3082 (setq isearch-lazy-highlight-timer
@@ -3078,7 +3089,7 @@ Attempt to do the search exactly the way the pending Isearch would."
3078 (condition-case nil 3089 (condition-case nil
3079 (let ((case-fold-search isearch-lazy-highlight-case-fold-search) 3090 (let ((case-fold-search isearch-lazy-highlight-case-fold-search)
3080 (isearch-regexp isearch-lazy-highlight-regexp) 3091 (isearch-regexp isearch-lazy-highlight-regexp)
3081 (isearch-word isearch-lazy-highlight-word) 3092 (isearch-regexp-function isearch-lazy-highlight-regexp-function)
3082 (isearch-lax-whitespace 3093 (isearch-lax-whitespace
3083 isearch-lazy-highlight-lax-whitespace) 3094 isearch-lazy-highlight-lax-whitespace)
3084 (isearch-regexp-lax-whitespace 3095 (isearch-regexp-lax-whitespace
diff --git a/lisp/obsolete/longlines.el b/lisp/obsolete/longlines.el
index 7cb13ce600f..bfde826aa93 100644
--- a/lisp/obsolete/longlines.el
+++ b/lisp/obsolete/longlines.el
@@ -464,7 +464,7 @@ This is called by `window-configuration-change-hook'."
464 464
465(defun longlines-search-function () 465(defun longlines-search-function ()
466 (cond 466 (cond
467 ((or isearch-word isearch-regexp) (isearch-search-fun-default)) 467 ((or isearch-regexp-function isearch-regexp) (isearch-search-fun-default))
468 (isearch-forward #'longlines-search-forward) 468 (isearch-forward #'longlines-search-forward)
469 (t #'longlines-search-backward))) 469 (t #'longlines-search-backward)))
470 470
diff --git a/lisp/replace.el b/lisp/replace.el
index 3a908ac4d8d..d6590c5516a 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -2013,7 +2013,7 @@ It is called with three arguments, as if it were
2013 ;; outside of this function because then another I-search 2013 ;; outside of this function because then another I-search
2014 ;; used after `recursive-edit' might override them. 2014 ;; used after `recursive-edit' might override them.
2015 (let* ((isearch-regexp regexp-flag) 2015 (let* ((isearch-regexp regexp-flag)
2016 (isearch-word (or delimited-flag 2016 (isearch-regexp-function (or delimited-flag
2017 (and replace-character-fold 2017 (and replace-character-fold
2018 (not regexp-flag) 2018 (not regexp-flag)
2019 #'character-fold-to-regexp))) 2019 #'character-fold-to-regexp)))
@@ -2046,7 +2046,7 @@ It is called with three arguments, as if it were
2046 (if query-replace-lazy-highlight 2046 (if query-replace-lazy-highlight
2047 (let ((isearch-string search-string) 2047 (let ((isearch-string search-string)
2048 (isearch-regexp regexp-flag) 2048 (isearch-regexp regexp-flag)
2049 (isearch-word delimited-flag) 2049 (isearch-regexp-function delimited-flag)
2050 (isearch-lax-whitespace 2050 (isearch-lax-whitespace
2051 replace-lax-whitespace) 2051 replace-lax-whitespace)
2052 (isearch-regexp-lax-whitespace 2052 (isearch-regexp-lax-whitespace