GNU bug report logs - #14013
24.3.50; dired-isearch-filenames-regexp is matching text outside filenames

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: michael_heerdegen@HIDDEN; dated Wed, 20 Mar 2013 23:42:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 14013 <at> debbugs.gnu.org:


Received: (at 14013) by debbugs.gnu.org; 27 May 2013 23:49:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 27 19:49:34 2013
Received: from localhost ([127.0.0.1]:36922 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Uh7AU-0005Y6-0a
	for submit <at> debbugs.gnu.org; Mon, 27 May 2013 19:49:34 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:33935
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1Uh7AR-0005Xx-M6
	for 14013 <at> debbugs.gnu.org; Mon, 27 May 2013 19:49:32 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id 35879258B9E91C;
	Mon, 27 May 2013 16:48:15 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#14013: 24.3.50;
	dired-isearch-filenames-regexp is matching text outside filenames
Organization: JURTA
References: <87li9hk5e5.fsf@HIDDEN> <87wqt1vd0o.fsf@HIDDEN>
	<87d2ut4mji.fsf@HIDDEN> <87620lvavl.fsf@HIDDEN>
	<87zjxxsd6c.fsf@HIDDEN> <87vc8ke4os.fsf@HIDDEN>
	<jwvvc8kurq1.fsf-monnier+emacs@HIDDEN>
	<87a9pv2be0.fsf@HIDDEN> <87obda5iy2.fsf@HIDDEN>
	<87bo7w6tc0.fsf@HIDDEN> <87mwrgav0v.fsf@HIDDEN>
Date: Tue, 28 May 2013 02:45:03 +0300
In-Reply-To: <87mwrgav0v.fsf@HIDDEN> (Michael Heerdegen's message of "Tue, 28
	May 2013 01:00:00 +0200")
Message-ID: <87vc64yogw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 14013
Cc: 14013 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

>> > I must also admit that I got used to use `dired-hide-details-mode' in
>> > combination with isearch now and am very happy.  (BTW, I have
>> > search-invisible -> open, but invisible fields are not opened - is this
>> > normal?).
>>
>> I wonder why do you want isearch to open hidden dired details when you use
>> `dired-hide-details-mode' with the intention to hide them from isearch?
>
> You misunderstood.  I don't want isearch to open dired details.  Just
> in one moment, I wondered why it actually didn't, although
> search-invisible was bound to open (because I generally want isearch to
> open hidden stuff).

Good.  Then let's leave dired details always hidden from isearch.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14013; Package emacs. Full text available.

Message received at 14013 <at> debbugs.gnu.org:


Received: (at 14013) by debbugs.gnu.org; 27 May 2013 23:01:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 27 19:01:32 2013
Received: from localhost ([127.0.0.1]:36892 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Uh6Pz-0003t5-KS
	for submit <at> debbugs.gnu.org; Mon, 27 May 2013 19:01:31 -0400
Received: from mout.web.de ([212.227.15.3]:51975)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1Uh6Pw-0003sm-CC
	for 14013 <at> debbugs.gnu.org; Mon, 27 May 2013 19:01:29 -0400
Received: from drachen.dragon ([89.204.135.20]) by smtp.web.de (mrweb103) with
	ESMTPSA (Nemesis) id 0MRlED-1UrjLx13cn-00TGCo;
	Tue, 28 May 2013 01:00:05 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#14013: 24.3.50;
	dired-isearch-filenames-regexp is matching text outside filenames
References: <87li9hk5e5.fsf@HIDDEN> <87wqt1vd0o.fsf@HIDDEN>
	<87d2ut4mji.fsf@HIDDEN> <87620lvavl.fsf@HIDDEN>
	<87zjxxsd6c.fsf@HIDDEN> <87vc8ke4os.fsf@HIDDEN>
	<jwvvc8kurq1.fsf-monnier+emacs@HIDDEN>
	<87a9pv2be0.fsf@HIDDEN> <87obda5iy2.fsf@HIDDEN>
	<87bo7w6tc0.fsf@HIDDEN>
Date: Tue, 28 May 2013 01:00:00 +0200
In-Reply-To: <87bo7w6tc0.fsf@HIDDEN> (Juri Linkov's message of "Mon,
	27 May 2013 23:50:07 +0300")
Message-ID: <87mwrgav0v.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V02:K0:0xeoOJ7e2OHuXfhJw7+m88SPTp9TJOKqWg7a6DT4pzo
	83obnKapP4S3Gxfg/T9kyQETHQBzkIc79dZ2Y67aze0CtKTJpi
	Y6XrcPko1Jnwl54XIp/8143FxyeJvWnDAyV9uraIzGthVEm4b5
	BDWdX0mF60mjoqp0utn3u9EndYQb2XmszhdPyBNGQt1sTQVSMb
	YSl1q0xRhmQWHQHbKnnNLhr9SunKCPyxetsVGljLK0=
X-Spam-Score: -3.0 (---)
X-Debbugs-Envelope-To: 14013
Cc: 14013 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.0 (---)

Juri Linkov <juri@HIDDEN> writes:

> > I must also admit that I got used to use `dired-hide-details-mode' in
> > combination with isearch now and am very happy.  (BTW, I have
> > search-invisible -> open, but invisible fields are not opened - is this
> > normal?).
>
> I wonder why do you want isearch to open hidden dired details when you use
> `dired-hide-details-mode' with the intention to hide them from isearch?

You misunderstood.  I don't want isearch to open dired details.  Just
in one moment, I wondered why it actually didn't, although
search-invisible was bound to open (because I generally want isearch to
open hidden stuff).


Regards,

Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14013; Package emacs. Full text available.

Message received at 14013 <at> debbugs.gnu.org:


Received: (at 14013) by debbugs.gnu.org; 27 May 2013 21:09:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 27 17:09:35 2013
Received: from localhost ([127.0.0.1]:36847 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Uh4ff-000096-95
	for submit <at> debbugs.gnu.org; Mon, 27 May 2013 17:09:35 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:49978
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1Uh4fd-00008y-2J
	for 14013 <at> debbugs.gnu.org; Mon, 27 May 2013 17:09:34 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id 7AC2E258B9E938;
	Mon, 27 May 2013 14:08:16 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#14013: 24.3.50;
	dired-isearch-filenames-regexp is matching text outside filenames
Organization: JURTA
References: <87li9hk5e5.fsf@HIDDEN> <87wqt1vd0o.fsf@HIDDEN>
	<87d2ut4mji.fsf@HIDDEN> <87620lvavl.fsf@HIDDEN>
	<87zjxxsd6c.fsf@HIDDEN> <87vc8ke4os.fsf@HIDDEN>
	<jwvvc8kurq1.fsf-monnier+emacs@HIDDEN>
	<87a9pv2be0.fsf@HIDDEN> <87obda5iy2.fsf@HIDDEN>
Date: Mon, 27 May 2013 23:50:07 +0300
In-Reply-To: <87obda5iy2.fsf@HIDDEN> (Michael Heerdegen's message of "Fri, 19
	Apr 2013 23:06:29 +0200")
Message-ID: <87bo7w6tc0.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.8 (/)
X-Debbugs-Envelope-To: 14013
Cc: Stefan Monnier <monnier@HIDDEN>, 14013 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

> I must say I got a bit lost.  Still learning how isearch internally
> works.  Juri, can you help me with a new patch?

Sorry, I still have not figured out how to limit the search for ".*"
only to file names.  Maybe there is no good solution.  For example,
to limit operations to file names only, Wdired uses such kludge
as `wdired-downcase-word' and `wdired-upcase-word' to skip non-file
parts of Dired buffers.

For a regexp ".*" to match file names only this might require a new
regexp feature for specifying text-properties in regexps similar to
`\sCODE' for syntax classes, or `\cC' for character categories,
or character classes like `[:ascii:]'.  So for example, a regexp like
"^[#dired-filename#]*$" would match only the text with text-properties
`dired-filename'.

> I must also admit that I got used to use `dired-hide-details-mode' in
> combination with isearch now and am very happy.  (BTW, I have
> search-invisible -> open, but invisible fields are not opened - is this
> normal?).

I wonder why do you want isearch to open hidden dired details when you use
`dired-hide-details-mode' with the intention to hide them from isearch?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14013; Package emacs. Full text available.

Message received at 14013 <at> debbugs.gnu.org:


Received: (at 14013) by debbugs.gnu.org; 20 Apr 2013 01:54:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 19 21:54:29 2013
Received: from localhost ([127.0.0.1]:60977 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UTN0X-0007U4-9H
	for submit <at> debbugs.gnu.org; Fri, 19 Apr 2013 21:54:29 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.182]:5729)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <monnier@HIDDEN>) id 1UTN0U-0007Tt-TJ
	for 14013 <at> debbugs.gnu.org; Fri, 19 Apr 2013 21:54:27 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av8EABK/CFHO+LAd/2dsb2JhbABEuzWDWRdzgh8BBScvIxALNBIUGA0kiCTBLZEKA6R6gV6DEw
X-IPAS-Result: Av8EABK/CFHO+LAd/2dsb2JhbABEuzWDWRdzgh8BBScvIxALNBIUGA0kiCTBLZEKA6R6gV6DEw
X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; 
   d="scan'208";a="7841896"
Received: from 206-248-176-29.dsl.teksavvy.com (HELO ceviche.home)
	([206.248.176.29])
	by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA;
	19 Apr 2013 21:49:45 -0400
Received: by ceviche.home (Postfix, from userid 20848)
	id 9B7E9660E8; Fri, 19 Apr 2013 21:49:48 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#14013: 24.3.50;
	dired-isearch-filenames-regexp is matching text outside filenames
Message-ID: <jwvwqrynfa6.fsf-monnier+emacs@HIDDEN>
References: <87li9hk5e5.fsf@HIDDEN> <87wqt1vd0o.fsf@HIDDEN>
	<87d2ut4mji.fsf@HIDDEN> <87620lvavl.fsf@HIDDEN>
	<87zjxxsd6c.fsf@HIDDEN> <87vc8ke4os.fsf@HIDDEN>
	<jwvvc8kurq1.fsf-monnier+emacs@HIDDEN>
	<87a9pv2be0.fsf@HIDDEN> <87obda5iy2.fsf@HIDDEN>
Date: Fri, 19 Apr 2013 21:49:48 -0400
In-Reply-To: <87obda5iy2.fsf@HIDDEN> (Michael Heerdegen's message of "Fri, 19
	Apr 2013 23:06:29 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 14013
Cc: Juri Linkov <juri@HIDDEN>, 14013 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

> (BTW, I have search-invisible -> open, but invisible fields are not
> opened - is this normal?).

I think it's "normal" in the sense that isearch only handles `invisible'
when added by overlays rather than by text-properties.  IOW, it's
a known problem.  Aka "patch welcome".


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14013; Package emacs. Full text available.

Message received at 14013 <at> debbugs.gnu.org:


Received: (at 14013) by debbugs.gnu.org; 19 Apr 2013 21:11:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 19 17:11:19 2013
Received: from localhost ([127.0.0.1]:60721 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UTIaV-0002Ci-Gr
	for submit <at> debbugs.gnu.org; Fri, 19 Apr 2013 17:11:19 -0400
Received: from mout.web.de ([212.227.17.11]:58929)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UTIaT-0002Cb-T2
	for 14013 <at> debbugs.gnu.org; Fri, 19 Apr 2013 17:11:18 -0400
Received: from drachen.dragon ([89.204.130.17]) by smtp.web.de (mrweb003) with
	ESMTPSA (Nemesis) id 0MT8cQ-1U4adO38UQ-00RjVF;
	Fri, 19 Apr 2013 23:06:38 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#14013: 24.3.50;
	dired-isearch-filenames-regexp is matching text outside filenames
References: <87li9hk5e5.fsf@HIDDEN> <87wqt1vd0o.fsf@HIDDEN>
	<87d2ut4mji.fsf@HIDDEN> <87620lvavl.fsf@HIDDEN>
	<87zjxxsd6c.fsf@HIDDEN> <87vc8ke4os.fsf@HIDDEN>
	<jwvvc8kurq1.fsf-monnier+emacs@HIDDEN>
	<87a9pv2be0.fsf@HIDDEN>
Date: Fri, 19 Apr 2013 23:06:29 +0200
In-Reply-To: <87a9pv2be0.fsf@HIDDEN> (Juri Linkov's message of "Sat,
	23 Mar 2013 02:44:07 +0200")
Message-ID: <87obda5iy2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V02:K0:cITanRB0EaCg/eKddsX//0sujonV6pYFpfb+CfxUgy6
	5dU77DjucKYtXNAMffK3CgA6H2EOEpR9p6T6uwx/qyWk2Lo0WR
	ELlr/7gbuJIMaL/T8Vqg0DRC2YN+hYJ2K9//Vgsb9MkdcJ7a3+
	tuh4umLTp/Nvz8kDadsRxRRiQOUlqLFd+WY5nqDOyf6TX5Zp2c
	pI4XumBp7wgmASfY0P0s7wlJAOifjKPgI3qpoC6aPM=
X-Spam-Score: 0.1 (/)
X-Debbugs-Envelope-To: 14013
Cc: Stefan Monnier <monnier@HIDDEN>, 14013 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.6 (--)

Juri Linkov <juri@HIDDEN> writes:

> > Why not (add-function :around (local isearch-search-fun-function)
> >                       #'dired--isearch-filenames)
>
> This is even better, so Michael could easily try different ideas
> without applying patches.

I must say I got a bit lost.  Still learning how isearch internally
works.  Juri, can you help me with a new patch?

I must also admit that I got used to use `dired-hide-details-mode' in
combination with isearch now and am very happy.  (BTW, I have
search-invisible -> open, but invisible fields are not opened - is this
normal?).


Regards,

Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14013; Package emacs. Full text available.

Message received at 14013 <at> debbugs.gnu.org:


Received: (at 14013) by debbugs.gnu.org; 23 Mar 2013 01:12:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 22 21:12:57 2013
Received: from localhost ([127.0.0.1]:41389 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UJD0z-0000pZ-C3
	for submit <at> debbugs.gnu.org; Fri, 22 Mar 2013 21:12:57 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:38823
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1UJD0w-0000pR-1n
	for 14013 <at> debbugs.gnu.org; Fri, 22 Mar 2013 21:12:55 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id 798F1258B92960;
	Fri, 22 Mar 2013 18:10:53 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#14013: 24.3.50;
	dired-isearch-filenames-regexp is matching text outside filenames
Organization: JURTA
References: <87li9hk5e5.fsf@HIDDEN> <87wqt1vd0o.fsf@HIDDEN>
	<87d2ut4mji.fsf@HIDDEN> <87620lvavl.fsf@HIDDEN>
	<87zjxxsd6c.fsf@HIDDEN> <87vc8ke4os.fsf@HIDDEN>
	<8738vowa1i.fsf@HIDDEN> <87k3p0cle3.fsf@HIDDEN>
	<87d2uscjeh.fsf@HIDDEN>
Date: Sat, 23 Mar 2013 02:49:37 +0200
In-Reply-To: <87d2uscjeh.fsf@HIDDEN> (Michael Heerdegen's message of "Fri, 22
	Mar 2013 02:28:38 +0100")
Message-ID: <87ppyqyld2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.8 (/)
X-Debbugs-Envelope-To: 14013
Cc: 14013 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

>> The patch is complete and it's working in my tests for ".*" and ".+".
>
> Just ".*" also works for me as it should (as supposed to before, which
> shows that I indeed use your new code).  But if I try "a.*", the
> following matches begin before the file names (my user name ends with
> the letter a).

When Isearch doesn't find "a.*" in the current filename it continues
searching from the beginning of the next Dired line and finds a match
in the details area that contains user names and permissions.
It seems the search should be limited to the end of the filename
on the current line.  But setting the BOUND arg of `search-forward-regexp'
to the end of the filename will cause Isearch to fail for the whole buffer.

BTW, I looked at your previous proof of concept and noticed that even though
it works correctly, its (goto-char (1+ beg)) is very inefficient especially
in the case of ".*" where is advances slowly by 1 character offset
for every search function call in the details area outside of filenames.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14013; Package emacs. Full text available.

Message received at 14013 <at> debbugs.gnu.org:


Received: (at 14013) by debbugs.gnu.org; 23 Mar 2013 00:48:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 22 20:48:45 2013
Received: from localhost ([127.0.0.1]:41372 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UJCdZ-0000HS-Cc
	for submit <at> debbugs.gnu.org; Fri, 22 Mar 2013 20:48:45 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:57150
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1UJCdX-0000HL-2R
	for 14013 <at> debbugs.gnu.org; Fri, 22 Mar 2013 20:48:43 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id AC9A5258B92960;
	Fri, 22 Mar 2013 17:46:42 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#14013: 24.3.50;
	dired-isearch-filenames-regexp is matching text outside filenames
Organization: JURTA
References: <87li9hk5e5.fsf@HIDDEN> <87wqt1vd0o.fsf@HIDDEN>
	<87d2ut4mji.fsf@HIDDEN> <87620lvavl.fsf@HIDDEN>
	<87zjxxsd6c.fsf@HIDDEN> <87vc8ke4os.fsf@HIDDEN>
	<jwvvc8kurq1.fsf-monnier+emacs@HIDDEN>
Date: Sat, 23 Mar 2013 02:44:07 +0200
In-Reply-To: <jwvvc8kurq1.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
	of "Thu, 21 Mar 2013 21:59:52 -0400")
Message-ID: <87a9pv2be0.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 14013
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, 14013 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

>> -         (pos1 (save-excursion (funcall func string bound noerror)))
>> +         (pos1 (save-excursion
>> +		 (run-hooks 'isearch-search-fun-pre-hook)
>> +		 (funcall func string bound noerror)))
>
> Doesn't sound good.
>
>> +    (add-hook 'isearch-search-fun-pre-hook 'dired-isearch-filenames-pre-hook nil t)))
>
> Why not (add-function :around (local isearch-search-fun-function)
>                       #'dired--isearch-filenames)

This is even better, so Michael could easily try different ideas
without applying patches.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14013; Package emacs. Full text available.

Message received at 14013 <at> debbugs.gnu.org:


Received: (at 14013) by debbugs.gnu.org; 22 Mar 2013 02:02:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 21 22:02:13 2013
Received: from localhost ([127.0.0.1]:39692 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UIrIz-0006QE-Sp
	for submit <at> debbugs.gnu.org; Thu, 21 Mar 2013 22:02:10 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.182]:4227)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <monnier@HIDDEN>) id 1UIrIw-0006Pt-Jq
	for 14013 <at> debbugs.gnu.org; Thu, 21 Mar 2013 22:02:03 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av8EABK/CFFFxKvA/2dsb2JhbABEuzWDWRdzgh8BBVYjEAs0EhQYDSSIJMEtkQoDpHqBXoMT
X-IPAS-Result: Av8EABK/CFFFxKvA/2dsb2JhbABEuzWDWRdzgh8BBVYjEAs0EhQYDSSIJMEtkQoDpHqBXoMT
X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; 
   d="scan'208";a="5501829"
Received: from 69-196-171-192.dsl.teksavvy.com (HELO pastel.home)
	([69.196.171.192])
	by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA;
	21 Mar 2013 22:00:03 -0400
Received: by pastel.home (Postfix, from userid 20848)
	id B396567AC3; Thu, 21 Mar 2013 21:59:52 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#14013: 24.3.50;
	dired-isearch-filenames-regexp is matching text outside filenames
Message-ID: <jwvvc8kurq1.fsf-monnier+emacs@HIDDEN>
References: <87li9hk5e5.fsf@HIDDEN> <87wqt1vd0o.fsf@HIDDEN>
	<87d2ut4mji.fsf@HIDDEN> <87620lvavl.fsf@HIDDEN>
	<87zjxxsd6c.fsf@HIDDEN> <87vc8ke4os.fsf@HIDDEN>
Date: Thu, 21 Mar 2013 21:59:52 -0400
In-Reply-To: <87vc8ke4os.fsf@HIDDEN> (Juri Linkov's message of "Fri,
	22 Mar 2013 01:03:31 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 14013
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, 14013 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

> -         (pos1 (save-excursion (funcall func string bound noerror)))
> +         (pos1 (save-excursion
> +		 (run-hooks 'isearch-search-fun-pre-hook)
> +		 (funcall func string bound noerror)))

Doesn't sound good.

> +    (add-hook 'isearch-search-fun-pre-hook 'dired-isearch-filenames-pre-hook nil t)))

Why not (add-function :around (local isearch-search-fun-function)
                      #'dired--isearch-filenames)
and then

   (defun dired--isearch-filenames (iiff &rest args)
     (let ((fun (apply iiff args)))
       (lambda (&rest args)
         (unless (get-text-property (point) 'dired-filename)
           (if isearch-forward
   	       (goto-char (or (next-single-property-change
                               (point) 'dired-filename)
                              (point-max)))
             (goto-char (or (previous-single-property-change
                            (point) 'dired-filename)
                        (point-min)))))
         (apply fun args))))


-- Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14013; Package emacs. Full text available.

Message received at 14013 <at> debbugs.gnu.org:


Received: (at 14013) by debbugs.gnu.org; 22 Mar 2013 01:30:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 21 21:30:46 2013
Received: from localhost ([127.0.0.1]:39672 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UIqof-0005gz-0b
	for submit <at> debbugs.gnu.org; Thu, 21 Mar 2013 21:30:45 -0400
Received: from mout.web.de ([212.227.15.4]:61360)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UIqoc-0005gp-Jv
	for 14013 <at> debbugs.gnu.org; Thu, 21 Mar 2013 21:30:43 -0400
Received: from drachen.dragon ([89.204.137.90]) by smtp.web.de (mrweb002) with
	ESMTPSA (Nemesis) id 0Mf0a9-1U3Ee12oht-00OGWI;
	Fri, 22 Mar 2013 02:28:46 +0100
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#14013: 24.3.50;
	dired-isearch-filenames-regexp is matching text outside filenames
References: <87li9hk5e5.fsf@HIDDEN> <87wqt1vd0o.fsf@HIDDEN>
	<87d2ut4mji.fsf@HIDDEN> <87620lvavl.fsf@HIDDEN>
	<87zjxxsd6c.fsf@HIDDEN> <87vc8ke4os.fsf@HIDDEN>
	<8738vowa1i.fsf@HIDDEN> <87k3p0cle3.fsf@HIDDEN>
Date: Fri, 22 Mar 2013 02:28:38 +0100
In-Reply-To: <87k3p0cle3.fsf@HIDDEN> (Juri Linkov's message of "Fri,
	22 Mar 2013 02:45:40 +0200")
Message-ID: <87d2uscjeh.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V02:K0:0XA2DrmrsoieC4mhWiXGLqd8jz7nd6W98/Zk2kdxOeS
	eXSzGh1Y8FsXqzhGWYC6ppJhhO4h0Eh6uFlGBMz8amXWb6Sh9N
	GKlVCDk5rPD8+AI9oCqcfGDEAsqz/PZGmGGDh6XlINL4R1b1oG
	TnuvGm1lOFsG19OFfdv7WUT8i8jPa5Mvrr0LspVJspEwyvyxGo
	IkyGdg588hpzYqugY6H4JsuSQ7o5OfuLDvJhToGuLE=
X-Spam-Score: -1.7 (-)
X-Debbugs-Envelope-To: 14013
Cc: 14013 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.4 (----)

Juri Linkov <juri@HIDDEN> writes:

> > I quickly tested it.  But it doesn't yet do the right thing.  For the
> > first search hit, it does - but if you repeat searching (by repeatedly
> > hitting C-M-s), the behavior is like it is now - i.e., with repeated
> > searching, there is no progress.
>
> It doesn't work for `C-M-s' because by default the search in Dired
> is not restricted to filenames (the default value of
> dired-isearch-filenames'
> is "No restrictions").

No no, of course I have `dired-isearch-filenames' configured.  I already
double-checked everything - although it's already late here, I don't
think I made an error while testing.

> > Do you need to run `isearch-search-fun-pre-hook' at other places as well?
>
> The patch is complete and it's working in my tests for ".*" and ".+".

Just ".*" also works for me as it should (as supposed to before, which
shows that I indeed use your new code).  But if I try "a.*", the
following matches begin before the file names (my user name ends with
the letter a).


Regards,

Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14013; Package emacs. Full text available.

Message received at 14013 <at> debbugs.gnu.org:


Received: (at 14013) by debbugs.gnu.org; 22 Mar 2013 00:49:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 21 20:49:32 2013
Received: from localhost ([127.0.0.1]:39622 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UIqAl-0003oC-RF
	for submit <at> debbugs.gnu.org; Thu, 21 Mar 2013 20:49:32 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:37309
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1UIqAj-0003o4-9H
	for 14013 <at> debbugs.gnu.org; Thu, 21 Mar 2013 20:49:30 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id 4E010258B92960;
	Thu, 21 Mar 2013 17:47:34 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#14013: 24.3.50;
	dired-isearch-filenames-regexp is matching text outside filenames
Organization: JURTA
References: <87li9hk5e5.fsf@HIDDEN> <87wqt1vd0o.fsf@HIDDEN>
	<87d2ut4mji.fsf@HIDDEN> <87620lvavl.fsf@HIDDEN>
	<87zjxxsd6c.fsf@HIDDEN> <87vc8ke4os.fsf@HIDDEN>
	<8738vowa1i.fsf@HIDDEN>
Date: Fri, 22 Mar 2013 02:45:40 +0200
In-Reply-To: <8738vowa1i.fsf@HIDDEN> (Michael Heerdegen's message of "Fri, 22
	Mar 2013 01:30:33 +0100")
Message-ID: <87k3p0cle3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.8 (/)
X-Debbugs-Envelope-To: 14013
Cc: 14013 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

> I quickly tested it.  But it doesn't yet do the right thing.  For the
> first search hit, it does - but if you repeat searching (by repeatedly
> hitting C-M-s), the behavior is like it is now - i.e., with repeated
> searching, there is no progress.

It doesn't work for `C-M-s' because by default the search in Dired
is not restricted to filenames (the default value of `dired-isearch-filenames'
is "No restrictions").  You have to start Isearch either by running
`M-x dired-isearch-filenames-regexp' or by customizing `dired-isearch-filenames'
to "Always search in file names" and then starting Isearch with `C-M-s'.

> Do you need to run `isearch-search-fun-pre-hook' at other places as well?

The patch is complete and it's working in my tests for ".*" and ".+".




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14013; Package emacs. Full text available.

Message received at 14013 <at> debbugs.gnu.org:


Received: (at 14013) by debbugs.gnu.org; 22 Mar 2013 00:32:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 21 20:32:43 2013
Received: from localhost ([127.0.0.1]:39560 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UIpuU-0003K9-AP
	for submit <at> debbugs.gnu.org; Thu, 21 Mar 2013 20:32:43 -0400
Received: from mout.web.de ([212.227.17.12]:55247)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UIpuR-0003K0-PZ
	for 14013 <at> debbugs.gnu.org; Thu, 21 Mar 2013 20:32:41 -0400
Received: from drachen.dragon ([89.204.137.90]) by smtp.web.de (mrweb001) with
	ESMTPSA (Nemesis) id 0MCZP8-1UR34T3vt4-009Nlg;
	Fri, 22 Mar 2013 01:30:44 +0100
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#14013: 24.3.50;
	dired-isearch-filenames-regexp is matching text outside filenames
References: <87li9hk5e5.fsf@HIDDEN> <87wqt1vd0o.fsf@HIDDEN>
	<87d2ut4mji.fsf@HIDDEN> <87620lvavl.fsf@HIDDEN>
	<87zjxxsd6c.fsf@HIDDEN> <87vc8ke4os.fsf@HIDDEN>
Date: Fri, 22 Mar 2013 01:30:33 +0100
In-Reply-To: <87vc8ke4os.fsf@HIDDEN> (Juri Linkov's message of "Fri,
	22 Mar 2013 01:03:31 +0200")
Message-ID: <8738vowa1i.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V02:K0:BZ/tYJLha6V4uQc2xUyuXq/c3D0BJQeU9o1XLw3bVic
	NeWeySs3+mgI3es2GEI9+UiYAGf3epHCx0nfYWNkGnZmZZ7deo
	9KohRxOZ6NFpscNgoSF6kC4tZ2WBzan2mhuCo4q4UYKO/ihQrs
	fCNwRGP0OtCHky9DqLFzyzQ3OcdONUYuP9zC4vUqJAtaZi8bzI
	ZQ5msibyeI3cUaR9p9+j5zt00IyuJZyO9CabNQd72A=
X-Spam-Score: -2.5 (--)
X-Debbugs-Envelope-To: 14013
Cc: 14013 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.4 (----)

Hi Juri,

thanks for working on this!

> > Would it be an appropriate approach to use a more sophisticated value
> > for `isearch-search-fun-function' for that case?  This function could
> > e.g. jump to the next filename before starting searching.
>
> Instead of duplicating the complex logic of `isearch-search-fun-function'
> in a new specialized function it would be better to implement this
> using hooks.

Ok.  In the meanwhile, I wrote a proof of concept, which seems to work
well (just for the record):

(defun dired-search-forward-filename-regexp (&rest args)
  (catch 'result
    (while t
      (let* ((result (apply #'search-forward-regexp args))
             (beg (and result (match-beginning 0)))
             (end (and result (match-end 0))))
        (if (or (not result)
                (and (get-text-property beg 'dired-filename)
                     (or (get-text-property end 'dired-filename)
                         (eq (char-after end) ?\n))))
            (throw 'result result)
          (if (eobp)
              (throw 'result nil)
            (goto-char (1+ beg))))))))

To test shortly, just eval

 (defun isearch-search-fun () 'dired-search-forward-filename-regexp)

Works well for me.  But I think that your approach is more appropriate
here.

> We have already a post-processing hook `isearch-update-post-hook'
> invoked after isearch has found matches.  So we need a similar hook
> invoked before isearch starts searching matches, with a name like
> `isearch-search-fun-pre-hook'.
>
> It fixes your test case of searching for ".*":

I quickly tested it.  But it doesn't yet do the right thing.  For the
first search hit, it does - but if you repeat searching (by repeatedly
hitting C-M-s), the behavior is like it is now - i.e., with repeated
searching, there is no progress.  Do you need to run
`isearch-search-fun-pre-hook' at other places as well?


Thanks,

Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14013; Package emacs. Full text available.

Message received at 14013 <at> debbugs.gnu.org:


Received: (at 14013) by debbugs.gnu.org; 21 Mar 2013 23:09:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 21 19:09:32 2013
Received: from localhost ([127.0.0.1]:39487 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UIoc0-0001MB-DC
	for submit <at> debbugs.gnu.org; Thu, 21 Mar 2013 19:09:32 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:50244
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1UIoby-0001M3-Dg
	for 14013 <at> debbugs.gnu.org; Thu, 21 Mar 2013 19:09:31 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id CF732258B92960;
	Thu, 21 Mar 2013 16:07:35 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#14013: 24.3.50;
	dired-isearch-filenames-regexp is matching text outside filenames
Organization: JURTA
References: <87li9hk5e5.fsf@HIDDEN> <87wqt1vd0o.fsf@HIDDEN>
	<87d2ut4mji.fsf@HIDDEN> <87620lvavl.fsf@HIDDEN>
	<87zjxxsd6c.fsf@HIDDEN>
Date: Fri, 22 Mar 2013 01:03:31 +0200
In-Reply-To: <87zjxxsd6c.fsf@HIDDEN> (Michael Heerdegen's message of "Thu, 21
	Mar 2013 03:24:11 +0100")
Message-ID: <87vc8ke4os.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 14013
Cc: 14013 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

> Would it be an appropriate approach to use a more sophisticated value
> for `isearch-search-fun-function' for that case?  This function could
> e.g. jump to the next filename before starting searching.

Instead of duplicating the complex logic of `isearch-search-fun-function'
in a new specialized function it would be better to implement this
using hooks.

We have already a post-processing hook `isearch-update-post-hook'
invoked after isearch has found matches.  So we need a similar hook
invoked before isearch starts searching matches, with a name like
`isearch-search-fun-pre-hook'.

It fixes your test case of searching for ".*":

=== modified file 'lisp/isearch.el'
--- lisp/isearch.el	2013-02-25 21:10:59 +0000
+++ lisp/isearch.el	2013-03-21 22:53:41 +0000
@@ -163,6 +163,9 @@ (defcustom isearch-resume-in-command-his
 (defvar isearch-mode-hook nil
   "Function(s) to call after starting up an incremental search.")
 
+(defvar isearch-search-fun-pre-hook nil
+  "Function(s) to call before isearch starts searching matches in the buffer.")
+
 (defvar isearch-update-post-hook nil
   "Function(s) to call after isearch has found matches in the buffer.")
 
@@ -2651,7 +2654,9 @@ (defun isearch-search-string (string bou
 If found, move point to the end of the occurrence,
 update the match data, and return point."
   (let* ((func (isearch-search-fun))
-         (pos1 (save-excursion (funcall func string bound noerror)))
+         (pos1 (save-excursion
+		 (run-hooks 'isearch-search-fun-pre-hook)
+		 (funcall func string bound noerror)))
          pos2)
     (when (and
 	   ;; Avoid "obsolete" warnings for translation-table-for-input.

=== modified file 'lisp/dired-aux.el'
--- lisp/dired-aux.el	2013-02-28 21:51:11 +0000
+++ lisp/dired-aux.el	2013-03-21 22:54:14 +0000
@@ -2506,6 +2506,12 @@ (defun dired-isearch-filenames-toggle ()
   (setq isearch-success t isearch-adjusted t)
   (isearch-update))
 
+(defun dired-isearch-filenames-pre-hook ()
+  (unless (get-text-property (point) 'dired-filename)
+    (if isearch-forward
+	(goto-char (or (next-single-property-change (point) 'dired-filename) (point-max)))
+      (goto-char (or (previous-single-property-change (point) 'dired-filename) (point-min))))))
+
 ;;;###autoload
 (defun dired-isearch-filenames-setup ()
   "Set up isearch to search in Dired file names.
@@ -2518,14 +2524,16 @@ (defun dired-isearch-filenames-setup ()
     (setq dired-isearch-filter-predicate-orig
 	  (default-value 'isearch-filter-predicate))
     (setq-default isearch-filter-predicate 'dired-isearch-filter-filenames)
-    (add-hook 'isearch-mode-end-hook 'dired-isearch-filenames-end nil t)))
+    (add-hook 'isearch-mode-end-hook 'dired-isearch-filenames-end nil t)
+    (add-hook 'isearch-search-fun-pre-hook 'dired-isearch-filenames-pre-hook nil t)))
 
 (defun dired-isearch-filenames-end ()
   "Clean up the Dired file name search after terminating isearch."
   (setq isearch-message-prefix-add nil)
   (define-key isearch-mode-map "\M-sf" nil)
   (setq-default isearch-filter-predicate dired-isearch-filter-predicate-orig)
-  (remove-hook 'isearch-mode-end-hook 'dired-isearch-filenames-end t))
+  (remove-hook 'isearch-mode-end-hook 'dired-isearch-filenames-end t)
+  (remove-hook 'isearch-search-fun-pre-hook 'dired-isearch-filenames-pre-hook t))
 
 (defun dired-isearch-filter-filenames (beg end)
   "Test whether the current search hit is a visible file name.

=== modified file 'lisp/wdired.el'
--- lisp/wdired.el	2013-03-05 17:13:01 +0000
+++ lisp/wdired.el	2013-03-21 22:55:11 +0000
@@ -241,6 +241,7 @@ (defun wdired-change-to-wdired-mode ()
   (set (make-local-variable 'query-replace-skip-read-only) t)
   (set (make-local-variable 'isearch-filter-predicate)
        'wdired-isearch-filter-read-only)
+  (add-hook 'isearch-search-fun-pre-hook 'dired-isearch-filenames-pre-hook nil t)
   (use-local-map wdired-mode-map)
   (force-mode-line-update)
   (setq buffer-read-only nil)

Also (run-hooks 'isearch-search-fun-pre-hook) should be added to replace.el,
but first I have to install the pending patches in bug#11378 and bug#11746.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14013; Package emacs. Full text available.

Message received at 14013 <at> debbugs.gnu.org:


Received: (at 14013) by debbugs.gnu.org; 21 Mar 2013 02:26:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 20 22:26:14 2013
Received: from localhost ([127.0.0.1]:38247 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UIVCo-0004DN-6O
	for submit <at> debbugs.gnu.org; Wed, 20 Mar 2013 22:26:14 -0400
Received: from mout.web.de ([212.227.17.11]:59297)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UIVCk-0004DF-KZ
	for 14013 <at> debbugs.gnu.org; Wed, 20 Mar 2013 22:26:11 -0400
Received: from drachen.dragon ([82.113.106.205]) by smtp.web.de (mrweb002)
	with ESMTPSA (Nemesis) id 0Lsy7e-1UgArs1GFG-012lel;
	Thu, 21 Mar 2013 03:24:20 +0100
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#14013: 24.3.50;
	dired-isearch-filenames-regexp is matching text outside filenames
References: <87li9hk5e5.fsf@HIDDEN> <87wqt1vd0o.fsf@HIDDEN>
	<87d2ut4mji.fsf@HIDDEN> <87620lvavl.fsf@HIDDEN>
Date: Thu, 21 Mar 2013 03:24:11 +0100
In-Reply-To: <87620lvavl.fsf@HIDDEN> (Juri Linkov's message of "Thu,
	21 Mar 2013 02:45:34 +0200")
Message-ID: <87zjxxsd6c.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V02:K0:NPAwmSf4yshE6EWrAfc3pIsoXSnxio6vVNno9VD/lrg
	8/bh4d+R5PNZbOwCUgdDi/HTyProwCpI+HLaBd2BLX+8Ox8700
	aMYS68GqfefrPaZHjjbVgMYXHV6sRNY5gbbi/lzdhgTJbCdtqL
	5FMduoW0pGt0J0IgFL5NfZRO+RW2mTHYAJLuJELioz7NDQCAtW
	YVCWxv24zO9x4Ypm9CUWQ4fIeQDyCEuncSoDqovV78=
X-Spam-Score: -2.5 (--)
X-Debbugs-Envelope-To: 14013
Cc: 14013 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.4 (----)

Juri Linkov <juri@HIDDEN> writes:

> >> .* matches a whole line.  We can't hide from Isearch the fact
> >> that lines in Dired contain more details besides filenames.
> >
> > What about doing this (unrelated parts stripped, just as an example):
> >
> > (defun dired-isearch-filter-filenames (beg end)
> >   (let ((beg (min beg end))
> >         (end (max beg end)))
> >    (and (get-text-property beg 'dired-filename)
> >         (or (eq (char-after end) ?\n)
> >             (get-text-property end 'dired-filename)))))
>
> This doesn't work when searching for the regexp .+
> .+ matches nothing but should match the same text as .*

Right, thanks.  Now I'm beginning to understand how this code works.

But the current situation is IMHO a bit unsatisfying - don't you think
that being able to use the "wildcard" ".*" is a common, when not the
most important reason why a user would want to use regexp filename
searching in dired?

Would it be an appropriate approach to use a more sophisticated value
for `isearch-search-fun-function' for that case?  This function could
e.g. jump to the next filename before starting searching.


Regards,

Michael.






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14013; Package emacs. Full text available.

Message received at 14013 <at> debbugs.gnu.org:


Received: (at 14013) by debbugs.gnu.org; 21 Mar 2013 00:53:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 20 20:53:09 2013
Received: from localhost ([127.0.0.1]:38205 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UITki-000275-QJ
	for submit <at> debbugs.gnu.org; Wed, 20 Mar 2013 20:53:09 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:34572
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1UITke-00026v-P7
	for 14013 <at> debbugs.gnu.org; Wed, 20 Mar 2013 20:53:06 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id 6FDFE258B9E91C;
	Wed, 20 Mar 2013 17:51:15 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#14013: 24.3.50;
	dired-isearch-filenames-regexp is matching text outside filenames
Organization: JURTA
References: <87li9hk5e5.fsf@HIDDEN> <87wqt1vd0o.fsf@HIDDEN>
	<87d2ut4mji.fsf@HIDDEN>
Date: Thu, 21 Mar 2013 02:45:34 +0200
In-Reply-To: <87d2ut4mji.fsf@HIDDEN> (Michael Heerdegen's message of "Thu, 21
	Mar 2013 01:35:45 +0100")
Message-ID: <87620lvavl.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.8 (/)
X-Debbugs-Envelope-To: 14013
Cc: 14013 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

>> .* matches a whole line.  We can't hide from Isearch the fact
>> that lines in Dired contain more details besides filenames.
>
> What about doing this (unrelated parts stripped, just as an example):
>
> (defun dired-isearch-filter-filenames (beg end)
>   (let ((beg (min beg end))
>         (end (max beg end)))
>    (and (get-text-property beg 'dired-filename)
>         (or (eq (char-after end) ?\n)
>             (get-text-property end 'dired-filename)))))

This doesn't work when searching for the regexp .+
.+ matches nothing but should match the same text as .*

>> However, you can hide these details and leave only filenames
>> by using `dired-hide-details-mode' or typing `('.  Then .*
>> will match only visible filenames.
>
> Surprisingly that doesn't work.  Even with search-invisible nil I get
> exactly the same matches, i.e., also the invisible text is being
> matched.  What did I miss?

I meant that with `dired-hide-details-mode' at least you don't see
invisible text that Isearch matches outside filenames.  You see
only filenames being matched :)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14013; Package emacs. Full text available.

Message received at 14013 <at> debbugs.gnu.org:


Received: (at 14013) by debbugs.gnu.org; 21 Mar 2013 00:37:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 20 20:37:55 2013
Received: from localhost ([127.0.0.1]:38199 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UITVv-0001hV-4o
	for submit <at> debbugs.gnu.org; Wed, 20 Mar 2013 20:37:55 -0400
Received: from mout.web.de ([212.227.17.11]:49739)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UITVo-0001hG-HI
	for 14013 <at> debbugs.gnu.org; Wed, 20 Mar 2013 20:37:49 -0400
Received: from drachen.dragon ([82.113.106.205]) by smtp.web.de (mrweb103)
	with ESMTPSA (Nemesis) id 0MKrU4-1UITTv3mHw-000P3Z;
	Thu, 21 Mar 2013 01:35:55 +0100
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#14013: 24.3.50;
	dired-isearch-filenames-regexp is matching text outside filenames
References: <87li9hk5e5.fsf@HIDDEN> <87wqt1vd0o.fsf@HIDDEN>
Date: Thu, 21 Mar 2013 01:35:45 +0100
In-Reply-To: <87wqt1vd0o.fsf@HIDDEN> (Juri Linkov's message of "Thu,
	21 Mar 2013 01:59:19 +0200")
Message-ID: <87d2ut4mji.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V02:K0:aifuUOeYb4lWD5I/mG8om23nTNLNKNfCUsTN5zq8Lh4
	n1domNoHzs+Pj+LwzQ4j/yf4QgpRehlahgKuTOAdgxPQ0VjON9
	KGD1SGr/UBy7Y/a30a/a5nPlOHfELmeAw/YK9t5qMcEnk7QXFV
	nHHsoCbJm9VtlDAUnxXmQ1V2ENihUT+xiDrIHDzduoZ86v0dCb
	CV499fDHWXp4iCrTvkn/svje6H7cw6y3jH2zvzwD84=
X-Spam-Score: -2.5 (--)
X-Debbugs-Envelope-To: 14013
Cc: 14013 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.4 (----)

Juri Linkov <juri@HIDDEN> writes:

> > - M-x dired-isearch-filenames-regexp RET
> >
> > - Enter the character c (i.e. hit r in my example)
> >
> >   Only matches inside file names are found
> >
> > - Now hit .*
> >
> >   Now also matches starting before filenames are found.  This behavior
> >   continues if you enter even more characters.
>
> .* matches a whole line.  We can't hide from Isearch the fact
> that lines in Dired contain more details besides filenames.

What about doing this (unrelated parts stripped, just as an example):

(defun dired-isearch-filter-filenames (beg end)
  (let ((beg (min beg end))
        (end (max beg end)))
   (and (get-text-property beg 'dired-filename)
        (or (eq (char-after end) ?\n)
            (get-text-property end 'dired-filename)))))

This assumes that file names are convex and followed by a newline.

> However, you can hide these details and leave only filenames
> by using `dired-hide-details-mode' or typing `('.  Then .*
> will match only visible filenames.

Surprisingly that doesn't work.  Even with search-invisible nil I get
exactly the same matches, i.e., also the invisible text is being
matched.  What did I miss?


Regards,

Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14013; Package emacs. Full text available.

Message received at 14013 <at> debbugs.gnu.org:


Received: (at 14013) by debbugs.gnu.org; 21 Mar 2013 00:02:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 20 20:02:37 2013
Received: from localhost ([127.0.0.1]:38183 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UISxo-0000sv-Mo
	for submit <at> debbugs.gnu.org; Wed, 20 Mar 2013 20:02:37 -0400
Received: from ps18281.dreamhost.com ([69.163.218.105]:36604
	helo=ps18281.dreamhostps.com)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <juri@HIDDEN>) id 1UISxj-0000si-S3
	for 14013 <at> debbugs.gnu.org; Wed, 20 Mar 2013 20:02:34 -0400
Received: from localhost (ps18281.dreamhostps.com [69.163.218.105])
	by ps18281.dreamhostps.com (Postfix) with ESMTP id 87D6A258B9E91C;
	Wed, 20 Mar 2013 17:00:42 -0700 (PDT)
From: Juri Linkov <juri@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#14013: 24.3.50;
	dired-isearch-filenames-regexp is matching text outside filenames
Organization: JURTA
References: <87li9hk5e5.fsf@HIDDEN>
Date: Thu, 21 Mar 2013 01:59:19 +0200
In-Reply-To: <87li9hk5e5.fsf@HIDDEN> (Michael Heerdegen's message of "Thu, 21
	Mar 2013 00:39:30 +0100")
Message-ID: <87wqt1vd0o.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.8 (/)
X-Debbugs-Envelope-To: 14013
Cc: 14013 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -0.5 (/)

> - M-x dired-isearch-filenames-regexp RET
>
> - Enter the character c (i.e. hit r in my example)
>
>   Only matches inside file names are found
>
> - Now hit .*
>
>   Now also matches starting before filenames are found.  This behavior
>   continues if you enter even more characters.

.* matches a whole line.  We can't hide from Isearch the fact
that lines in Dired contain more details besides filenames.
However, you can hide these details and leave only filenames
by using `dired-hide-details-mode' or typing `('.  Then .*
will match only visible filenames.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14013; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 20 Mar 2013 23:41:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 20 19:41:38 2013
Received: from localhost ([127.0.0.1]:38178 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UISdU-0000OV-1U
	for submit <at> debbugs.gnu.org; Wed, 20 Mar 2013 19:41:38 -0400
Received: from eggs.gnu.org ([208.118.235.92]:39481)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UISdR-0000ON-Bk
	for submit <at> debbugs.gnu.org; Wed, 20 Mar 2013 19:41:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UISbh-0000CP-0v
	for submit <at> debbugs.gnu.org; Wed, 20 Mar 2013 19:39:45 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-104.0 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	RCVD_IN_DNSWL_NONE,RCVD_IN_XBL,RP_MATCHES_RCVD,USER_IN_WHITELIST
	autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:41557)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UISbg-0000CL-Ty
	for submit <at> debbugs.gnu.org; Wed, 20 Mar 2013 19:39:44 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50831)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UISbf-00069a-Nc
	for bug-gnu-emacs@HIDDEN; Wed, 20 Mar 2013 19:39:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UISbe-0000Br-4n
	for bug-gnu-emacs@HIDDEN; Wed, 20 Mar 2013 19:39:43 -0400
Received: from mout.web.de ([212.227.15.3]:58166)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <michael_heerdegen@HIDDEN>) id 1UISbd-0000Bn-Qz
	for bug-gnu-emacs@HIDDEN; Wed, 20 Mar 2013 19:39:42 -0400
Received: from drachen.dragon ([82.113.106.205]) by smtp.web.de (mrweb103)
	with ESMTPSA (Nemesis) id 0LsyRS-1UgCmV0VQY-012miw for
	<bug-gnu-emacs@HIDDEN>; Thu, 21 Mar 2013 00:39:40 +0100
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 24.3.50;
	dired-isearch-filenames-regexp is matching text outside filenames
Date: Thu, 21 Mar 2013 00:39:30 +0100
Message-ID: <87li9hk5e5.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V02:K0:VTqAPmzDtXMMI7MsJ4jVFhatpYzHrYELeetxQf3yBtR
	sHyan8EZmTDPXdGw3x5prD0VbUrtf/kl9D/J6/MvhuZ1e/jsf8
	f601MmoAtD40Y2HMy+YaQ0Va2B7mGFAkT5kENPsCfyaWP91H03
	bdHasoHFHIJgyD6/CPI/kzc8z27OELs6246yaKvFv/kYm/bY1o
	vY5SXyEzVyn2PUNw/7oYyGJcbkgjZJMdIUDOLXRFzw=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -6.9 (------)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: michael_heerdegen@HIDDEN
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.9 (------)


Hello,

the recipe is quite trivial:

- start emacs -Q

- dired a directory with some files in it

- let c be a character that appears in a file line before the filename,
  e.g. the character "r" in this line:

  drwxr-xr-x   3 micha micha    4096 Mar  3 21:51 bin
   ^
- M-x dired-isearch-filenames-regexp RET

- Enter the character c (i.e. hit r in my example)

  Only matches inside file names are found

- Now hit .*

  Now also matches starting before filenames are found.  This behavior
  continues if you enter even more characters.


This happens in all Emacs versions I tested: 23.4, 24.2, and trunk.


Thanks,

Michael.






In GNU Emacs 24.3.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2)
 of 2013-03-17 on dex, modified by Debian
 (emacs-snapshot package, version 2:20130317-1)
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
System Description:	Debian GNU/Linux 7.0 (wheezy)

Configured using:
 `configure --build x86_64-linux-gnu --host x86_64-linux-gnu
 --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var --infodir=/usr/share/info --mandir=/usr/share/man
 --with-pop=yes
 --enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.3.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3.50/site-lisp:/usr/share/emacs/site-lisp
 --without-compress-info --with-crt-dir=/usr/lib/x86_64-linux-gnu/
 --with-x=yes --with-x-toolkit=gtk3 --with-imagemagick=yes
 CFLAGS='-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2'
 CPPFLAGS='-D_FORTIFY_SOURCE=2' LDFLAGS='-g -Wl,--as-needed
 -znocombreloc''

Important settings:
  value of $LC_ALL: de_DE.utf8
  value of $LC_TIME: C
  value of $LANG: de_DE.utf8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp




Acknowledgement sent to michael_heerdegen@HIDDEN:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#14013; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

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