diff options
| author | Juri Linkov | 2017-02-10 00:35:22 +0200 |
|---|---|---|
| committer | Juri Linkov | 2017-02-10 00:35:22 +0200 |
| commit | d825d1f28decd671feb71c7657d41d0502ab5cf5 (patch) | |
| tree | 7c1d3a817ae31d132074b617dd31eec671f5a97e | |
| parent | 35b9b7e751fdd8092048cb688e2f043f70912670 (diff) | |
| download | emacs-d825d1f28decd671feb71c7657d41d0502ab5cf5.tar.gz emacs-d825d1f28decd671feb71c7657d41d0502ab5cf5.zip | |
* lisp/isearch.el (isearch-search-fun-default): Set isearch-adjusted
to t to display "Pending" in the search prompt for lax
word/symbol search (bug#25562). Don't use lax for lazy-highlighting
when 'bound' is non-nil.
(word-search-regexp, isearch-symbol-regexp): Don't depend on lax
at the beginning of regexp (bug#22589).
* lisp/info.el (Info-isearch-search):
Use isearch--lax-regexp-function-p.
* doc/emacs/search.texi (Word Search, Symbol Search):
Mention "Pending" prompt for lax word/symbol search.
| -rw-r--r-- | doc/emacs/search.texi | 8 | ||||
| -rw-r--r-- | lisp/info.el | 7 | ||||
| -rw-r--r-- | lisp/isearch.el | 8 |
3 files changed, 14 insertions, 9 deletions
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index fa69ba48f6a..77baae2a8f7 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi | |||
| @@ -609,6 +609,8 @@ string, its first and last words need not match whole words. This is | |||
| 609 | so that the matching can proceed incrementally as you type. This | 609 | so that the matching can proceed incrementally as you type. This |
| 610 | additional laxity does not apply to the lazy highlight | 610 | additional laxity does not apply to the lazy highlight |
| 611 | (@pxref{Incremental Search}), which always matches whole words. | 611 | (@pxref{Incremental Search}), which always matches whole words. |
| 612 | While you are typing the search string, @samp{Pending} appears in the | ||
| 613 | search prompt until you use a search repeating key like @kbd{C-s}. | ||
| 612 | 614 | ||
| 613 | The word search commands don't perform character folding, and | 615 | The word search commands don't perform character folding, and |
| 614 | toggling lax whitespace matching (@pxref{Lax Search, lax space | 616 | toggling lax whitespace matching (@pxref{Lax Search, lax space |
| @@ -661,8 +663,10 @@ search is not already active, this runs the command | |||
| 661 | active, @kbd{M-s _} switches to a symbol search, preserving the | 663 | active, @kbd{M-s _} switches to a symbol search, preserving the |
| 662 | direction of the search and the current search string; you can disable | 664 | direction of the search and the current search string; you can disable |
| 663 | symbol search by typing @kbd{M-s _} again. In incremental symbol | 665 | symbol search by typing @kbd{M-s _} again. In incremental symbol |
| 664 | search, only the beginning of the search string is required to match | 666 | search, while you are typing the search string, only the beginning |
| 665 | the beginning of a symbol. | 667 | of the search string is required to match the beginning of a symbol, |
| 668 | and @samp{Pending} appears in the search prompt until you use a search | ||
| 669 | repeating key like @kbd{C-s}. | ||
| 666 | 670 | ||
| 667 | To begin a nonincremental symbol search, type @kbd{M-s _ @key{RET}} | 671 | To begin a nonincremental symbol search, type @kbd{M-s _ @key{RET}} |
| 668 | for a forward search, or @kbd{M-s _ C-r @key{RET}} or a backward | 672 | for a forward search, or @kbd{M-s _ C-r @key{RET}} or a backward |
diff --git a/lisp/info.el b/lisp/info.el index 0cfcec32f82..5f4ae5f0b09 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -2118,10 +2118,9 @@ If DIRECTION is `backward', search in the reverse direction." | |||
| 2118 | (cond | 2118 | (cond |
| 2119 | (isearch-regexp-function | 2119 | (isearch-regexp-function |
| 2120 | ;; Lax version of word search | 2120 | ;; Lax version of word search |
| 2121 | (let ((lax (not (or isearch-nonincremental | 2121 | (let ((lax (and (not bound) (isearch--lax-regexp-function-p)))) |
| 2122 | (eq (length string) | 2122 | (when lax |
| 2123 | (length (isearch--state-string | 2123 | (setq isearch-adjusted t)) |
| 2124 | (car isearch-cmds)))))))) | ||
| 2125 | (if (functionp isearch-regexp-function) | 2124 | (if (functionp isearch-regexp-function) |
| 2126 | (funcall isearch-regexp-function string lax) | 2125 | (funcall isearch-regexp-function string lax) |
| 2127 | (word-search-regexp string lax)))) | 2126 | (word-search-regexp string lax)))) |
diff --git a/lisp/isearch.el b/lisp/isearch.el index 5c48c30daa9..4b35f256644 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -1621,7 +1621,7 @@ Used in `word-search-forward', `word-search-backward', | |||
| 1621 | ((string-match-p "\\`\\W+\\'" string) "\\W+") | 1621 | ((string-match-p "\\`\\W+\\'" string) "\\W+") |
| 1622 | (t (concat | 1622 | (t (concat |
| 1623 | (if (string-match-p "\\`\\W" string) "\\W+" | 1623 | (if (string-match-p "\\`\\W" string) "\\W+" |
| 1624 | (unless lax "\\<")) | 1624 | "\\<") |
| 1625 | (mapconcat 'regexp-quote (split-string string "\\W+" t) "\\W+") | 1625 | (mapconcat 'regexp-quote (split-string string "\\W+" t) "\\W+") |
| 1626 | (if (string-match-p "\\W\\'" string) "\\W+" | 1626 | (if (string-match-p "\\W\\'" string) "\\W+" |
| 1627 | (unless lax "\\>")))))) | 1627 | (unless lax "\\>")))))) |
| @@ -1749,7 +1749,7 @@ the beginning or the end of the string need not match a symbol boundary." | |||
| 1749 | ((string-match-p (format "\\`%s\\'" not-word-symbol-re) string) not-word-symbol-re) | 1749 | ((string-match-p (format "\\`%s\\'" not-word-symbol-re) string) not-word-symbol-re) |
| 1750 | (t (concat | 1750 | (t (concat |
| 1751 | (if (string-match-p (format "\\`%s" not-word-symbol-re) string) not-word-symbol-re | 1751 | (if (string-match-p (format "\\`%s" not-word-symbol-re) string) not-word-symbol-re |
| 1752 | (unless lax "\\_<")) | 1752 | "\\_<") |
| 1753 | (mapconcat 'regexp-quote (split-string string not-word-symbol-re t) not-word-symbol-re) | 1753 | (mapconcat 'regexp-quote (split-string string not-word-symbol-re t) not-word-symbol-re) |
| 1754 | (if (string-match-p (format "%s\\'" not-word-symbol-re) string) not-word-symbol-re | 1754 | (if (string-match-p (format "%s\\'" not-word-symbol-re) string) not-word-symbol-re |
| 1755 | (unless lax "\\_>"))))))) | 1755 | (unless lax "\\_>"))))))) |
| @@ -2740,7 +2740,9 @@ Can be changed via `isearch-search-fun-function' for special needs." | |||
| 2740 | (funcall | 2740 | (funcall |
| 2741 | (if isearch-forward #'re-search-forward #'re-search-backward) | 2741 | (if isearch-forward #'re-search-forward #'re-search-backward) |
| 2742 | (cond (isearch-regexp-function | 2742 | (cond (isearch-regexp-function |
| 2743 | (let ((lax (isearch--lax-regexp-function-p))) | 2743 | (let ((lax (and (not bound) (isearch--lax-regexp-function-p)))) |
| 2744 | (when lax | ||
| 2745 | (setq isearch-adjusted t)) | ||
| 2744 | (if (functionp isearch-regexp-function) | 2746 | (if (functionp isearch-regexp-function) |
| 2745 | (funcall isearch-regexp-function string lax) | 2747 | (funcall isearch-regexp-function string lax) |
| 2746 | (word-search-regexp string lax)))) | 2748 | (word-search-regexp string lax)))) |