mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-17 19:30:38 -08:00
* 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.
This commit is contained in:
parent
f6ece2420c
commit
ab65b33f8c
6 changed files with 77 additions and 66 deletions
|
|
@ -813,7 +813,7 @@ Use a senator search function when semantic isearch mode is enabled."
|
||||||
(concat (if senator-isearch-semantic-mode
|
(concat (if senator-isearch-semantic-mode
|
||||||
"senator-"
|
"senator-"
|
||||||
"")
|
"")
|
||||||
(cond (isearch-word "word-")
|
(cond (isearch-regexp-function "word-")
|
||||||
(isearch-regexp "re-")
|
(isearch-regexp "re-")
|
||||||
(t ""))
|
(t ""))
|
||||||
"search-"
|
"search-"
|
||||||
|
|
|
||||||
|
|
@ -406,7 +406,7 @@ You can use \\[hexl-find-file] to visit a file in Hexl mode.
|
||||||
|
|
||||||
|
|
||||||
(defun hexl-isearch-search-function ()
|
(defun hexl-isearch-search-function ()
|
||||||
(if (and (not isearch-regexp) (not isearch-word))
|
(if (and (not isearch-regexp) (not isearch-regexp-function))
|
||||||
(lambda (string &optional bound noerror count)
|
(lambda (string &optional bound noerror count)
|
||||||
(funcall
|
(funcall
|
||||||
(if isearch-forward 're-search-forward 're-search-backward)
|
(if isearch-forward 're-search-forward 're-search-backward)
|
||||||
|
|
|
||||||
|
|
@ -2114,14 +2114,14 @@ If DIRECTION is `backward', search in the reverse direction."
|
||||||
search-whitespace-regexp)))
|
search-whitespace-regexp)))
|
||||||
(Info-search
|
(Info-search
|
||||||
(cond
|
(cond
|
||||||
(isearch-word
|
(isearch-regexp-function
|
||||||
;; Lax version of word search
|
;; Lax version of word search
|
||||||
(let ((lax (not (or isearch-nonincremental
|
(let ((lax (not (or isearch-nonincremental
|
||||||
(eq (length string)
|
(eq (length string)
|
||||||
(length (isearch--state-string
|
(length (isearch--state-string
|
||||||
(car isearch-cmds))))))))
|
(car isearch-cmds))))))))
|
||||||
(if (functionp isearch-word)
|
(if (functionp isearch-regexp-function)
|
||||||
(funcall isearch-word string lax)
|
(funcall isearch-regexp-function string lax)
|
||||||
(word-search-regexp string lax))))
|
(word-search-regexp string lax))))
|
||||||
(isearch-regexp string)
|
(isearch-regexp string)
|
||||||
(t (regexp-quote string)))
|
(t (regexp-quote string)))
|
||||||
|
|
|
||||||
127
lisp/isearch.el
127
lisp/isearch.el
|
|
@ -551,13 +551,16 @@ This is like `describe-bindings', but displays only Isearch keys."
|
||||||
|
|
||||||
(defvar isearch-forward nil) ; Searching in the forward direction.
|
(defvar isearch-forward nil) ; Searching in the forward direction.
|
||||||
(defvar isearch-regexp nil) ; Searching for a regexp.
|
(defvar isearch-regexp nil) ; Searching for a regexp.
|
||||||
(defvar isearch-word nil
|
(defvar isearch-regexp-function nil
|
||||||
"Regexp-based search mode for words/symbols.
|
"Regexp-based search mode for words/symbols.
|
||||||
If t, do incremental search for a sequence of words, ignoring punctuation.
|
If the value is a function (e.g. `isearch-symbol-regexp'), it is
|
||||||
If the value is a function (e.g. `isearch-symbol-regexp'), it is called to
|
called to convert a plain search string to a regexp used by
|
||||||
convert the search string to a regexp used by regexp search functions.
|
regexp search functions.
|
||||||
The property `isearch-message-prefix' put on this function specifies the
|
The symbol property `isearch-message-prefix' put on this function
|
||||||
prefix string displayed in the search message.")
|
specifies the prefix string displayed in the search message.")
|
||||||
|
;; We still support setting this to t for backwards compatibility.
|
||||||
|
(define-obsolete-variable-alias 'isearch-word
|
||||||
|
'isearch-regexp-function "25.1")
|
||||||
|
|
||||||
(defvar isearch-lax-whitespace t
|
(defvar isearch-lax-whitespace t
|
||||||
"If non-nil, a space will match a sequence of whitespace chars.
|
"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."
|
||||||
(put 'character-fold-to-regexp 'isearch-message-prefix "char-fold ")
|
(put 'character-fold-to-regexp 'isearch-message-prefix "char-fold ")
|
||||||
(defvar character-fold-search)
|
(defvar character-fold-search)
|
||||||
|
|
||||||
(defun isearch-mode (forward &optional regexp op-fun recursive-edit word)
|
(defun isearch-mode (forward &optional regexp op-fun recursive-edit regexp-function)
|
||||||
"Start Isearch minor mode.
|
"Start Isearch minor mode.
|
||||||
It is called by the function `isearch-forward' and other related functions.
|
It is called by the function `isearch-forward' and other related functions.
|
||||||
|
|
||||||
|
|
@ -856,16 +859,16 @@ does not return to the calling function until the search is completed.
|
||||||
To behave this way it enters a recursive-edit and exits it when done
|
To behave this way it enters a recursive-edit and exits it when done
|
||||||
isearching.
|
isearching.
|
||||||
|
|
||||||
The arg WORD, if t, does incremental search for a sequence of words,
|
The arg REGEXP-FUNCTION, if non-nil, should be a function. It is
|
||||||
ignoring punctuation. If the value is a function, it is called to
|
used to set the value of `isearch-regexp-function'."
|
||||||
convert the search string to a regexp used by regexp search functions."
|
|
||||||
|
|
||||||
;; Initialize global vars.
|
;; Initialize global vars.
|
||||||
(setq isearch-forward forward
|
(setq isearch-forward forward
|
||||||
isearch-regexp regexp
|
isearch-regexp regexp
|
||||||
isearch-word (or word (and character-fold-search
|
isearch-regexp-function (or regexp-function
|
||||||
(not regexp)
|
(and character-fold-search
|
||||||
'character-fold-to-regexp))
|
(not regexp)
|
||||||
|
'character-fold-to-regexp))
|
||||||
isearch-op-fun op-fun
|
isearch-op-fun op-fun
|
||||||
isearch-last-case-fold-search isearch-case-fold-search
|
isearch-last-case-fold-search isearch-case-fold-search
|
||||||
isearch-case-fold-search case-fold-search
|
isearch-case-fold-search case-fold-search
|
||||||
|
|
@ -1029,7 +1032,7 @@ NOPUSH is t and EDIT is t."
|
||||||
|
|
||||||
(if isearch-resume-in-command-history
|
(if isearch-resume-in-command-history
|
||||||
(let ((command `(isearch-resume ,isearch-string ,isearch-regexp
|
(let ((command `(isearch-resume ,isearch-string ,isearch-regexp
|
||||||
,isearch-word ,isearch-forward
|
,isearch-regexp-function ,isearch-forward
|
||||||
,isearch-message
|
,isearch-message
|
||||||
',isearch-case-fold-search)))
|
',isearch-case-fold-search)))
|
||||||
(unless (equal (car command-history) command)
|
(unless (equal (car command-history) command)
|
||||||
|
|
@ -1131,7 +1134,7 @@ REGEXP if non-nil says use the regexp search ring."
|
||||||
(success isearch-success)
|
(success isearch-success)
|
||||||
(forward isearch-forward)
|
(forward isearch-forward)
|
||||||
(other-end isearch-other-end)
|
(other-end isearch-other-end)
|
||||||
(word isearch-word)
|
(word isearch-regexp-function)
|
||||||
(error isearch-error)
|
(error isearch-error)
|
||||||
(wrapped isearch-wrapped)
|
(wrapped isearch-wrapped)
|
||||||
(barrier isearch-barrier)
|
(barrier isearch-barrier)
|
||||||
|
|
@ -1157,7 +1160,7 @@ REGEXP if non-nil says use the regexp search ring."
|
||||||
isearch-success (isearch--state-success cmd)
|
isearch-success (isearch--state-success cmd)
|
||||||
isearch-forward (isearch--state-forward cmd)
|
isearch-forward (isearch--state-forward cmd)
|
||||||
isearch-other-end (isearch--state-other-end cmd)
|
isearch-other-end (isearch--state-other-end cmd)
|
||||||
isearch-word (isearch--state-word cmd)
|
isearch-regexp-function (isearch--state-word cmd)
|
||||||
isearch-error (isearch--state-error cmd)
|
isearch-error (isearch--state-error cmd)
|
||||||
isearch-wrapped (isearch--state-wrapped cmd)
|
isearch-wrapped (isearch--state-wrapped cmd)
|
||||||
isearch-barrier (isearch--state-barrier cmd)
|
isearch-barrier (isearch--state-barrier cmd)
|
||||||
|
|
@ -1213,7 +1216,7 @@ If MSG is non-nil, use variable `isearch-message', otherwise `isearch-string'."
|
||||||
"Exit Isearch mode, run BODY, and reinvoke the pending search.
|
"Exit Isearch mode, run BODY, and reinvoke the pending search.
|
||||||
You can update the global isearch variables by setting new values to
|
You can update the global isearch variables by setting new values to
|
||||||
`isearch-new-string', `isearch-new-message', `isearch-new-forward',
|
`isearch-new-string', `isearch-new-message', `isearch-new-forward',
|
||||||
`isearch-new-word', `isearch-new-case-fold'."
|
`isearch-new-regexp-function', `isearch-new-case-fold'."
|
||||||
;; This code is very hairy for several reasons, explained in the code.
|
;; This code is very hairy for several reasons, explained in the code.
|
||||||
;; Mainly, isearch-mode must be terminated while editing and then restarted.
|
;; Mainly, isearch-mode must be terminated while editing and then restarted.
|
||||||
;; If there were a way to catch any change of buffer from the minibuffer,
|
;; 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
|
||||||
(isearch-new-string isearch-string)
|
(isearch-new-string isearch-string)
|
||||||
(isearch-new-message isearch-message)
|
(isearch-new-message isearch-message)
|
||||||
(isearch-new-forward isearch-forward)
|
(isearch-new-forward isearch-forward)
|
||||||
(isearch-new-word isearch-word)
|
(isearch-new-regexp-function isearch-regexp-function)
|
||||||
(isearch-new-case-fold isearch-case-fold-search)
|
(isearch-new-case-fold isearch-case-fold-search)
|
||||||
|
|
||||||
(isearch-regexp isearch-regexp)
|
(isearch-regexp isearch-regexp)
|
||||||
|
|
@ -1296,13 +1299,13 @@ You can update the global isearch variables by setting new values to
|
||||||
isearch-regexp
|
isearch-regexp
|
||||||
isearch-op-fun
|
isearch-op-fun
|
||||||
nil
|
nil
|
||||||
isearch-word)
|
isearch-regexp-function)
|
||||||
|
|
||||||
;; Copy new local values to isearch globals
|
;; Copy new local values to isearch globals
|
||||||
(setq isearch-string isearch-new-string
|
(setq isearch-string isearch-new-string
|
||||||
isearch-message isearch-new-message
|
isearch-message isearch-new-message
|
||||||
isearch-forward isearch-new-forward
|
isearch-forward isearch-new-forward
|
||||||
isearch-word isearch-new-word
|
isearch-regexp-function isearch-new-regexp-function
|
||||||
isearch-case-fold-search isearch-new-case-fold))
|
isearch-case-fold-search isearch-new-case-fold))
|
||||||
|
|
||||||
;; Empty isearch-string means use default.
|
;; Empty isearch-string means use default.
|
||||||
|
|
@ -1493,7 +1496,7 @@ Use `isearch-exit' to quit without signaling."
|
||||||
;; The status stack is left unchanged.
|
;; The status stack is left unchanged.
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq isearch-regexp (not isearch-regexp))
|
(setq isearch-regexp (not isearch-regexp))
|
||||||
(if isearch-regexp (setq isearch-word nil))
|
(if isearch-regexp (setq isearch-regexp-function nil))
|
||||||
(setq isearch-success t isearch-adjusted t)
|
(setq isearch-success t isearch-adjusted t)
|
||||||
(isearch-update))
|
(isearch-update))
|
||||||
|
|
||||||
|
|
@ -1501,26 +1504,30 @@ Use `isearch-exit' to quit without signaling."
|
||||||
"Toggle word searching on or off."
|
"Toggle word searching on or off."
|
||||||
;; The status stack is left unchanged.
|
;; The status stack is left unchanged.
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq isearch-word (if (eq isearch-word t) nil t))
|
(setq isearch-regexp-function
|
||||||
(if isearch-word (setq isearch-regexp nil))
|
(if (memq isearch-regexp-function '(t word-search-regexp))
|
||||||
|
nil #'word-search-regexp))
|
||||||
|
(when isearch-regexp-function (setq isearch-regexp nil))
|
||||||
(setq isearch-success t isearch-adjusted t)
|
(setq isearch-success t isearch-adjusted t)
|
||||||
(isearch-update))
|
(isearch-update))
|
||||||
|
|
||||||
(defun isearch-toggle-symbol ()
|
(defun isearch-toggle-symbol ()
|
||||||
"Toggle symbol searching on or off."
|
"Toggle symbol searching on or off."
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq isearch-word (unless (eq isearch-word 'isearch-symbol-regexp)
|
(setq isearch-regexp-function
|
||||||
'isearch-symbol-regexp))
|
(unless (eq isearch-regexp-function #'isearch-symbol-regexp)
|
||||||
(if isearch-word (setq isearch-regexp nil))
|
'isearch-symbol-regexp))
|
||||||
|
(when isearch-regexp-function (setq isearch-regexp nil))
|
||||||
(setq isearch-success t isearch-adjusted t)
|
(setq isearch-success t isearch-adjusted t)
|
||||||
(isearch-update))
|
(isearch-update))
|
||||||
|
|
||||||
(defun isearch-toggle-character-fold ()
|
(defun isearch-toggle-character-fold ()
|
||||||
"Toggle character folding in searching on or off."
|
"Toggle character folding in searching on or off."
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq isearch-word (unless (eq isearch-word #'character-fold-to-regexp)
|
(setq isearch-regexp-function
|
||||||
#'character-fold-to-regexp))
|
(unless (eq isearch-regexp-function #'character-fold-to-regexp)
|
||||||
(if isearch-word (setq isearch-regexp nil))
|
#'character-fold-to-regexp))
|
||||||
|
(when isearch-regexp-function (setq isearch-regexp nil))
|
||||||
(setq isearch-success t isearch-adjusted t)
|
(setq isearch-success t isearch-adjusted t)
|
||||||
(isearch-update))
|
(isearch-update))
|
||||||
|
|
||||||
|
|
@ -1767,12 +1774,12 @@ replacements from Isearch is `M-s w ... M-%'."
|
||||||
(query-replace-read-to
|
(query-replace-read-to
|
||||||
isearch-string
|
isearch-string
|
||||||
(concat "Query replace"
|
(concat "Query replace"
|
||||||
(isearch--describe-word-mode (or delimited isearch-word) t)
|
(isearch--describe-regexp-mode (or delimited isearch-regexp-function) t)
|
||||||
(if isearch-regexp " regexp" "")
|
(if isearch-regexp " regexp" "")
|
||||||
(if backward " backward" "")
|
(if backward " backward" "")
|
||||||
(if (and transient-mark-mode mark-active) " in region" ""))
|
(if (and transient-mark-mode mark-active) " in region" ""))
|
||||||
isearch-regexp)
|
isearch-regexp)
|
||||||
t isearch-regexp (or delimited isearch-word) nil nil
|
t isearch-regexp (or delimited isearch-regexp-function) nil nil
|
||||||
(if (and transient-mark-mode mark-active) (region-beginning))
|
(if (and transient-mark-mode mark-active) (region-beginning))
|
||||||
(if (and transient-mark-mode mark-active) (region-end))
|
(if (and transient-mark-mode mark-active) (region-end))
|
||||||
backward))
|
backward))
|
||||||
|
|
@ -1799,9 +1806,9 @@ characters in that string."
|
||||||
(interactive
|
(interactive
|
||||||
(let* ((perform-collect (consp current-prefix-arg))
|
(let* ((perform-collect (consp current-prefix-arg))
|
||||||
(regexp (cond
|
(regexp (cond
|
||||||
((functionp isearch-word)
|
((functionp isearch-regexp-function)
|
||||||
(funcall isearch-word isearch-string))
|
(funcall isearch-regexp-function isearch-string))
|
||||||
(isearch-word (word-search-regexp isearch-string))
|
(isearch-regexp-function (word-search-regexp isearch-string))
|
||||||
(isearch-regexp isearch-string)
|
(isearch-regexp isearch-string)
|
||||||
(t (regexp-quote isearch-string)))))
|
(t (regexp-quote isearch-string)))))
|
||||||
(list regexp
|
(list regexp
|
||||||
|
|
@ -1850,9 +1857,9 @@ and reads its face argument using `hi-lock-read-face-name'."
|
||||||
(isearch-done nil t)
|
(isearch-done nil t)
|
||||||
(isearch-clean-overlays))
|
(isearch-clean-overlays))
|
||||||
(require 'hi-lock nil t)
|
(require 'hi-lock nil t)
|
||||||
(let ((regexp (cond ((functionp isearch-word)
|
(let ((regexp (cond ((functionp isearch-regexp-function)
|
||||||
(funcall isearch-word isearch-string))
|
(funcall isearch-regexp-function isearch-string))
|
||||||
(isearch-word (word-search-regexp isearch-string))
|
(isearch-regexp-function (word-search-regexp isearch-string))
|
||||||
(isearch-regexp isearch-string)
|
(isearch-regexp isearch-string)
|
||||||
((if (and (eq isearch-case-fold-search t)
|
((if (and (eq isearch-case-fold-search t)
|
||||||
search-upper-case)
|
search-upper-case)
|
||||||
|
|
@ -2057,9 +2064,9 @@ With argument, add COUNT copies of the character."
|
||||||
(setq case-fold-search
|
(setq case-fold-search
|
||||||
(isearch-no-upper-case-p isearch-string isearch-regexp)))
|
(isearch-no-upper-case-p isearch-string isearch-regexp)))
|
||||||
(looking-at (cond
|
(looking-at (cond
|
||||||
((functionp isearch-word)
|
((functionp isearch-regexp-function)
|
||||||
(funcall isearch-word isearch-string t))
|
(funcall isearch-regexp-function isearch-string t))
|
||||||
(isearch-word (word-search-regexp isearch-string t))
|
(isearch-regexp-function (word-search-regexp isearch-string t))
|
||||||
(isearch-regexp isearch-string)
|
(isearch-regexp isearch-string)
|
||||||
(t (regexp-quote isearch-string)))))
|
(t (regexp-quote isearch-string)))))
|
||||||
(error nil))
|
(error nil))
|
||||||
|
|
@ -2514,20 +2521,22 @@ If there is no completion possible, say so and continue searching."
|
||||||
(isearch-message-suffix c-q-hack)))
|
(isearch-message-suffix c-q-hack)))
|
||||||
(if c-q-hack m (let ((message-log-max nil)) (message "%s" m)))))
|
(if c-q-hack m (let ((message-log-max nil)) (message "%s" m)))))
|
||||||
|
|
||||||
(defun isearch--describe-word-mode (word-mode &optional space-before)
|
(defun isearch--describe-regexp-mode (regexp-function &optional space-before)
|
||||||
"Make a string for describing WORD-MODE.
|
"Make a string for describing REGEXP-FUNCTION.
|
||||||
If SPACE-BEFORE is non-nil, put a space before, instead of after,
|
If SPACE-BEFORE is non-nil, put a space before, instead of after,
|
||||||
the word mode."
|
the word mode."
|
||||||
(let ((description
|
(let ((description
|
||||||
(cond ((and (symbolp word-mode)
|
(cond ((and (symbolp regexp-function)
|
||||||
(get word-mode 'isearch-message-prefix))
|
(get regexp-function 'isearch-message-prefix))
|
||||||
(get word-mode 'isearch-message-prefix))
|
(get regexp-function 'isearch-message-prefix))
|
||||||
(word-mode "word ")
|
(regexp-function "word ")
|
||||||
(t ""))))
|
(t ""))))
|
||||||
(if space-before
|
(if space-before
|
||||||
;; Move space from the end to the beginning.
|
;; Move space from the end to the beginning.
|
||||||
(replace-regexp-in-string "\\(.*\\) \\'" " \\1" description)
|
(replace-regexp-in-string "\\(.*\\) \\'" " \\1" description)
|
||||||
description)))
|
description)))
|
||||||
|
(define-obsolete-function-alias 'isearch--describe-word-mode
|
||||||
|
'isearch--describe-regexp-mode "25.1")
|
||||||
|
|
||||||
(defun isearch-message-prefix (&optional ellipsis nonincremental)
|
(defun isearch-message-prefix (&optional ellipsis nonincremental)
|
||||||
;; If about to search, and previous search regexp was invalid,
|
;; If about to search, and previous search regexp was invalid,
|
||||||
|
|
@ -2556,7 +2565,7 @@ the word mode."
|
||||||
(if np (setq prefix (concat np prefix)))))
|
(if np (setq prefix (concat np prefix)))))
|
||||||
isearch-filter-predicate)
|
isearch-filter-predicate)
|
||||||
prefix)
|
prefix)
|
||||||
(isearch--describe-word-mode isearch-word)
|
(isearch--describe-regexp-mode isearch-regexp-function)
|
||||||
(if isearch-regexp "regexp " "")
|
(if isearch-regexp "regexp " "")
|
||||||
(cond
|
(cond
|
||||||
(multi-isearch-file-list "multi-file ")
|
(multi-isearch-file-list "multi-file ")
|
||||||
|
|
@ -2603,7 +2612,7 @@ Can be changed via `isearch-search-fun-function' for special needs."
|
||||||
(defun isearch-search-fun-default ()
|
(defun isearch-search-fun-default ()
|
||||||
"Return default functions to use for the search."
|
"Return default functions to use for the search."
|
||||||
(cond
|
(cond
|
||||||
(isearch-word
|
(isearch-regexp-function
|
||||||
(lambda (string &optional bound noerror count)
|
(lambda (string &optional bound noerror count)
|
||||||
;; Use lax versions to not fail at the end of the word while
|
;; Use lax versions to not fail at the end of the word while
|
||||||
;; the user adds and removes characters in the search string
|
;; 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."
|
||||||
(car isearch-cmds))))))))
|
(car isearch-cmds))))))))
|
||||||
(funcall
|
(funcall
|
||||||
(if isearch-forward #'re-search-forward #'re-search-backward)
|
(if isearch-forward #'re-search-forward #'re-search-backward)
|
||||||
(if (functionp isearch-word)
|
(if (functionp isearch-regexp-function)
|
||||||
(funcall isearch-word string lax)
|
(funcall isearch-regexp-function string lax)
|
||||||
(word-search-regexp string lax))
|
(word-search-regexp string lax))
|
||||||
bound noerror count))))
|
bound noerror count))))
|
||||||
((and isearch-regexp isearch-regexp-lax-whitespace
|
((and isearch-regexp isearch-regexp-lax-whitespace
|
||||||
|
|
@ -2721,7 +2730,7 @@ update the match data, and return point."
|
||||||
((and (not isearch-regexp)
|
((and (not isearch-regexp)
|
||||||
(string-match "\\`Regular expression too big" isearch-error))
|
(string-match "\\`Regular expression too big" isearch-error))
|
||||||
(cond
|
(cond
|
||||||
(isearch-word
|
(isearch-regexp-function
|
||||||
(setq isearch-error "Too many words"))
|
(setq isearch-error "Too many words"))
|
||||||
((and isearch-lax-whitespace search-whitespace-regexp)
|
((and isearch-lax-whitespace search-whitespace-regexp)
|
||||||
(setq isearch-error "Too many spaces for whitespace matching"))))))
|
(setq isearch-error "Too many spaces for whitespace matching"))))))
|
||||||
|
|
@ -2964,7 +2973,7 @@ since they have special meaning in a regexp."
|
||||||
;; - `isearch-string' is expected to contain the current search
|
;; - `isearch-string' is expected to contain the current search
|
||||||
;; string as entered by the user;
|
;; string as entered by the user;
|
||||||
;; - the type of the current search is expected to be given by
|
;; - the type of the current search is expected to be given by
|
||||||
;; `isearch-word' and `isearch-regexp';
|
;; `isearch-regexp-function' and `isearch-regexp';
|
||||||
;; - the direction of the current search is expected to be given by
|
;; - the direction of the current search is expected to be given by
|
||||||
;; `isearch-forward';
|
;; `isearch-forward';
|
||||||
;; - the variable `isearch-error' is expected to be true
|
;; - the variable `isearch-error' is expected to be true
|
||||||
|
|
@ -2985,7 +2994,9 @@ since they have special meaning in a regexp."
|
||||||
(defvar isearch-lazy-highlight-regexp nil)
|
(defvar isearch-lazy-highlight-regexp nil)
|
||||||
(defvar isearch-lazy-highlight-lax-whitespace nil)
|
(defvar isearch-lazy-highlight-lax-whitespace nil)
|
||||||
(defvar isearch-lazy-highlight-regexp-lax-whitespace nil)
|
(defvar isearch-lazy-highlight-regexp-lax-whitespace nil)
|
||||||
(defvar isearch-lazy-highlight-word nil)
|
(defvar isearch-lazy-highlight-regexp-function nil)
|
||||||
|
(define-obsolete-variable-alias 'isearch-lazy-highlight-word
|
||||||
|
'isearch-lazy-highlight-regexp-function "25.1")
|
||||||
(defvar isearch-lazy-highlight-forward nil)
|
(defvar isearch-lazy-highlight-forward nil)
|
||||||
(defvar isearch-lazy-highlight-error nil)
|
(defvar isearch-lazy-highlight-error nil)
|
||||||
|
|
||||||
|
|
@ -3024,8 +3035,8 @@ by other Emacs features."
|
||||||
isearch-case-fold-search))
|
isearch-case-fold-search))
|
||||||
(not (eq isearch-lazy-highlight-regexp
|
(not (eq isearch-lazy-highlight-regexp
|
||||||
isearch-regexp))
|
isearch-regexp))
|
||||||
(not (eq isearch-lazy-highlight-word
|
(not (eq isearch-lazy-highlight-regexp-function
|
||||||
isearch-word))
|
isearch-regexp-function))
|
||||||
(not (eq isearch-lazy-highlight-lax-whitespace
|
(not (eq isearch-lazy-highlight-lax-whitespace
|
||||||
isearch-lax-whitespace))
|
isearch-lax-whitespace))
|
||||||
(not (eq isearch-lazy-highlight-regexp-lax-whitespace
|
(not (eq isearch-lazy-highlight-regexp-lax-whitespace
|
||||||
|
|
@ -3065,7 +3076,7 @@ by other Emacs features."
|
||||||
isearch-lazy-highlight-regexp isearch-regexp
|
isearch-lazy-highlight-regexp isearch-regexp
|
||||||
isearch-lazy-highlight-lax-whitespace isearch-lax-whitespace
|
isearch-lazy-highlight-lax-whitespace isearch-lax-whitespace
|
||||||
isearch-lazy-highlight-regexp-lax-whitespace isearch-regexp-lax-whitespace
|
isearch-lazy-highlight-regexp-lax-whitespace isearch-regexp-lax-whitespace
|
||||||
isearch-lazy-highlight-word isearch-word
|
isearch-lazy-highlight-regexp-function isearch-regexp-function
|
||||||
isearch-lazy-highlight-forward isearch-forward)
|
isearch-lazy-highlight-forward isearch-forward)
|
||||||
(unless (equal isearch-string "")
|
(unless (equal isearch-string "")
|
||||||
(setq isearch-lazy-highlight-timer
|
(setq isearch-lazy-highlight-timer
|
||||||
|
|
@ -3078,7 +3089,7 @@ Attempt to do the search exactly the way the pending Isearch would."
|
||||||
(condition-case nil
|
(condition-case nil
|
||||||
(let ((case-fold-search isearch-lazy-highlight-case-fold-search)
|
(let ((case-fold-search isearch-lazy-highlight-case-fold-search)
|
||||||
(isearch-regexp isearch-lazy-highlight-regexp)
|
(isearch-regexp isearch-lazy-highlight-regexp)
|
||||||
(isearch-word isearch-lazy-highlight-word)
|
(isearch-regexp-function isearch-lazy-highlight-regexp-function)
|
||||||
(isearch-lax-whitespace
|
(isearch-lax-whitespace
|
||||||
isearch-lazy-highlight-lax-whitespace)
|
isearch-lazy-highlight-lax-whitespace)
|
||||||
(isearch-regexp-lax-whitespace
|
(isearch-regexp-lax-whitespace
|
||||||
|
|
|
||||||
|
|
@ -464,7 +464,7 @@ This is called by `window-configuration-change-hook'."
|
||||||
|
|
||||||
(defun longlines-search-function ()
|
(defun longlines-search-function ()
|
||||||
(cond
|
(cond
|
||||||
((or isearch-word isearch-regexp) (isearch-search-fun-default))
|
((or isearch-regexp-function isearch-regexp) (isearch-search-fun-default))
|
||||||
(isearch-forward #'longlines-search-forward)
|
(isearch-forward #'longlines-search-forward)
|
||||||
(t #'longlines-search-backward)))
|
(t #'longlines-search-backward)))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2013,7 +2013,7 @@ It is called with three arguments, as if it were
|
||||||
;; outside of this function because then another I-search
|
;; outside of this function because then another I-search
|
||||||
;; used after `recursive-edit' might override them.
|
;; used after `recursive-edit' might override them.
|
||||||
(let* ((isearch-regexp regexp-flag)
|
(let* ((isearch-regexp regexp-flag)
|
||||||
(isearch-word (or delimited-flag
|
(isearch-regexp-function (or delimited-flag
|
||||||
(and replace-character-fold
|
(and replace-character-fold
|
||||||
(not regexp-flag)
|
(not regexp-flag)
|
||||||
#'character-fold-to-regexp)))
|
#'character-fold-to-regexp)))
|
||||||
|
|
@ -2046,7 +2046,7 @@ It is called with three arguments, as if it were
|
||||||
(if query-replace-lazy-highlight
|
(if query-replace-lazy-highlight
|
||||||
(let ((isearch-string search-string)
|
(let ((isearch-string search-string)
|
||||||
(isearch-regexp regexp-flag)
|
(isearch-regexp regexp-flag)
|
||||||
(isearch-word delimited-flag)
|
(isearch-regexp-function delimited-flag)
|
||||||
(isearch-lax-whitespace
|
(isearch-lax-whitespace
|
||||||
replace-lax-whitespace)
|
replace-lax-whitespace)
|
||||||
(isearch-regexp-lax-whitespace
|
(isearch-regexp-lax-whitespace
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue