From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.devel Subject: Re: bug#21164: 25.0.50; char-fold search broken for multi-line searches (sometimes) Date: Wed, 5 Aug 2015 19:16:22 +0100 Message-ID: References: <87zj2d6keq.fsf@secretsauce.net> <87twshqv9s.fsf@mail.linkov.net> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1438798608 25634 80.91.229.3 (5 Aug 2015 18:16:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Aug 2015 18:16:48 +0000 (UTC) Cc: Dima Kogan , 21164@debbugs.gnu.org To: Juri Linkov , emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 05 20:16:48 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZN3F6-0000Q5-9K for ged-emacs-devel@m.gmane.org; Wed, 05 Aug 2015 20:16:44 +0200 Original-Received: from localhost ([::1]:41617 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZN3F5-00034n-Go for ged-emacs-devel@m.gmane.org; Wed, 05 Aug 2015 14:16:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZN3Em-00034P-MT for emacs-devel@gnu.org; Wed, 05 Aug 2015 14:16:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZN3El-0007Qy-I5 for emacs-devel@gnu.org; Wed, 05 Aug 2015 14:16:24 -0400 Original-Received: from mail-la0-x229.google.com ([2a00:1450:4010:c03::229]:32923) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZN3El-0007Qg-9w for emacs-devel@gnu.org; Wed, 05 Aug 2015 14:16:23 -0400 Original-Received: by labjt7 with SMTP id jt7so16630300lab.0 for ; Wed, 05 Aug 2015 11:16:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=BEMHYBgUa8LmONc+VOFtaDNwj1RbbxVsKM8u0NePSLc=; b=vvsw9gbKQu+sWOLXn0cr7ArMfz94GiFRv+XkLBtsVdupaRa7CsHkn4XV1gBEkkixDM 8pPEQlUQew9grQ0mujnmc7vEuZUaXW3zEMgQI+2jbXbvxovAutYnQdq0G2N3MkhYlSO4 LogebWZJywbPjLbXOdMqHgcm0bYqsjZwcGMT2Ey/YkZFSbwu1qIdOzlZwYCd9NIubp5M VjlqhOBOcggA89+KHSBTTqaiExUx17NKvEeCZ5C+1BxS9IHs32ALVAuXLgCceu+gSwbt LpT/eCraN+hWrWnQHX24L+fS/aa1+qvl39SsVeKQuRq3/e63kP2WPSZMmvYiY6ALE5BV 8qHQ== X-Received: by 10.112.145.169 with SMTP id sv9mr10453951lbb.73.1438798582526; Wed, 05 Aug 2015 11:16:22 -0700 (PDT) Original-Received: by 10.25.134.139 with HTTP; Wed, 5 Aug 2015 11:16:22 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: HSireo5eRLmDBVgKlYZYGMWmdS4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::229 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:188455 Archived-At: There is some logic in `isearch-search-fun-default' that I don't quite understand, and it's giving me trouble. The following expression is used to decide whether lax-whitespace matching should be used. ;; Use lax versions to not fail at the end of the word while ;; the user adds and removes characters in the search string ;; (or when using nonincremental word isearch) (let ((lax (not (or isearch-nonincremental (null (car isearch-cmds)) (eq (length isearch-string) (length (isearch--state-string (car isearch-cmds)))))))) ...) I don't understand the purpose of the last clause `(eq (...) (...))'. For me, the only effect that it has is to disable lax while isearch is looking for matches beyond the current one. For instance, here's what happens with me: 1. Type C-s SPC to start isearching for a space. 2. All of the clauses evaluate to nil, and the `isearch-word' function is called with LAX being t (all good). 3. Immediately (without me typing anything), isearch will start looking for the next match, but this time the last clause will evaluate to t. So the `isearch-word' function will be called with LAX being nil, and some of the upcoming matches will be missed. 4. Step 3 is repeated to find more matches, always with lax being nil.