GNU bug report logs - #22589
25.0.90; First match found by isearch-forward-symbol is not necessarily a symbol.

Previous Next

Package: emacs;

Reported by: Bastian Beischer <bastian.beischer <at> gmail.com>

Date: Sun, 7 Feb 2016 22:42:01 UTC

Severity: minor

Merged with 25562

Found in versions 25.0.90, 25.1

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Bastian Beischer <bastian.beischer <at> gmail.com>
Cc: 22589 <at> debbugs.gnu.org
Subject: bug#22589: 25.0.90; First match found by isearch-forward-symbol is not necessarily a symbol.
Date: Mon, 06 Feb 2017 01:39:13 +0200
> Then it will match at the beginning of the symbol for a forward search,
> and at the end for a backward search.  Same for the word search.

In bug#25562 we found no more ideas how to improve the support for
the process of entering incomplete words, so in addition to the patch
in bug#25562 that adds indication, also I'm going to install this patch
that will optimize the incomplete search by removing conditional
matching at the beginning:

diff --git a/lisp/isearch.el b/lisp/isearch.el
index 5c48c30..90ffbec 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1621,7 +1621,7 @@ (defun word-search-regexp (string &optional lax)
    ((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 @@ (defun isearch-symbol-regexp (string &optional lax)
      ((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 "\\_>")))))))





This bug report was last modified 8 years and 99 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.