From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#25562: 25.1; isearch-forward-word first matches a non-word Date: Thu, 02 Feb 2017 02:51:08 +0200 Organization: LINKOV.NET Message-ID: <87zii52y8j.fsf@mail.linkov.net> References: <87r33njun7.fsf@inria.fr> <87mvea3feg.fsf@mail.linkov.net> <87h94fp3z8.fsf@drachen> <877f5avj7r.fsf@mail.linkov.net> <87tw8dztn5.fsf@drachen> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1485999075 11299 195.159.176.226 (2 Feb 2017 01:31:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 2 Feb 2017 01:31:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu) Cc: 25562@debbugs.gnu.org, Antoine Levitt To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 02 02:31:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZ6Ex-0002nk-Dk for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Feb 2017 02:31:11 +0100 Original-Received: from localhost ([::1]:53791 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZ6F2-0003kC-Uu for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Feb 2017 20:31:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZ6Ew-0003k7-Cb for bug-gnu-emacs@gnu.org; Wed, 01 Feb 2017 20:31:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZ6Eo-0002WG-V7 for bug-gnu-emacs@gnu.org; Wed, 01 Feb 2017 20:31:10 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55528) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cZ6Eo-0002W3-S8 for bug-gnu-emacs@gnu.org; Wed, 01 Feb 2017 20:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cZ6En-00032V-Qk for bug-gnu-emacs@gnu.org; Wed, 01 Feb 2017 20:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Feb 2017 01:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25562 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25562-submit@debbugs.gnu.org id=B25562.148599900811619 (code B ref 25562); Thu, 02 Feb 2017 01:31:01 +0000 Original-Received: (at 25562) by debbugs.gnu.org; 2 Feb 2017 01:30:08 +0000 Original-Received: from localhost ([127.0.0.1]:53727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZ6Dv-00031K-N8 for submit@debbugs.gnu.org; Wed, 01 Feb 2017 20:30:08 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:51169 helo=homiemail-a11.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZ6Dt-00030O-Vi for 25562@debbugs.gnu.org; Wed, 01 Feb 2017 20:30:06 -0500 Original-Received: from homiemail-a11.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a11.g.dreamhost.com (Postfix) with ESMTP id 80585314C06D; Wed, 1 Feb 2017 17:30:02 -0800 (PST) Original-Received: from localhost.linkov.net (m91-131-77-171.cust.tele2.ee [91.131.77.171]) (Authenticated sender: jurta@jurta.org) by homiemail-a11.g.dreamhost.com (Postfix) with ESMTPA id 6A6D1314C069; Wed, 1 Feb 2017 17:30:01 -0800 (PST) In-Reply-To: <87tw8dztn5.fsf@drachen> (Michael Heerdegen's message of "Wed, 01 Feb 2017 18:51:42 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:128879 Archived-At: > I tried it. Works as I would expect in *scratch* and dired, but hmm, > not in Info (the prompt just doesn't contain "pending" there). I tried > with emacs -Q, and in any buffer I started a word search and just began > typing characters. Thanks for discovering the problem in Info, it will be fixed by the next = patch. It seems to work while I used it to search for the mentions of the word =E2=80=9Cpending=E2=80=9D in the Emacs manual - there is no one, so we co= uld document it in (info "(emacs) Word Search") with the second patch below. > BTW, a different question: when I delete characters from my input (with > backspace) in a word search and then add some new characters, I somehow > expected that isearch would return to that "pending" state. But I got > the jumpy (nonlax) incremental search behavior instead. I don't have a= n > opinion about that, just wanted to mention it. =E2=80=9CPending=E2=80=9D is not displayed in the prompt while deleting w= ith backspace since this state in not stored in isearch-cmds. But I see no problem because =E2=80=9Cpending=E2=80=9D appears again when you continue typing = new characters. diff --git a/lisp/info.el b/lisp/info.el index e32b6b3..3eb2021 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -2107,11 +2107,10 @@ (defun Info-isearch-search () (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)))))))) - (if (functionp isearch-regexp-function) + (let ((lax (isearch--lax-regexp-function-p string))) + (when lax + (setq isearch-adjusted t)) + (if (functionp isearch-regexp-function) (funcall isearch-regexp-function string lax) (word-search-regexp string lax)))) (isearch-regexp string) diff --git a/lisp/isearch.el b/lisp/isearch.el index 5c48c30..856738e 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2718,11 +2718,11 @@ (defun isearch-search-fun () Can be changed via `isearch-search-fun-function' for special needs." (funcall (or isearch-search-fun-function 'isearch-search-fun-default))= ) =20 -(defun isearch--lax-regexp-function-p () +(defun isearch--lax-regexp-function-p (&optional string) "Non-nil if next regexp-function call should be lax." (not (or isearch-nonincremental (null (car isearch-cmds)) - (eq (length isearch-string) + (eq (length (or string isearch-string)) (length (isearch--state-string (car isearch-cmds))))))) =20 @@ -2741,6 +2741,8 @@ (defun isearch-search-fun-default () (if isearch-forward #'re-search-forward #'re-search-backward) (cond (isearch-regexp-function (let ((lax (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)))) diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index b728258..1296b3b 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -609,6 +609,8 @@ Word Search 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}. =20 The word search commands don't perform character folding, and toggling lax whitespace matching (@pxref{Lax Search, lax space