]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/isearch.el (isearch-search-fun-default): Set isearch-adjusted
authorJuri Linkov <juri@linkov.net>
Thu, 9 Feb 2017 22:35:22 +0000 (00:35 +0200)
committerJuri Linkov <juri@linkov.net>
Thu, 9 Feb 2017 22:35:22 +0000 (00:35 +0200)
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.

doc/emacs/search.texi
lisp/info.el
lisp/isearch.el

index fa69ba48f6a8a52f6f1fa910decbcab4cb1326fc..77baae2a8f7baddb306b38e84fdb940093104cc0 100644 (file)
@@ -609,6 +609,8 @@ string, its first and last words need not match whole words.  This is
 so that the matching can proceed incrementally as you type.  This
 additional laxity does not apply to the lazy highlight
 (@pxref{Incremental Search}), which always matches whole words.
+While you are typing the search string, @samp{Pending} appears in the
+search prompt until you use a search repeating key like @kbd{C-s}.
 
   The word search commands don't perform character folding, and
 toggling lax whitespace matching (@pxref{Lax Search, lax space
@@ -661,8 +663,10 @@ search is not already active, this runs the command
 active, @kbd{M-s _} switches to a symbol search, preserving the
 direction of the search and the current search string; you can disable
 symbol search by typing @kbd{M-s _} again.  In incremental symbol
-search, only the beginning of the search string is required to match
-the beginning of a symbol.
+search, while you are typing the search string, only the beginning
+of the search string is required to match the beginning of a symbol,
+and @samp{Pending} appears in the search prompt until you use a search
+repeating key like @kbd{C-s}.
 
   To begin a nonincremental symbol search, type @kbd{M-s _ @key{RET}}
 for a forward search, or @kbd{M-s _ C-r @key{RET}} or a backward
index 0cfcec32f82c8e9583dbcfab05c30415d4db7f94..5f4ae5f0b09743c15a9eec3bf27d0959bb91d6dc 100644 (file)
@@ -2118,10 +2118,9 @@ If DIRECTION is `backward', search in the reverse direction."
           (cond
            (isearch-regexp-function
             ;; Lax version of word search
-            (let ((lax (not (or isearch-nonincremental
-                                (eq (length string)
-                                    (length (isearch--state-string
-                                             (car isearch-cmds))))))))
+            (let ((lax (and (not bound) (isearch--lax-regexp-function-p))))
+              (when lax
+                (setq isearch-adjusted t))
               (if (functionp isearch-regexp-function)
                   (funcall isearch-regexp-function string lax)
                 (word-search-regexp string lax))))
index 5c48c30daa9b307f6f247c84be5ae7087ac838f5..4b35f256644e3ab23ce074e856d6452c76aeb441 100644 (file)
@@ -1621,7 +1621,7 @@ Used in `word-search-forward', `word-search-backward',
    ((string-match-p "\\`\\W+\\'" string) "\\W+")
    (t (concat
        (if (string-match-p "\\`\\W" string) "\\W+"
-        (unless lax "\\<"))
+        "\\<")
        (mapconcat 'regexp-quote (split-string string "\\W+" t) "\\W+")
        (if (string-match-p "\\W\\'" string) "\\W+"
         (unless lax "\\>"))))))
@@ -1749,7 +1749,7 @@ the beginning or the end of the string need not match a symbol boundary."
      ((string-match-p (format "\\`%s\\'" not-word-symbol-re) string) not-word-symbol-re)
      (t (concat
         (if (string-match-p (format "\\`%s" not-word-symbol-re) string) not-word-symbol-re
-          (unless lax "\\_<"))
+          "\\_<")
         (mapconcat 'regexp-quote (split-string string not-word-symbol-re t) not-word-symbol-re)
         (if (string-match-p (format "%s\\'" not-word-symbol-re) string) not-word-symbol-re
           (unless lax "\\_>")))))))
@@ -2740,7 +2740,9 @@ Can be changed via `isearch-search-fun-function' for special needs."
           (funcall
            (if isearch-forward #'re-search-forward #'re-search-backward)
            (cond (isearch-regexp-function
-                  (let ((lax (isearch--lax-regexp-function-p)))
+                  (let ((lax (and (not bound) (isearch--lax-regexp-function-p))))
+                    (when lax
+                      (setq isearch-adjusted t))
                     (if (functionp isearch-regexp-function)
                         (funcall isearch-regexp-function string lax)
                       (word-search-regexp string lax))))