From unknown Sun Aug 10 09:46:56 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#14013 <14013@debbugs.gnu.org> To: bug#14013 <14013@debbugs.gnu.org> Subject: Status: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Reply-To: bug#14013 <14013@debbugs.gnu.org> Date: Sun, 10 Aug 2025 16:46:56 +0000 retitle 14013 24.3.50; dired-isearch-filenames-regexp is matching text outs= ide filenames reassign 14013 emacs submitter 14013 michael_heerdegen@web.de severity 14013 normal tag 14013 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 20 19:41:38 2013 Received: (at submit) by debbugs.gnu.org; 20 Mar 2013 23:41:38 +0000 Received: from localhost ([127.0.0.1]:38178 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UISdU-0000OV-1U for submit@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 ) id 1UISdR-0000ON-Bk for submit@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 ) id 1UISbh-0000CP-0v for submit@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 ) id 1UISbg-0000CL-Ty for submit@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 ) id 1UISbf-00069a-Nc for bug-gnu-emacs@gnu.org; Wed, 20 Mar 2013 19:39:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UISbe-0000Br-4n for bug-gnu-emacs@gnu.org; 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 ) id 1UISbd-0000Bn-Qz for bug-gnu-emacs@gnu.org; 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 ; Thu, 21 Mar 2013 00:39:40 +0100 From: Michael Heerdegen To: bug-gnu-emacs@gnu.org 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@web.de> 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@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: michael_heerdegen@web.de List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@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 From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 20 20:02:37 2013 Received: (at 14013) by debbugs.gnu.org; 21 Mar 2013 00:02:37 +0000 Received: from localhost ([127.0.0.1]:38183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UISxo-0000sv-Mo for submit@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 ) id 1UISxj-0000si-S3 for 14013@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 To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: JURTA References: <87li9hk5e5.fsf@web.de> Date: Thu, 21 Mar 2013 01:59:19 +0200 In-Reply-To: <87li9hk5e5.fsf@web.de> (Michael Heerdegen's message of "Thu, 21 Mar 2013 00:39:30 +0100") Message-ID: <87wqt1vd0o.fsf@mail.jurta.org> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@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. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 20 20:37:55 2013 Received: (at 14013) by debbugs.gnu.org; 21 Mar 2013 00:37:55 +0000 Received: from localhost ([127.0.0.1]:38199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UITVv-0001hV-4o for submit@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 ) id 1UITVo-0001hG-HI for 14013@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 To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> Date: Thu, 21 Mar 2013 01:35:45 +0100 In-Reply-To: <87wqt1vd0o.fsf@mail.jurta.org> (Juri Linkov's message of "Thu, 21 Mar 2013 01:59:19 +0200") Message-ID: <87d2ut4mji.fsf@web.de> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.4 (----) Juri Linkov 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. From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 20 20:53:09 2013 Received: (at 14013) by debbugs.gnu.org; 21 Mar 2013 00:53:09 +0000 Received: from localhost ([127.0.0.1]:38205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UITki-000275-QJ for submit@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 ) id 1UITke-00026v-P7 for 14013@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 To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: JURTA References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> Date: Thu, 21 Mar 2013 02:45:34 +0200 In-Reply-To: <87d2ut4mji.fsf@web.de> (Michael Heerdegen's message of "Thu, 21 Mar 2013 01:35:45 +0100") Message-ID: <87620lvavl.fsf@mail.jurta.org> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@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 :) From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 20 22:26:14 2013 Received: (at 14013) by debbugs.gnu.org; 21 Mar 2013 02:26:14 +0000 Received: from localhost ([127.0.0.1]:38247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UIVCo-0004DN-6O for submit@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 ) id 1UIVCk-0004DF-KZ for 14013@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 To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> Date: Thu, 21 Mar 2013 03:24:11 +0100 In-Reply-To: <87620lvavl.fsf@mail.jurta.org> (Juri Linkov's message of "Thu, 21 Mar 2013 02:45:34 +0200") Message-ID: <87zjxxsd6c.fsf@web.de> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.4 (----) Juri Linkov 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 21 19:09:32 2013 Received: (at 14013) by debbugs.gnu.org; 21 Mar 2013 23:09:32 +0000 Received: from localhost ([127.0.0.1]:39487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UIoc0-0001MB-DC for submit@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 ) id 1UIoby-0001M3-Dg for 14013@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 To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: JURTA References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> Date: Fri, 22 Mar 2013 01:03:31 +0200 In-Reply-To: <87zjxxsd6c.fsf@web.de> (Michael Heerdegen's message of "Thu, 21 Mar 2013 03:24:11 +0100") Message-ID: <87vc8ke4os.fsf@mail.jurta.org> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@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. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 21 20:32:43 2013 Received: (at 14013) by debbugs.gnu.org; 22 Mar 2013 00:32:43 +0000 Received: from localhost ([127.0.0.1]:39560 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UIpuU-0003K9-AP for submit@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 ) id 1UIpuR-0003K0-PZ for 14013@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 To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> Date: Fri, 22 Mar 2013 01:30:33 +0100 In-Reply-To: <87vc8ke4os.fsf@mail.jurta.org> (Juri Linkov's message of "Fri, 22 Mar 2013 01:03:31 +0200") Message-ID: <8738vowa1i.fsf@web.de> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@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. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 21 20:49:32 2013 Received: (at 14013) by debbugs.gnu.org; 22 Mar 2013 00:49:32 +0000 Received: from localhost ([127.0.0.1]:39622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UIqAl-0003oC-RF for submit@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 ) id 1UIqAj-0003o4-9H for 14013@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 To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: JURTA References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <8738vowa1i.fsf@web.de> Date: Fri, 22 Mar 2013 02:45:40 +0200 In-Reply-To: <8738vowa1i.fsf@web.de> (Michael Heerdegen's message of "Fri, 22 Mar 2013 01:30:33 +0100") Message-ID: <87k3p0cle3.fsf@mail.jurta.org> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@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 ".+". From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 21 21:30:46 2013 Received: (at 14013) by debbugs.gnu.org; 22 Mar 2013 01:30:46 +0000 Received: from localhost ([127.0.0.1]:39672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UIqof-0005gz-0b for submit@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 ) id 1UIqoc-0005gp-Jv for 14013@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 To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <8738vowa1i.fsf@web.de> <87k3p0cle3.fsf@mail.jurta.org> Date: Fri, 22 Mar 2013 02:28:38 +0100 In-Reply-To: <87k3p0cle3.fsf@mail.jurta.org> (Juri Linkov's message of "Fri, 22 Mar 2013 02:45:40 +0200") Message-ID: <87d2uscjeh.fsf@web.de> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.4 (----) Juri Linkov 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 21 22:02:13 2013 Received: (at 14013) by debbugs.gnu.org; 22 Mar 2013 02:02:13 +0000 Received: from localhost ([127.0.0.1]:39692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UIrIz-0006QE-Sp for submit@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 ) id 1UIrIw-0006Pt-Jq for 14013@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 To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Message-ID: References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> Date: Thu, 21 Mar 2013 21:59:52 -0400 In-Reply-To: <87vc8ke4os.fsf@mail.jurta.org> (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 , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@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 From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 22 20:48:45 2013 Received: (at 14013) by debbugs.gnu.org; 23 Mar 2013 00:48:45 +0000 Received: from localhost ([127.0.0.1]:41372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJCdZ-0000HS-Cc for submit@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 ) id 1UJCdX-0000HL-2R for 14013@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 To: Stefan Monnier Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: JURTA References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> Date: Sat, 23 Mar 2013 02:44:07 +0200 In-Reply-To: (Stefan Monnier's message of "Thu, 21 Mar 2013 21:59:52 -0400") Message-ID: <87a9pv2be0.fsf@mail.jurta.org> 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 , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@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. From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 22 21:12:57 2013 Received: (at 14013) by debbugs.gnu.org; 23 Mar 2013 01:12:57 +0000 Received: from localhost ([127.0.0.1]:41389 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJD0z-0000pZ-C3 for submit@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 ) id 1UJD0w-0000pR-1n for 14013@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 To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: JURTA References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <8738vowa1i.fsf@web.de> <87k3p0cle3.fsf@mail.jurta.org> <87d2uscjeh.fsf@web.de> Date: Sat, 23 Mar 2013 02:49:37 +0200 In-Reply-To: <87d2uscjeh.fsf@web.de> (Michael Heerdegen's message of "Fri, 22 Mar 2013 02:28:38 +0100") Message-ID: <87ppyqyld2.fsf@mail.jurta.org> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@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. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 19 17:11:19 2013 Received: (at 14013) by debbugs.gnu.org; 19 Apr 2013 21:11:19 +0000 Received: from localhost ([127.0.0.1]:60721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UTIaV-0002Ci-Gr for submit@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 ) id 1UTIaT-0002Cb-T2 for 14013@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 To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <87a9pv2be0.fsf@mail.jurta.org> Date: Fri, 19 Apr 2013 23:06:29 +0200 In-Reply-To: <87a9pv2be0.fsf@mail.jurta.org> (Juri Linkov's message of "Sat, 23 Mar 2013 02:44:07 +0200") Message-ID: <87obda5iy2.fsf@web.de> 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 , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Juri Linkov 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. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 19 21:54:29 2013 Received: (at 14013) by debbugs.gnu.org; 20 Apr 2013 01:54:29 +0000 Received: from localhost ([127.0.0.1]:60977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UTN0X-0007U4-9H for submit@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 ) id 1UTN0U-0007Tt-TJ for 14013@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 To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Message-ID: References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <87a9pv2be0.fsf@mail.jurta.org> <87obda5iy2.fsf@web.de> Date: Fri, 19 Apr 2013 21:49:48 -0400 In-Reply-To: <87obda5iy2.fsf@web.de> (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 , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@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 From debbugs-submit-bounces@debbugs.gnu.org Mon May 27 17:09:35 2013 Received: (at 14013) by debbugs.gnu.org; 27 May 2013 21:09:36 +0000 Received: from localhost ([127.0.0.1]:36847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Uh4ff-000096-95 for submit@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 ) id 1Uh4fd-00008y-2J for 14013@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 To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: JURTA References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <87a9pv2be0.fsf@mail.jurta.org> <87obda5iy2.fsf@web.de> Date: Mon, 27 May 2013 23:50:07 +0300 In-Reply-To: <87obda5iy2.fsf@web.de> (Michael Heerdegen's message of "Fri, 19 Apr 2013 23:06:29 +0200") Message-ID: <87bo7w6tc0.fsf@mail.jurta.org> 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 , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@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? From debbugs-submit-bounces@debbugs.gnu.org Mon May 27 19:01:32 2013 Received: (at 14013) by debbugs.gnu.org; 27 May 2013 23:01:32 +0000 Received: from localhost ([127.0.0.1]:36892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Uh6Pz-0003t5-KS for submit@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 ) id 1Uh6Pw-0003sm-CC for 14013@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 To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <87a9pv2be0.fsf@mail.jurta.org> <87obda5iy2.fsf@web.de> <87bo7w6tc0.fsf@mail.jurta.org> Date: Tue, 28 May 2013 01:00:00 +0200 In-Reply-To: <87bo7w6tc0.fsf@mail.jurta.org> (Juri Linkov's message of "Mon, 27 May 2013 23:50:07 +0300") Message-ID: <87mwrgav0v.fsf@web.de> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) Juri Linkov 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. From debbugs-submit-bounces@debbugs.gnu.org Mon May 27 19:49:34 2013 Received: (at 14013) by debbugs.gnu.org; 27 May 2013 23:49:34 +0000 Received: from localhost ([127.0.0.1]:36922 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Uh7AU-0005Y6-0a for submit@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 ) id 1Uh7AR-0005Xx-M6 for 14013@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 To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: JURTA References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <87a9pv2be0.fsf@mail.jurta.org> <87obda5iy2.fsf@web.de> <87bo7w6tc0.fsf@mail.jurta.org> <87mwrgav0v.fsf@web.de> Date: Tue, 28 May 2013 02:45:03 +0300 In-Reply-To: <87mwrgav0v.fsf@web.de> (Michael Heerdegen's message of "Tue, 28 May 2013 01:00:00 +0200") Message-ID: <87vc64yogw.fsf@mail.jurta.org> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@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. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 19 20:33:51 2021 Received: (at 14013) by debbugs.gnu.org; 20 Apr 2021 00:33:51 +0000 Received: from localhost ([127.0.0.1]:52402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYeKt-0006Ss-Cg for submit@debbugs.gnu.org; Mon, 19 Apr 2021 20:33:51 -0400 Received: from mout.web.de ([212.227.15.4]:47411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYeKr-0006Sd-45 for 14013@debbugs.gnu.org; Mon, 19 Apr 2021 20:33:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1618878822; bh=jvvbfPaT5/Cz6vLpgja0kH2dgsNqs5rxEMVUTsmYQQ0=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=iGByPC/Fodh30CLEjmCEi7GvFfHmqfetDtjT1kTnirk2Xcm+PcISQLuJVxRf4tO2X 5390bh9lw2JK4M0NlgaI+4MvqxzZCY0TTv2QosOnbnrRTCFUWN8pgsHyCYgKp06Vaz sDPU5HQQ+CEt9PoDAUHuk8DXQ8kqxSE3i7tW7oe4= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([88.67.96.191]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N2SL5-1le3nF113v-013kaw; Tue, 20 Apr 2021 02:33:42 +0200 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> Date: Tue, 20 Apr 2021 02:33:41 +0200 In-Reply-To: <87zjxxsd6c.fsf@web.de> (Michael Heerdegen's message of "Thu, 21 Mar 2013 03:24:11 +0100") Message-ID: <87tuo123ru.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:K2A755C2tNv4pGw09835KqR4x7OHgwLU5dwDpzaakggEPtDCsKd Ge9cmX5Rch7ge6D4F2jF70Y3dfPBExlQAtu3dfOnNyUTkaZFEFHr0iN3FC7S0EWSJpOV93I 2Q9+KOsa71bLPrI08SU0RV6yW0LZac4+86DmS44qF/xw71NkNrBIOkPt6RZgafTS/S9d//D M5L5paUN2y2P49hj2m1Og== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:vxlkF1qLmo8=:qOho8pHIV2zIW4gUoVjy44 /bQyAyNc1HIrA9T+BH/qMR3nBQsGO5yzgDhUFAVihnA+fGpG/sDI4lO4icdpmAghMsc/sq34p wrE29M+pJ0yQTEXYUFMYWP7BIgFqE2UonYrsK44czTObnFc+xmCXvXFEIwWhJZm2twiJfMM2R mtbWgxFi+7mBu5/1H3wnP55WaJTjSygLB5o+NHamtXasDU3xMt1T/sjgNbgkmte2+la/o5FQc wyeN8xlg76CP5enwbXs2sF/8E6sKUZcXT2NOWzbi7yuwCkeoR3k2oQr2CtD49xYF4hDTbI26F kDOq12IUkDNoTBgbB8kIgo2/r8X51sZUa3oFOeg9cEsDBLozqcTztsEah94YoVKKPy7JwurFD 92u1vtbhSVvxTOqbd6yywcqHlpWffRSR/Ov+wX++NATVXxDI/kwANJpnakMYLA3KSXVivu8J9 o3MnIF35xNA8N9r6Nmm1Ccwf/vytaEJOJaVcYSR/mUo61JILGsWRSlyanWeg4oEiAOiq9yodT TTNNvqF+dhOU/iRuU4/AXuoI7SJbhqKW1AOwm4aV4IhqNAUTMi899N6Fqp0I7El+oiQplRbsi azf1xwrniBphYC7m6Sav8tnOGuRn280TKBxV6kETAoowyZIas/8+quxjKrOEEKuKgccrVhs9V cqJ1w+Ly++1MuYzVbYZvJ1O8fvq9vJfMrVqdJi7iy73eaUS3+oRfs98AI3f18BI2Gb0CkLVZe KhpYB1+VXrmeybxd3jtQcXeCJ4ljFlY3AKZRD4zmFS1EMtGyMbZCFTzLkITIIG0QqceVEbyRt VvFuugsNEYxUpDeTlI9+Qcogho9h2qENLHgDsVkw4ytlrYs5AgBvWwQ0+3QSKw3W6m523sXoo WPWWklfSvmaNqqe9RFxODluCNrATKDUhyVnkBm97m6vM0kpZIGkSPxW5byOmPUVjlUBnLFSkC nemoAq5KJNkHpvfcQLnV6AwoV5qVhV42l/6crUqSNpxfgL/6569k7Z1CZ6ZovqkWWHC44PzF6 SRQtjxBhKd0PcJJSTpwL0AnFtA5TDVg+H1Ra1xjdDs2VY5HN0wxGLBO47ELH4bj+g3Xw1VANN VjJ7/6ZweCr+CiVKMwSO5TvQl5iPLJhJNX/zS6xb5/zHc5A4AvBel++O9U5J/0ARvzUSC1Xt+ 6VcsZ/sMYxY8EP/VppVAZVIPwLr2wQeGxc+xNG+8nuffbAN6Xl9IBUx/ewKPfw9m/zLuESoaz dbq++ngtfDtKc1ZOq X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 14013 Cc: 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Michael Heerdegen writes: > Right, thanks. Now I'm beginning to understand how this code works. BTW, one (related) thing that I found problematic over the time: I like to use query-replace on file names in WDired. There is no way to match the beginning of the file name - right? That's sometimes a problem. In this situation it is even better to use dired-isearch-filenames -> nil because then I can match the space character before the beginning of the file name. Regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 20 15:23:14 2021 Received: (at 14013) by debbugs.gnu.org; 20 Apr 2021 19:23:14 +0000 Received: from localhost ([127.0.0.1]:56042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYvxq-0006LP-Bi for submit@debbugs.gnu.org; Tue, 20 Apr 2021 15:23:14 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:51147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYvxp-0006L8-7T for 14013@debbugs.gnu.org; Tue, 20 Apr 2021 15:23:13 -0400 X-Originating-IP: 91.129.102.166 Received: from mail.gandi.net (m91-129-102-166.cust.tele2.ee [91.129.102.166]) (Authenticated sender: juri@linkov.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 40B3EC000A; Tue, 20 Apr 2021 19:23:05 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87tuo123ru.fsf@web.de> Date: Tue, 20 Apr 2021 22:22:22 +0300 In-Reply-To: <87tuo123ru.fsf@web.de> (Michael Heerdegen's message of "Tue, 20 Apr 2021 02:33:41 +0200") Message-ID: <87eef4ep75.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) > BTW, one (related) thing that I found problematic over the time: I like > to use query-replace on file names in WDired. There is no way to match > the beginning of the file name - right? That's sometimes a problem. In > this situation it is even better to use dired-isearch-filenames -> nil > because then I can match the space character before the beginning of the > file name. This is a valid workaround. Maybe it could be mentioned in the documentation? From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 21 20:21:59 2021 Received: (at 14013) by debbugs.gnu.org; 22 Apr 2021 00:21:59 +0000 Received: from localhost ([127.0.0.1]:60110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZN6U-0005JQ-Pv for submit@debbugs.gnu.org; Wed, 21 Apr 2021 20:21:59 -0400 Received: from mout.web.de ([212.227.15.3]:47977) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZN6S-0005JB-Cq for 14013@debbugs.gnu.org; Wed, 21 Apr 2021 20:21:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1619050909; bh=f4LhhG/TJhAgKmS/ywFawYFYggafvJ/ry8jZSNioOFs=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=BmpfJRo3nrr1yQhzZDBFBEl/+KlM16tWBUV2b0IdRjuRWi/utRJr5uGnseC32bXQp IyLCZg1e80ZtqqPN4QRhzGFSAg1gKYjCKhTtJrQ3/DuvPCnL+W03DZ7oYmSNsdny// pfc2Kskn283tHec4rsKUSWI1l9tZPpCTODI9NYqU= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([88.67.96.191]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LfRiT-1lFljg24e9-00p1yK; Thu, 22 Apr 2021 02:21:49 +0200 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87tuo123ru.fsf@web.de> <87eef4ep75.fsf@mail.linkov.net> Date: Thu, 22 Apr 2021 02:21:48 +0200 In-Reply-To: <87eef4ep75.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 20 Apr 2021 22:22:22 +0300") Message-ID: <87k0ov9nj7.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:LIQVNilJwT0W+XF4HMRhLItvqz+NFw1qMHY3QNf7yYK3leTzpCF +uJR9KlaeGNw/bypwptKLWSoWrVoBe4eiwFIF/saBRfImZsnyofwRi+3ssPsOG2TYckdPZ+ zeGEgbLC+5PsyOrh6CoUKhESL/hA2LjNka2dmlUrUrp/5IuhoVOh1LSpum1VJb0PxaxgUIF YEf91bzlFXLa35aIYSrsA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:VUJrozRvxpY=:7U5C/4vzFcnCkw3861lqna Dobwc5fK/2oA9MBCkTX1ArQLc9HStVGLsGhTE9IzgPj0Hduu4AORNSJgn72mcOWcn5Zy+GPg4 AAT03uznXKV5fz9kHtaEhGupUtBL6FFSmvSISIvsoEiNVFUP/8usYExjZMzzhmMsLyRv3B7B2 xiDa8/ACL9LOMhCCWze+g0CORNTJG6B/GX+MOwrJk2CK9fDVGzUqA3Kza30m5McA9fRGp9hIO DtzFYc7rS6HAv7SoWnPys+im1YktKAdd/SAWtIcXihO3me2DpOKx/1hRYe9HxMKpi2E3KgQJO NMEVYMoO4LxgsgPG+lS0i7UBBIq+0FST/3fHfXJbrl2PZZxuVx24Th13EZCNDfxu7LazCk5Sg OFyYgCt5Qjjp0R15tdGnL4lnAeObBYZy+wzTkhlJGXtaPk9Dr7KHq761Z4xraY/ER81MRTZwD bDtsb5IJTXo9TzsoYb6hWDftH0/0UmeenEIKbZvPuJAVnTkJNcW46Mornrnvl0XlhPSdtEjnm i8ipYw7NVJAINzQ3HraJZwe6PVyf6P/qYTNPO5CppF3/eobzutEq/RhtVsZOfqhSWS459BaKv HtWdkI8suGdf0slOjIY8iik77tq5RAf0fYGB83EaBmjRBK9CtrvB38N0iiMee7UuH9WoIt/Jg xaLIRsUVWt6M2keo0i2kfTgvqssL0+7gKPKPRmv7Ki0h9TfKwA3oJfMKJKb4gM3NlFNZM0AYh ROM1OXdYk669spMZO5wjR/P0uAZxqylW0+NETRbNzZF29YR03r0Jg/E74WAWzqAQhUPDU8y1h BNStgdMMRGRjydknHkWIagb+k3yU1a8lxUNca8ZuBO0VZg+yKzLHRtrH/hZ/S7bLKyzAdaDx+ XOMKmiQgXOv2ugSz20I179ow/nUEyY8vidtntJBktefxMnE/QI2KsPubTBMF0UhHuZWDkGcNE 3dqBpYFA7JCteIFV7UDcmxM9CFtOq4RpmRzcZMHm9u5PSFkbFLTq+B6NbNsM/dDoF53iQ6Baq Qygp9UIet8phKy69pYUNu+8kOaseIgkGAg2W6PVbS+aCEqBxb2RSwUwFeY0FloQoDE23OWfB7 nitnR0G4XkV9U+/SWC9gVvQQZ0fWGkrMG+UOJ80J4v4ztlOn1YEIkEUnWJsuewl8pJEai2pcF K1BmpHihKCq+noDsqJg5skH8j+V0fTPw+caojO8f86vbFxkpMn6XGRpjtSYLLlE2q7hr12wOv xaUG9FwVa4+deF9WV X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 14013 Cc: 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello Juri, Do you ask me? I had hoped we somehow find a better solution for the whole complex (of searching and replacing file names in Dired/WDired). I don't object to give such a hint, but I don't find the approach very... aesthetic. Regards, Michael. Juri Linkov writes: > > BTW, one (related) thing that I found problematic over the time: I like > > to use query-replace on file names in WDired. There is no way to match > > the beginning of the file name - right? That's sometimes a problem. In > > this situation it is even better to use dired-isearch-filenames -> nil > > because then I can match the space character before the beginning of the > > file name. > > This is a valid workaround. Maybe it could be mentioned in the > documentation? From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 22 18:09:59 2021 Received: (at 14013) by debbugs.gnu.org; 22 Apr 2021 22:09:59 +0000 Received: from localhost ([127.0.0.1]:35743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZhWI-0001WG-J0 for submit@debbugs.gnu.org; Thu, 22 Apr 2021 18:09:58 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:57611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZhWF-0001Vy-5u for 14013@debbugs.gnu.org; Thu, 22 Apr 2021 18:09:56 -0400 Received: from mail.gandi.net (m91-129-102-166.cust.tele2.ee [91.129.102.166]) (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 36A38240002; Thu, 22 Apr 2021 22:09:47 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87tuo123ru.fsf@web.de> <87eef4ep75.fsf@mail.linkov.net> <87k0ov9nj7.fsf@web.de> Date: Fri, 23 Apr 2021 00:51:32 +0300 In-Reply-To: <87k0ov9nj7.fsf@web.de> (Michael Heerdegen's message of "Thu, 22 Apr 2021 02:21:48 +0200") Message-ID: <87v98em2ff.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 14013 Cc: 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) Hi Michael, > Do you ask me? Yes. > I had hoped we somehow find a better solution for the whole complex (of > searching and replacing file names in Dired/WDired). I don't object to > give such a hint, but I don't find the approach very... aesthetic. I intended to continue searching for a better solution, but when I tried to perform query-replace in Wdired, it fails with the error: Debugger entered--Lisp error: (error "Match data clobbered by buffer modification hooks") replace-match("to" nil t) replace-match-maybe-edit("to" nil t nil (883 890 #) nil) perform-replace(#("from" 0 7 (isearch-case-fold-search t isearch-regexp-function nil)) "to" t nil nil nil nil nil nil nil nil) query-replace(#("from" 0 7 (isearch-case-fold-search t isearch-regexp-function nil)) "to" nil nil nil nil nil) funcall-interactively(query-replace #("from" 0 7 (isearch-case-fold-search t isearch-regexp-function nil)) "to" nil nil nil nil nil) call-interactively(query-replace nil nil) command-execute(query-replace) This is something new, maybe caused by some recent changes. But I can't find anything suspicious in the commit history of replace.el. Do you see the same error? From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 22 18:18:09 2021 Received: (at 14013) by debbugs.gnu.org; 22 Apr 2021 22:18:09 +0000 Received: from localhost ([127.0.0.1]:35765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZheC-0001jX-QJ for submit@debbugs.gnu.org; Thu, 22 Apr 2021 18:18:09 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:53220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZheA-0001j1-3V for 14013@debbugs.gnu.org; Thu, 22 Apr 2021 18:18:07 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13MM97PB063277; Thu, 22 Apr 2021 22:17:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=irF0awxACKANSQK0WDDLL2YSTvEWCyosqAprDbvG9Ps=; b=gp+SdFHPcjON1XeR3cD2qwfQv3oQpB3LPVFBGZzI2uuy/HKsqlK3ytErutFmiLCqk5UW 6GUX0hJBZbSX92C6YYxwKoETBGlmFFYaAh+qd3A+hI3zarcyCiap07gKh7peKpqpLUzT 8FBC6WZUB44Zi0xO8h0YTy32w7J9Md9cDwfm4RBxxSJZPUMBAdH5qmBfIYc/lqyuaNQK PDqdo4ORPqoXKE3h7sfAm91j+oqL/+CDhbJtgKhdSNz3PfnSPzTBte0g1BDdJumXTNUH 0w4U965LVp5TQI0PaipK35x+J8ppBxuKyIB/czSiqLCdDFnkzgmMBwU2dt4g81mBmh4h aA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 38022y66j4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Apr 2021 22:17:56 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13MM9sc8021420; Thu, 22 Apr 2021 22:17:55 GMT Received: from nam02-cy1-obe.outbound.protection.outlook.com (mail-cys01nam02lp2054.outbound.protection.outlook.com [104.47.37.54]) by aserp3030.oracle.com with ESMTP id 383ccex5b0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Apr 2021 22:17:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GZPR7ZgoF2tNx65MpVffoRDsD2Q8A1oTB3cYKFwYuwYpOG6gfilck6PDVIL0HvrhpYWEXmqbfB65O2z0pin4WMbK1Lt75yAKIFjMZll6Ye2rPJt8p4Lj61HSSu9pM9mNZ/w3dqK3I02gbEVnJvd1UELsziVzaUKQ6WuR9EHw720rP66vprVu1U3jk3ER3jcRKlftznqNmp3WnAVIY/3NcBul0tiKO9LMEcE6HPQXZCUktgnyKg6fds54AkOOtISQB1Au2J1WLNoYc8/Di4EYXRN3+F3DaE2PGv7F8kNocOXfdcx8qjmT/aMLd8X0jDBtRTg9cb5rOOt1tpD90QbAsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=irF0awxACKANSQK0WDDLL2YSTvEWCyosqAprDbvG9Ps=; b=keGkU/PZfM2jQpt7l0fo89Z/6OMq8tkCnw7gzoX1UVALJqOJD1OfcGpWI1kRNE0RxQmWXycJ9IXlMLqw+oPqRFTSFVu58a6XYNc/VwgyAclohA/dQI8mBzBKWuMDGlKssFF+g6zeqjaV01Q2ICkVtQJFPvyytGldT2lOp3axoYoHNjgphhGtAf5MG+wYiiVgBjLSMHQlpGyLhtFJFlrVlvJts1mdyZePNc7At9Ubc2OCE3C0QO6h9R/nF+b0EQhEY6jIYbRYAwLeO7Aj0y0D4/2hqB69DkGYbeSAZ45a2mekOuTrkxoi9mRV4Yj4FXUOLS2WSnYNIzFgZ3WtbL6vDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=irF0awxACKANSQK0WDDLL2YSTvEWCyosqAprDbvG9Ps=; b=YuCDJ7x4EGK2M3nW8af6jtTHf7++QcDLRN1gLVm3N3xvjl4F2LkHKoU+2ILVJGBgG4AbkXx1tC7br0Zx7+o6FaMa9cGLjmy73Wy+bqr3t+okuiXS1h7AU+uN4VcPweg93O64XO0qBjZ4C0i9t9wQK2xs9tQTZ/7TLaw2dBbkKjQ= Received: from SA2PR10MB4474.namprd10.prod.outlook.com (2603:10b6:806:11b::15) by SA2PR10MB4490.namprd10.prod.outlook.com (2603:10b6:806:f9::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Thu, 22 Apr 2021 22:17:54 +0000 Received: from SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::2109:9725:fd4a:6494]) by SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::2109:9725:fd4a:6494%6]) with mapi id 15.20.4065.021; Thu, 22 Apr 2021 22:17:54 +0000 From: Drew Adams To: Juri Linkov , Michael Heerdegen Subject: RE: [External] : bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Thread-Topic: [External] : bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Thread-Index: AQHXN8Go2saAFCoet06KSpzhRcy0u6rBGh2g Date: Thu, 22 Apr 2021 22:17:54 +0000 Message-ID: References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87tuo123ru.fsf@web.de> <87eef4ep75.fsf@mail.linkov.net> <87k0ov9nj7.fsf@web.de> <87v98em2ff.fsf@mail.linkov.net> In-Reply-To: <87v98em2ff.fsf@mail.linkov.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: jurta.org; dkim=none (message not signed) header.d=none;jurta.org; dmarc=none action=none header.from=oracle.com; x-originating-ip: [73.170.83.28] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 25025442-2a81-4aaa-9b99-08d905dc79af x-ms-traffictypediagnostic: SA2PR10MB4490: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1169; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: n00ZENfV258VSmDjq53ypd9aJE9aMicqQ7IO0T70LsI1n+YzrdYDauB+Znw/QJArnNYZnKdJhxA3GyhAU1gejghN0mpTGi+38PS6p907ShhPL9MWLAuR1jyquzSdBgomUes7xRXpXFm5dSePX+r7dZT5MTA58yYwAH5v2OcMg8Ss+5yub7iPWKGjPP8G2ZKsgLi/nv8Qg2L1TTinWiLdRUQ6BUXjczcgQ9zRKYL77fgOWd2D3ByxFdGq4/aPXNEYa9u2FlQ/RPQPG22jRVeJID8MclCHmFKfAEnEECnX7R/zGh1vEHpXAUCP9hkxojNh5xUC6ZZXY8ZkX2mD8F/ue4X1+MS3sbn79u8qeiAwqRGhjwsmjumCHB/HfL30xGMNjmuN2NNTVeBLBN5Ox4i+0vQCRKAk1DbMYl0p7EAaPWES5fWzM+QUPH+e0sCmmlfqgYY0niZbpiiABt491VE0CwS8YFnuSkYvDNBOw6E5tYmk6gT8eM8dGQ6ksM9T3lUUkJLksU8L3aeNx/EWmJUJCEz8XkANOlfFo3WsjMegLgc3a6zy5BVHa6O3Z8/Ppt4JhxhP8u6pNnvA/Dmn03s1roaDNh1SxXSxeRhweHTLSWo= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR10MB4474.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(136003)(376002)(346002)(396003)(39860400002)(66446008)(186003)(86362001)(52536014)(316002)(26005)(5660300002)(71200400001)(33656002)(66556008)(66476007)(2906002)(4744005)(64756008)(44832011)(38100700002)(122000001)(7696005)(83380400001)(6506007)(76116006)(66946007)(55016002)(9686003)(4326008)(8936002)(110136005)(8676002)(478600001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?5A66JgSvusQNEw7MdtsjII6P79B/eEi0Yz4X9loZ245p2lVjXg+9NLyNish0?= =?us-ascii?Q?C/SLslIYhcnjs9+P/L6fvxRn0ts1avPmi5RaV1Ut/nC+mCpXRfmpBNgpLToN?= =?us-ascii?Q?L4T6i9z4IeynIC2Ju7KV8wrzBR4vtScMP7Udir720nUHkZFUFHSwMWYa1qFu?= =?us-ascii?Q?OU2MkEcB1TQdwrJduZ7z6whKJVoSPNT5leEzT02s7kMh8EXH9JkFLH3yual1?= =?us-ascii?Q?jS/v7KLlMSjc+6vbWMp7Vm+Ei9rcWWinr+REKPQEDEoKvBIMhDi2jpRrg+cF?= =?us-ascii?Q?NVAs2+CEwBM3ploo5OeGp/+b0YIhm19uQxYAseUT8yI2jwNQ0FzF18HE0dRi?= =?us-ascii?Q?kx1AhA3uQtaznW/hR4uvLjh4aic2y/WZJZ6tIwcZE9z71iQgEH9I05FK3uGd?= =?us-ascii?Q?9rYx56CWnVQ+SvrDDdeeygyljStCJbZKiXhTbhWJV7B0Qf8rMI/v89exPfjd?= =?us-ascii?Q?Bv5KOzrQR8C93ILl07neDI4OBwnLZXEfZu3B2vBEgaOecgwOOSuEOgCgtrJy?= =?us-ascii?Q?zVYJxCUOlkDzEP3ttd4ROuneIEfEPT/YNr7MtdWWU8PbRNEq717CBuvYcaez?= =?us-ascii?Q?mF6J/K0+y6UHv+HznatGb6uSU/Cv8UryX98PkQgqBhjJFJfcnOp5yVn9y71E?= =?us-ascii?Q?l9kIFjx6sPGE40m6h4GDRXQ74A8H5Fjx4Og0sVRxzLUYsPgax9xDhg/xVwTY?= =?us-ascii?Q?sEJmrqgDGNAx2pfH0O9DLRK2REtmt14nt560ETff6Lcr+9ZCje9wMt3zDFMX?= =?us-ascii?Q?h9GVMAjXtU4jU10/ViWftUAyAGkhF7bxaSr7SY3IgM9VDvKoFQtSNlTVsgwJ?= =?us-ascii?Q?tBqmdPRR/sb1RgkP3UvR1SzW4AGx78TZZQ4RWkeHWnNVqNhQGebrgsbZIaH7?= =?us-ascii?Q?0Lzl0LLHwJp+soKaMqx9sT7pTJF3OVmdn3xcsSsGkJlIofR/BVAbbGie+whA?= =?us-ascii?Q?QeCDYdAlYNvCDnIkKsykLcxVE//mSYF5kEWVsVkLfJxO7p/wb8IaoBwRE9p8?= =?us-ascii?Q?I7fCU8sWzX80kMruh0L0SFn5FPSMGPtfvKSf1QMaoKJIMunjSByU/f81Yucd?= =?us-ascii?Q?OJ0RYMQmOnjUIBKnXiF4BlD8qrDErRYGITY5edae/q8iapmm0oc0TU4Iq9IV?= =?us-ascii?Q?aPd13CYsIBjOcAHVNDDezVSGDOLsTMBn33R1RDs/LhI00BZZMLIVP6f+ohVk?= =?us-ascii?Q?4lCJGvMP5nxxHKpyapF4vgFkxuxIv4oM90Q4c3AWUoZGEVwOqEBAHKTKm4od?= =?us-ascii?Q?9rs6zXZEGELcP5uwnIdFK9rpiWYHRihC5NNLeU6n33LtOcQHCv6FmxPKCzPo?= =?us-ascii?Q?B3nX1QBTVhH0K/MmYpZUi6u1?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4474.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25025442-2a81-4aaa-9b99-08d905dc79af X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Apr 2021 22:17:54.0996 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: FFeyjEoTuv/F/Uq53Jdt+5TEZohaW/UHH5CkHM3Xinfm1fZF/ntxuIrLA4IhDsIuxkBzQ01WzgeM7pgNHu10Dg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4490 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9962 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 suspectscore=0 mlxscore=0 phishscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104220161 X-Proofpoint-ORIG-GUID: iGFVECRw3lnp3p0-r-VNzRolvfgzfNAr X-Proofpoint-GUID: iGFVECRw3lnp3p0-r-VNzRolvfgzfNAr X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9962 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 bulkscore=0 phishscore=0 clxscore=1011 impostorscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104220161 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 14013 Cc: "14013@debbugs.gnu.org" <14013@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > when I tried to perform query-replace in Wdired, > it fails with the error: >=20 > Debugger entered--Lisp error: (error "Match data clobbered by buffer > modification hooks") > replace-match("to" nil t)... >=20 > This is something new, maybe caused by some recent changes. > But I can't find anything suspicious in the commit history of > replace.el. >=20 > Do you see the same error? I think that's maybe something new. I don't see that, with, e.g., Emacs 26.3. I do see the problem of not being able to use a regexp that matches beginning of file name, for query replace. That problem is from isearch filtering. I see that same problem when, say, limiting query replacing to a rectangle that contains just file names (or file names plus spaces before them). That's entirely understandable.=20 From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 22 19:04:54 2021 Received: (at 14013) by debbugs.gnu.org; 22 Apr 2021 23:04:54 +0000 Received: from localhost ([127.0.0.1]:35782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZiNS-0002nE-KA for submit@debbugs.gnu.org; Thu, 22 Apr 2021 19:04:54 -0400 Received: from mout.web.de ([212.227.15.3]:34223) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZiNP-0002mx-0F for 14013@debbugs.gnu.org; Thu, 22 Apr 2021 19:04:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1619132684; bh=3yUpuG2qeu8M/XM8ZyiAsnZdc2gzreP6X6ipes5W8HU=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=l3sqAZzquDUTm15j6q0BLMQNMHb/gvc9IgUrU8obQ7Awp05hVsM/QWoP9muCagxBa ynR6p3V1KUrsNoxop1zvfIpyY75BgRxAH6aZsZxHpfviT3Tc7kmrGz8QSfzWh8ckAH i1xCA1aI5FZmy3R0jE09AUoznZnvW7wNzfu95dTM= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([88.67.96.191]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N9cHJ-1lWx570MVR-015N6G; Fri, 23 Apr 2021 01:04:44 +0200 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87tuo123ru.fsf@web.de> <87eef4ep75.fsf@mail.linkov.net> <87k0ov9nj7.fsf@web.de> <87v98em2ff.fsf@mail.linkov.net> Date: Fri, 23 Apr 2021 01:04:43 +0200 In-Reply-To: <87v98em2ff.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 23 Apr 2021 00:51:32 +0300") Message-ID: <87r1j1hqes.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:0u+QlM9dpUUy7nbXxQA2QPdhnn+h3bnY6TEXxC9QQmLsQ4TtbuW 7S3U+BKlyjjqGOVHxzX+GBR8ptt0L2eiIXVfiD4USLTkL3/5JcwDIgXW+DBF/6e9W5oapoY bVGjQomGut7swWdJIekhNTr9gzkfqdX7h93Q1j/U4l3820FA7zq9shtof2Su+Q2F2sTV5TJ jzX8jfVwZ1gammdmsiTzg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:cof/YZLfRek=:Gw01+R0UxxrMmxBvWHdjta bFGJIF5xwvqgU/vXHi32fVWJRtngS8BlPrwutj6IxlIlT5rUiGe3ltYGzu6Cv2Zg8GugIsp3y BMya1Hm0OnDUeDnrGESx5S8Je5uYN37p+b3mwrhAUAEMW9ZM2COg1wYRx3OkbAaxNu//Ar42q Jp3pzUCWssu9V56p0u9Slu0FG4R4WFss0GiLuggoj5XOhhHMW8c0AZTrdLW5Hbe3PXUaKXX9n SNMWNZbLbLU6e3SdcEO64U+2NGScOvugbIxfjxdeED9O9lKAofEdLPYuY7VumZIAPfoi292Lk JEqXXYiDA3dfZHAWOLYMY9k/oPrgWWMGYqxTfcVKkp3H18WqP41V1PdMTyTEZzrTAsdSdUR/K 23n0MF4fNuMMuAOjBBNM6ZR9sD6uHfXZI2aQKlue2gBCFx+0TbbQqX/NG1bx8xTmnDe6z1LvD Wq3WBrVZBMN5kSOhZhtyI+gX6a3VhNkjG1hi20wkFuzu7WfPk5fzpa3TxD5DB9O2donDI6SCM kH8mDzjPZtuUPv9m7KgD2YCVpxArgVqnyqK30Uwd7A1vsWJ0YqtK014Ht6DKhQK4ovTbti0BR ZJcL3/+5+5KV9XeP8+E2zpqF0bnUQnjITCVOks5iG80USJaFHBEn2EeyNwhr7+cnUjxG+Os/0 +nqWfpGfBBXyZXdCe1e+QYyXLf4F7Z6QU7v2/UDIwCqNYbkCBrHEzC638AGJOKd/lHw4NazRP /fYUrYtyo1zrJxp42CXLFvWKGLm59q8PUWW7d5To7yHK6jslg+av9Po369nmBmSQmnPhcdcty ijEopq9J08NYXawoLyENjXq2ZjpIicWrYNBUAQzcqWul+wVi4UsgB8v3xCZlGEBbFz9MreiOL kF3TRl9jZBi9zTzSU2udeT8Vtm/yREMOqy5+MKwBsxuTkXuQvU3ylXCGGoTz8BdNuD/J7LBwz Yl39qLhDmOXKrIXw9F/INGS+W4OXdRt4oLP0/+7mo8Zc/eBv8WP8sXgJj2SeJd5C9jVMDdS7G AzP6Xv1qEbC5lYFzm//V8uPy0H5YnWnuBFkds1vspIe3CC7umKw4FZ2oOIgf/ddiESvteJqMq W6z22CNrdoSj/r1Xnq/djvDjwngKdj+6yOsmQwqIX44zu7vlj5GzAJUmUaR+7kAoG1ykXOU8O uJ7Q3fQJgVVSTmR/uDObyrD/u6hopO7RXI5fOLCj9wLy2k2XfN0TgqPb7VfLVRR/NQMdTrcYi NMhoHbRMCpWoLzK9F X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 14013 Cc: 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov writes: > This is something new, maybe caused by some recent changes. But I > can't find anything suspicious in the commit history of replace.el. Yes, I see it too indeed. I guess 4dbc44550d * lisp/wdired.el: Apply text properties lazily could be related, especially because the error seems to happen only once per file line. Regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 22 19:16:25 2021 Received: (at 14013) by debbugs.gnu.org; 22 Apr 2021 23:16:25 +0000 Received: from localhost ([127.0.0.1]:35797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZiYa-00034e-Vp for submit@debbugs.gnu.org; Thu, 22 Apr 2021 19:16:25 -0400 Received: from mout.web.de ([217.72.192.78]:47097) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZiYZ-00034O-2N for 14013@debbugs.gnu.org; Thu, 22 Apr 2021 19:16:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1619133375; bh=dUr2jgMwsCbh4fvVHGLBhqkzF42jM3km5lEUeH/zk5c=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=U3VRlv9ZzVoVPedxnIt424m5uek+czs1vyQRjlOt65KZ1zDs3TFTivCb+vXrtsFJ8 TzoQ6cBTc1lw0Q4AV+7eVLIc7zpgb+jFCaH1V2FLqRGOwOXX29gb11ErLQAPcEb3pI 2/q7UF/B9eQZgdkEPBzSo769t7dLwgldFLyhCdfo= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([88.67.96.191]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MeSKR-1lypwO0zYl-00QAY2; Fri, 23 Apr 2021 01:16:15 +0200 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87tuo123ru.fsf@web.de> <87eef4ep75.fsf@mail.linkov.net> <87k0ov9nj7.fsf@web.de> <87v98em2ff.fsf@mail.linkov.net> <87r1j1hqes.fsf@web.de> Date: Fri, 23 Apr 2021 01:16:14 +0200 In-Reply-To: <87r1j1hqes.fsf@web.de> (Michael Heerdegen's message of "Fri, 23 Apr 2021 01:04:43 +0200") Message-ID: <87mttphpvl.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:TQ0mzDMV/P5JzjhX7zHH/s9GTiosr19bNlv87PnAi2/kF3YKIVA 7yCdSck6BBWfxvwOdqDzOWqrM2t3E7OGvAk6bILr2SeJ8oUFTxsw8nPOsZd6E9Olzyf5DA0 nhJfZxP/2cmgEH024GHhC6v5/chCmkSiPi7my9OUWtxNnhm+9J+NZqPfY3RBkiQZEpnP3bw vLpNB2okE5rh0ZgQ4Ow5w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:bPKiFX4S7No=:3HxJBeHFPslWlc/0v0JH6Y mlwJOSFI71x5m4zKoxrPfuv1EMbhzBi+SFd0WCAMVosAu5T48hVrMlvJXNFQ5CroFNlywKbRC 6X3yZGdXM1My3i3iWx3DHOb6OcWMz+ToRuYMsgSekdaY6yPpuHyIWCikaFPnPROSYMn+i1AWk tuaQhPxrveXieHfgQLgafkyvJnPe7IQKGHEprr9m7T3Jyhx60nCQ6F8jlFSXTunhj/bWU2HH8 S0mMjUeUYOaJ6B6ZoDjpU9trWaA/VRGCWSH3lH4MH9rPFeH5jC/3TLy3CaMhMf/TR8Wzi04Sn yj0PETdjHUpHwwsJNSINEPZ051qpixvXf/yLOwkbFc4ybCk6zmGeVk6A5hIBAJd995s8OBDe2 0XUl+6Ua9LnIc0qWGnt2LBgwAF3QtG0IaT0tN6M6Z26jfkJ2ENPBnLYqrETAuoR/EmaCVLB1Y ZnJ8ZUm2HB1Hu1XOjEVBpc6ltE5Rq04zsgW/2rwsts9V/o2wsIzuy8JTcPKu0wInEp1TAfTI3 BRmKFJESu8uznwvSp/seCr4sOxzIHIi5SBNo02QYTiiF/5EopiQNCKnGwC3ol42jXaZmpV9pw y8JPOujn3GHH7xFfFf7eZHzcrv46abEA85RPbkqLyugTUMDFTMMgB2VfQC9qisBct2oujf328 sMwQxrCqpJ+lOELQlrGSuwBVMt/bqswCCjU7NB4ipK1WzDm4k7hXk3gv+JDrLihLUgK+fWLmt 4xnUtBDQGFWkbX+qp09ZfmeuNloY8sa6+M42KyJzoXDvKAnlZRXieR9DK7nUiOaLPsxkh4G9O TylTlbZV4nkq2znvCuCwfiq+E3vS1nu3N5qeolj/j57yhjJ5OgYwViwuAiAmVwI89qMqeUgje 2TDhJoAYFni8PmZ6ziN7hSFpS0cdrL2VlgK9riY2gnQ5e6feUV9WYQb0tICefa+Ei78CfV2AL 6QWKYYRSkYLaMT+MtvBlFMr9VPVnKBWX3cJStfCM/mRLdOCmOQg5+PzYtXt/SrmxECWW7XAI5 fZfvAri5kBC0jMKEFzMYVc4oguytb7JO5MIW/YFqZaeJ4Hlj9X8rbyR+jD+KQ21RlSYJskT6q 637l15d9/lJzh/WJjyTWIH9au2F+zN8BW43Kc61iIO63FT11NNFj2lG7DRaoOqriFcM/GZd+T t4C51kZak25e5bSXfKMgVMX1JH50C63N6aEnQ895g35d+OSErhNWQd5wmVUjXjcf3XY79OwZK Hm0vX0Kf/YYORPwlx X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 14013 Cc: 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Michael Heerdegen writes: > I guess > > 4dbc44550d * lisp/wdired.el: Apply text properties lazily > > could be related, especially because the error seems to happen only > once per file line. Wrapping the body of `wdired--before-change-fn' into `save-match-data' seems to fix that problem. Would that be an appropriate fix? Regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 23 12:53:23 2021 Received: (at 14013) by debbugs.gnu.org; 23 Apr 2021 16:53:23 +0000 Received: from localhost ([127.0.0.1]:38693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZz3T-0002Cr-6X for submit@debbugs.gnu.org; Fri, 23 Apr 2021 12:53:23 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:48193) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZz3Q-0002Cc-Jm for 14013@debbugs.gnu.org; Fri, 23 Apr 2021 12:53:21 -0400 Received: from mail.gandi.net (m91-129-102-166.cust.tele2.ee [91.129.102.166]) (Authenticated sender: juri@linkov.net) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 0715210000B; Fri, 23 Apr 2021 16:53:12 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87tuo123ru.fsf@web.de> <87eef4ep75.fsf@mail.linkov.net> <87k0ov9nj7.fsf@web.de> <87v98em2ff.fsf@mail.linkov.net> <87r1j1hqes.fsf@web.de> <87mttphpvl.fsf@web.de> Date: Fri, 23 Apr 2021 19:52:51 +0300 In-Reply-To: <87mttphpvl.fsf@web.de> (Michael Heerdegen's message of "Fri, 23 Apr 2021 01:16:14 +0200") Message-ID: <8735vhgcyk.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) >> 4dbc44550d * lisp/wdired.el: Apply text properties lazily >> >> could be related, especially because the error seems to happen only >> once per file line. > > Wrapping the body of `wdired--before-change-fn' into `save-match-data' > seems to fix that problem. Would that be an appropriate fix? Thanks for the fix. Now installed to master. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 14:36:27 2022 Received: (at 14013) by debbugs.gnu.org; 8 Feb 2022 19:36:27 +0000 Received: from localhost ([127.0.0.1]:48713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHWHr-0007ZT-6t for submit@debbugs.gnu.org; Tue, 08 Feb 2022 14:36:27 -0500 Received: from relay11.mail.gandi.net ([217.70.178.231]:56289) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHWHo-0007Z9-Ox; Tue, 08 Feb 2022 14:36:25 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id C482E100003; Tue, 8 Feb 2022 19:36:16 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87tuo123ru.fsf@web.de> Date: Tue, 08 Feb 2022 21:32:44 +0200 In-Reply-To: <87tuo123ru.fsf@web.de> (Michael Heerdegen's message of "Tue, 20 Apr 2021 02:33:41 +0200") Message-ID: <86h799jgrn.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) forcemerge 14013 29215 thanks > Michael Heerdegen writes: > >> Right, thanks. Now I'm beginning to understand how this code works. > > BTW, one (related) thing that I found problematic over the time: I like > to use query-replace on file names in WDired. There is no way to match > the beginning of the file name - right? That's sometimes a problem. In > this situation it is even better to use dired-isearch-filenames -> nil > because then I can match the space character before the beginning of the > file name. Like was discussed in bug#53758, xref uses ".*" to replace in results where search/replace should be performed only within boundaries of matches. xref uses own search function: (replace-re-search-function (lambda (from &optional _bound noerror) (let (found pair) (while (and (not found) pairs) (setq pair (pop pairs) current-beg (car pair) current-end (cdr pair)) (goto-char current-beg) (when (re-search-forward from current-end noerror) (setq found t))) found))) So maybe Dired/WDired could use a similar function. But in any case it seems matching at the beginning of the file name with "^" as also requested by Drew in bug#29215 (merged) is still impossible. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 13 14:09:38 2022 Received: (at 14013) by debbugs.gnu.org; 13 Feb 2022 19:09:38 +0000 Received: from localhost ([127.0.0.1]:38891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJKFe-0007V1-8U for submit@debbugs.gnu.org; Sun, 13 Feb 2022 14:09:38 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:55645) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJKFc-0007Un-9a for 14013@debbugs.gnu.org; Sun, 13 Feb 2022 14:09:37 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 078BA4000C; Sun, 13 Feb 2022 19:09:28 +0000 (UTC) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> Date: Sun, 13 Feb 2022 20:59:30 +0200 In-Reply-To: (Stefan Monnier's message of "Thu, 21 Mar 2013 21:59:52 -0400") Message-ID: <86zgmutwx9.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Michael Heerdegen , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) --=-=-= Content-Type: text/plain > 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)))) After a short delay, this has been implemented now: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=dired-isearch-search-filenames.patch diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 41c45b4e51..f1d0f9e225 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -3140,11 +3140,11 @@ dired-isearch-filenames-mode When off, it uses the original predicate." :lighter nil (if dired-isearch-filenames-mode - (add-function :before-while (local 'isearch-filter-predicate) - #'dired-isearch-filter-filenames + (add-function :around (local 'isearch-search-fun-function) + #'dired-isearch-search-filenames '((isearch-message-prefix . "filename "))) - (remove-function (local 'isearch-filter-predicate) - #'dired-isearch-filter-filenames)) + (remove-function (local 'isearch-search-fun-function) + #'dired-isearch-search-filenames)) (when isearch-mode (setq isearch-success t isearch-adjusted t) (isearch-update))) @@ -3168,12 +3168,34 @@ dired-isearch-filenames-end (unless isearch-suspended (kill-local-variable 'dired-isearch-filenames))) -(defun dired-isearch-filter-filenames (beg end) +(defun dired-isearch-search-filenames (orig-fun) "Test whether some part of the current search match is inside a file name. This function returns non-nil if some part of the text between BEG and END is part of a file name (i.e., has the text property `dired-filename')." - (text-property-not-all (min beg end) (max beg end) - 'dired-filename nil)) + (let ((search-fun (funcall orig-fun))) + (lambda (string &optional bound noerror count) + (let ((beg (and (get-text-property (point) 'dired-filename) (point))) + end found) + (unless beg + (setq beg (if isearch-forward + (next-single-property-change (point) 'dired-filename) + (previous-single-property-change (point) 'dired-filename))) + (when beg (goto-char beg))) + (while (and beg (not found)) + (setq end (if isearch-forward + (next-single-property-change beg 'dired-filename) + (previous-single-property-change beg 'dired-filename))) + (setq found (funcall search-fun string + (if isearch-forward + (min (or bound (point-max)) end) + (max (or bound (point-max)) end)) + noerror count)) + (unless found + (setq beg (if isearch-forward + (next-single-property-change end 'dired-filename) + (previous-single-property-change end 'dired-filename))) + (when beg (goto-char beg)))) + found)))) ;;;###autoload (defun dired-isearch-filenames () diff --git a/lisp/wdired.el b/lisp/wdired.el index ab3b91bbe5..573e125bc8 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -217,6 +217,7 @@ wdired-mode (error "This mode can be enabled only by `wdired-change-to-wdired-mode'")) (put 'wdired-mode 'mode-class 'special) +(autoload 'dired-isearch-search-filenames "dired-aux") ;;;###autoload (defun wdired-change-to-wdired-mode () @@ -238,8 +239,9 @@ wdired-change-to-wdired-mode (setq-local wdired--old-point (point)) (wdired--set-permission-bounds) (setq-local query-replace-skip-read-only t) - (add-function :after-while (local 'isearch-filter-predicate) - #'wdired-isearch-filter-read-only) + (add-function :around (local 'isearch-search-fun-function) + #'dired-isearch-search-filenames) + (setq-local replace-re-search-function #'dired-isearch-search-filenames) (use-local-map wdired-mode-map) (force-mode-line-update) (setq buffer-read-only nil) @@ -438,8 +440,9 @@ wdired-change-to-dired-mode (remove-text-properties (point-min) (point-max) '(front-sticky nil rear-nonsticky nil read-only nil keymap nil))) - (remove-function (local 'isearch-filter-predicate) - #'wdired-isearch-filter-read-only) + (remove-function (local 'isearch-search-fun-function) + #'dired-isearch-search-filenames) + (kill-local-variable 'replace-re-search-function) (use-local-map dired-mode-map) (force-mode-line-update) (setq buffer-read-only t) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 13 20:14:18 2022 Received: (at 14013) by debbugs.gnu.org; 14 Feb 2022 01:14:18 +0000 Received: from localhost ([127.0.0.1]:39235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJPwY-00020U-Ic for submit@debbugs.gnu.org; Sun, 13 Feb 2022 20:14:18 -0500 Received: from mout.web.de ([212.227.17.11]:37323) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJPwT-000208-2L for 14013@debbugs.gnu.org; Sun, 13 Feb 2022 20:14:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1644801242; bh=VvBe0JCoI6Y6wZ+uWecCHl99kk+RbEkVCtWQHSa0Frc=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=ioj+vwwRxdsbdBEJzAx5ycPPBKwmqax1GSm3ZXOIQbO+a1eWYwuo8iLN31n1WZEg4 +/flw1QOdjCLbTXxZDhqxVLvv3Yuk6Kogf34+NM/Oe1qL+CJQaI4Pf3EDm0dcqjae1 JMGHeKvAdhqpBqHieA6aH6GdOtTJ0ofFblq+GYJs= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.60.174.212]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1M1JEu-1nHlFD3T2o-002krE; Mon, 14 Feb 2022 02:14:01 +0100 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> Date: Mon, 14 Feb 2022 02:13:58 +0100 In-Reply-To: <86zgmutwx9.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 13 Feb 2022 20:59:30 +0200") Message-ID: <87o83ab67d.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:0fhZM6aESlbsz3KfVB+nfV8nZ/FlX4t9Q1DxW0K9pzw9OatTLzi IEc8psRHMgfNxwQrNOd6bDsJ1OmoyAQpUZAfMdy6NYO3TW1xI3kxndr8rTWEgZEpPE5hnds tnhTntXluiRzq52j+3HUTPqjBaIU7EtMz+uVBxwXRVsXbGCa+L2DZRwdTLf41HesaojMg1d hqxsDSnCDZmRrIds9yWTQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:JBqwCvGVPFM=:Yi8iDApHRHA9BmCxDUk12q xWM+/pxPMIYHTK29QQa/ZZembX/152ybxtuNeEIWkPYou8SNNVUfl6bScoG7XBoahfSF9+akU 3VNqXtoHlcINGJTP8j+/7fsR5aVEVMcuMiaui/i1XVfye7Rgl83TH0WKYVY9aMaoLV9OyL2C5 SimmMsUAo0mOir69CH/iY2vKYYQdwUgUk8DOdscU1o0JX2sG+KfBrZvLjrQkFLxVQoSRo9f58 SzbGwK6X3m9hZ79QoFl0r3XHFDNJNMMmubP8mltd5dDMOKfrqliMvlwKOrvavZ34GE9bRdXi5 /8ttHi02hTd5Ivwxj0uWr9ceXeULg47sh9SLyX8xnfmK1aA88d+6uq4SHrq+1gKaYMNKcOE/D Q0f+FnOE73QhoY6ujKnIJz32nxGIf7HhIxfGkBDfJdIYDTUKuzpgMU0+R4EJtyLlZwRr+b8Es iTQc7xeBMk6OjDzrFdkoqgmQVPiD2LshOSKku2rOgHxD3iXbJl58uR+xW5/G01pmYWKKb0dOv PUvuQYbZmYF+ZXUuZxgJgnN4vdstTblnUBF8OCe+3U+f9BQ1ZQMMsE9rDOODPankir5ISnjtC SstfRdAHZLaOtrEE0WBBmwLHiXwofo7HJGXvsgcckQ5lQx9fo40Qs33BQneU2iiGY1RtkkBf5 AmuGyh1RDHME565PHSeYPIYmPfUJZjXGEgrnfMc7i5EOilFAKJpFXe5Q1HcvVK2PuwnFOhih1 0c9NSew7bZfCOw6MkzCTr2YnnyZPIfZr1xTG+HL6n4u2auNtQHMIxrOAS3ud4U75W0scpbdVn f1SzapVKbJhxEJkIAPtOqXsbYNZA4JZ+SmyZ44cN0X9LUbxqJA7mJgRd663sTG+Va5suHHjWM h1Wtgdl5YPNq77tOF4HxgRzLOafTKa/fFhJe6Zlv5XPEpqEy+ScmimVM23A79Fmt6P9Klcjpx xXlwnwPPt1VzWzNWo288u+LDrlKIzCyAZWzYzwIHfJPtldq+XiE7rz9/0gv6EsbuTrCmppVm7 wuxhMDo2mAYxU3CwusAJGkzd8oKCIEWSywaCA3yFwS54fBG7piNFn+ZcgCaMgxaQ7pz0H8zcs bnkWGwHEzoA3S8= X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: > After a short delay, this has been implemented now: Thanks. I quickly tested your patch, and it seems to work well so far (except for the ^ thing fo course). Also highlighting worked. Anything particular I should keep my eye on? I only noticed that if we keep the patch, the docstrings of the touched functions seem to need and update. > (defun wdired-change-to-wdired-mode () > @@ -238,8 +239,9 @@ wdired-change-to-wdired-mode > (setq-local wdired--old-point (point)) > (wdired--set-permission-bounds) > (setq-local query-replace-skip-read-only t) > - (add-function :after-while (local 'isearch-filter-predicate) > - #'wdired-isearch-filter-read-only) > + (add-function :around (local 'isearch-search-fun-function) > + #'dired-isearch-search-filenames) > + (setq-local replace-re-search-function #'dired-isearch-search-filenames) And: Is it intended that this is unconditional (I would expect a `dired-isearch-filenames-mode' test)? Thanks, Michael. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 14 02:48:37 2022 Received: (at 14013) by debbugs.gnu.org; 14 Feb 2022 07:48:37 +0000 Received: from localhost ([127.0.0.1]:39629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJW69-0003iN-Cc for submit@debbugs.gnu.org; Mon, 14 Feb 2022 02:48:37 -0500 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:39665) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJW67-0003i5-20 for 14013@debbugs.gnu.org; Mon, 14 Feb 2022 02:48:36 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 161B1C0011; Mon, 14 Feb 2022 07:48:26 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> Date: Mon, 14 Feb 2022 09:41:04 +0200 In-Reply-To: <87o83ab67d.fsf@web.de> (Michael Heerdegen's message of "Mon, 14 Feb 2022 02:13:58 +0100") Message-ID: <86r185520f.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) > Thanks. I quickly tested your patch, and it seems to work well so far Thanks for testing, this confirms that the proof of concept is viable, so now the docstrings could be updated as well. > (except for the ^ thing fo course). Also highlighting worked. To implement ^, I see no way other than special handling: when a regexp begins with ^, then after removing ^ from the regexp, call 'looking-at' at the beginning of the file name. > Anything particular I should keep my eye on? Please help to decide how search/replace should be implemented in WDired. The current implementation filters out read-only parts of the Dired buffer. Should the new search function also skip read-only parts or should it match only on file names in WDired the same way as in Dired? >> (defun wdired-change-to-wdired-mode () >> @@ -238,8 +239,9 @@ wdired-change-to-wdired-mode >> (setq-local wdired--old-point (point)) >> (wdired--set-permission-bounds) >> (setq-local query-replace-skip-read-only t) >> - (add-function :after-while (local 'isearch-filter-predicate) >> - #'wdired-isearch-filter-read-only) >> + (add-function :around (local 'isearch-search-fun-function) >> + #'dired-isearch-search-filenames) >> + (setq-local replace-re-search-function #'dired-isearch-search-filenames) > > And: Is it intended that this is unconditional (I would expect a > `dired-isearch-filenames-mode' test)? Currently it is unconditional when it's using isearch-filter-predicate. So maybe it should be kept this way since it's what was used for many years? Or is there a reason to change the current behavior? From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 14 08:00:07 2022 Received: (at 14013) by debbugs.gnu.org; 14 Feb 2022 13:00:07 +0000 Received: from localhost ([127.0.0.1]:40154 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJaxa-0006kn-U6 for submit@debbugs.gnu.org; Mon, 14 Feb 2022 08:00:07 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:4742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJaxY-0006jT-3N for 14013@debbugs.gnu.org; Mon, 14 Feb 2022 08:00:05 -0500 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 1E60D10018C; Mon, 14 Feb 2022 07:59:58 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 83F3A10008C; Mon, 14 Feb 2022 07:59:56 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1644843596; bh=dHbFE6SJdimC/v63MkVC7A2oQNids84VI6Xb19nbmrY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=hS6EgYhbcuFu+UVvXlf//oGEQpJ1sGMb6GbuKlZl2o7JX5kbNDgYD/hTuBItkr+q+ qu4VMLvZ507gdpsSb5d1DC5OR/pI69bBFhmZQGnosFcYJYKQInfQmkiiG37wP07yg2 eAD9Xl0xhwqegQ5AP+tH1Ef6N+Onj5xg7txkwYxjj1WxkMHwOcK14kj8OX6SXZ+oEl XUXOUoQHOyqC27fHgpxV4nOH5ftIlHCjJ/eHdwZ0N45KAOWlsZljI64KGLUxBelbkM DD+zc5EnOxVlGZ2Z7gkLXOB3ZPvwOrt6NVtiZORvcaIAeFI5B3HNbN00X5DlE/Y10T rJu8CFHcYjPeg== Received: from pastel (unknown [45.72.237.157]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 421BB1203D6; Mon, 14 Feb 2022 07:59:56 -0500 (EST) From: Stefan Monnier To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Message-ID: References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> Date: Mon, 14 Feb 2022 07:59:54 -0500 In-Reply-To: <86r185520f.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 14 Feb 2022 09:41:04 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.045 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 14013 Cc: Michael Heerdegen , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > To implement ^, I see no way other than special handling: > when a regexp begins with ^, then after removing ^ from the regexp, > call 'looking-at' at the beginning of the file name. I don't know if we want to handle ^ specially, but if we do we can use something like: (while (string-match "\\^" RE i) (setq i (match-end 0)) (if (not (subregexp-context-p RE (match-beginning 0))) ;; The ^ is inside a char-range or escaped or something. nil (setq RE (replace-match (concat "\\(?:" directory-listing-before-filename-regexp "\\)") t t RE)))) -- Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 14 22:12:55 2022 Received: (at 14013) by debbugs.gnu.org; 15 Feb 2022 03:12:55 +0000 Received: from localhost ([127.0.0.1]:43188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJoGt-00010k-B8 for submit@debbugs.gnu.org; Mon, 14 Feb 2022 22:12:55 -0500 Received: from mout.web.de ([212.227.17.12]:38847) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJoGq-00010V-9w for 14013@debbugs.gnu.org; Mon, 14 Feb 2022 22:12:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1644894762; bh=hJyNNi+7mvq7Iyx7V6pWmlmr8FPobJWmRewgba1KN2U=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=V2SUu4UXETIgTqgFmvz9//gAhCnjM74GlMmdaaxYsIzD2fG7cu9RNo3ZjnLlD76Zz Ui9nXCOoYGrjS0vbjVU8vPv9R4xm3z8rDojIaB2SNBC4R3nMeB6OqUQefo4TdgKp0Z QS1tQ/Xf+JrIzkOR0QniNh07o51BClHNVfEX3iZE= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.60.174.212]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1Mav2X-1nq6wj1vuV-00cMig; Tue, 15 Feb 2022 04:12:42 +0100 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> Date: Tue, 15 Feb 2022 04:12:41 +0100 In-Reply-To: <86r185520f.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 14 Feb 2022 09:41:04 +0200") Message-ID: <87sfsk961i.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:LO8Kh6ry0pDkuKxS+D0OpNw8o48eviqr71YoJQ7xzSD0ZX2RGK9 qNBalu66WD4SQSPUydrwi29KNLwFs0vF1hkpCwtAKqYotcMFgUDesex+KVZL9S6GtIO4tTn z5bXh6HpQoT0KK/rQUQM87uupI517rYBGjUUmJit5sE42YnqQ/9rfz+bmQ4fdGkXVMM/wBi llf3syXeoPwYcLsVNxUQQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:fWpGB/Cw+/8=:1nEVEwc9dYhOKmg5cexFkS aSms75fEI2exZRBqpQrx6UrwYuiQ1QElabH/alByxmO1SzJs1VKFokw32rH2Szp4rLWJHhG+b WLC21jI9vz7FI1CKwCMyrDBWrozUjzjvVfShRt/6Gmb47AMKKyQR88wU0YqiiH/EevQc/PpL1 Tg47D0oiYy7zpDjgJttzq0W3wwj3ULRAiKOwlX56wtmTFv+2jPJpMOsBTu37av29/yIHNmIf2 qjcgV/l1z0BiR/GPmiX/ALJLi5S9xXcwPfTnBYpMeCVlcMgTf7fdYgdGFBvAtNI8vFLIRiUNs SUxT+iBNlhIZmMIiszhTtrk3TdR79cedf89/20A5uMwhKv/mInz5k0DovHsi7cKdC8axNctGf 9xurT1pwujv92BeVFhdP1yXYrVYiKHPcBKN24E3WJs5d2+HkOg2xLdLl/EsEyMo8tgNHwj3sS YOUZ+4/U7dTE8nBup/p5yvkPYYIOs3Ev/mQqAsOvVIVcBZhDweumyH18LycExsUo651HwEgtk ynBpfelZYLYr+UdSzOajDmIEKMGRP7PwTUX0quoRwCGjbFURG/kyMDMpmfHCbDE/5wnqqk8TR bGlM4CO4eHQB0Ponytjh3t8HXf///Ru31u7b0fx/MOWHKln6vyOHpGCFPNHUH3VU/r6/1Z3dx 5Nnb1TKmSnOOU5QhYFzGf8bfKCcVccS7S+/2qveXjmcAZnCHo+tZuYbAtgaePT3XieP+/SSIL IcsKV8OHkxZpA/L3bi+SSOMZTXdN05WScdgTROAhLjso9St8hSt7OEAiIp2/Vo4bxd0wiqJ10 ODl0eMtC7qtFsENu1Fx4vprZ5/sMk/OdiV6ICSo1W211fy3ZbW+DaA2W2Vi8Xyvpi+2ytNl2d RPcvfyc0frZvAMfNyOUG9Su/yjPZg78OdAKzAY0dNrFeCOZTtTOfc+mBJn8oiGt0yKpieIfPP NArLdMOn4K1Kekim8GnCq5M4Q8hoZ+jqSfGK4ZYL/xSFr6NwkbjW3cdbvhml2PSVBYxk1a26F K0ebOkJTtDAoXLxntC/wa3Hfgkf9F002OaU1pvkVJd5xR9rqFmwcP3YtzU+duroF0sCmSt5PL zl6O8jCJ1VhhNM= X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: > To implement ^, I see no way other than special handling: > when a regexp begins with ^, then after removing ^ from the regexp, > call 'looking-at' at the beginning of the file name. Just an idea: Seems that currently \= matches the position at the beginning of the file names! Could we maybe just guarantee and document that? If \= works reliably, we may also transform a leading \` in the regexp into \=. ^ is not so important in my eyes, it's easier to type than \`, but the semantics of "beginning of line" is not as clear in this context as "beginning of the object searched". If \= and \` would work, I would be very happy. Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 15 14:30:57 2022 Received: (at 14013) by debbugs.gnu.org; 15 Feb 2022 19:30:57 +0000 Received: from localhost ([127.0.0.1]:46490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nK3XK-0004TM-6a for submit@debbugs.gnu.org; Tue, 15 Feb 2022 14:30:57 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:34057) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nK3XI-0004T5-8C for 14013@debbugs.gnu.org; Tue, 15 Feb 2022 14:30:52 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 6008B1C0003; Tue, 15 Feb 2022 19:30:43 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87sfsk961i.fsf@web.de> Date: Tue, 15 Feb 2022 21:25:06 +0200 In-Reply-To: <87sfsk961i.fsf@web.de> (Michael Heerdegen's message of "Tue, 15 Feb 2022 04:12:41 +0100") Message-ID: <86leycoszt.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) > Just an idea: Seems that currently \= matches the position at the > beginning of the file names! Could we maybe just guarantee and document > that? Nice finding. This works reliably only because the search function puts point at the beginning of every file name during search. > If \= works reliably, we may also transform a leading \` in the regexp > into \=. ^ is not so important in my eyes, it's easier to type than \`, > but the semantics of "beginning of line" is not as clear in this context > as "beginning of the object searched". If \= and \` would work, I would > be very happy. Since ^ is easier to type, maybe both ^ and \` should be transformed into \=. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 15 19:57:09 2022 Received: (at 14013) by debbugs.gnu.org; 16 Feb 2022 00:57:09 +0000 Received: from localhost ([127.0.0.1]:46790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nK8d2-0004r0-Qf for submit@debbugs.gnu.org; Tue, 15 Feb 2022 19:57:09 -0500 Received: from mout.web.de ([212.227.15.4]:35329) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nK8d1-0004qG-0t for 14013@debbugs.gnu.org; Tue, 15 Feb 2022 19:57:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1644973017; bh=udoG3cbC+11KAuQFljWOn2HuD2dVt2d2fLa9lfhj3/s=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=JiKhQtJPuMPsYUamprHI4h1cFrZxtPrd9t7jo+yRcjMCu2HFYE07PvCvAziozXT5/ LBtGDdGYqwwPuT2cT955fqMQkJgA4QfXLOK4iOzdu+psMbHQK3NY6snyHJRwb4t2ra og01WsQj0SnuVUIhEneW5M3t8MPfveRFWOpcQcM0= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.60.174.212]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MALeR-1nRaLq1cEt-00BlDl; Wed, 16 Feb 2022 01:56:57 +0100 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> Date: Wed, 16 Feb 2022 01:56:56 +0100 In-Reply-To: <86r185520f.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 14 Feb 2022 09:41:04 +0200") Message-ID: <87czjn39yf.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:45RsPkcnhL0WmlKXR5bPqFCYwyQGiecHwVz3PA0fJDSISLPuYas 82R1WdXXAbYQEhS4gb9SxNjwBrVxQ9byuLn11615KRzhaKVc7Knt7t27ZQGVMtP4CTJ/fdK YJSFYOlXs3tH4XgFuHIv/4SMeplDppXjuikL9T/cdiez7FeDzdA3PhK+oS5gwWdLY0yYa87 wBmqNVZHs3XXc5yJRkT4w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:xGjVUBFODIQ=:KLZwAOlyM7M8gXs+3SQya6 RKHLVGhfjwVIEOyAYuPoHkDI7WMf6YFtKBzcputlUhMO3LgxyxV1WXm8K+w5AX5q1Vc1H/XyV OMLxdqJLDU3G1THnzUbzG6kZhFLEgzEKnXRZMo6eJY0b1Rgk79ApgKd14RQS0VKg28b7e4A9U IwcFFeegQvzu8rFEXYow+Rv8jpeP0c1CHKKrj+2P5M49cNUjTI0yTELDqYoLnFNGn+oZK7dMu GBpJRVMEI3cgGwzoeFMea28xiwN6vrX2c8oU18CwrUDMj1nhWWyUUqa7ej+XXQJqCPOA4youW QOxX3vQGr9laGLCS8aOydFzc0OE3W0tbFOLxMV6y79fnbJ/IklBz0ZbTMJE2jP+fJAHjO5Zpk yvEXTbImTy/mhvmcgBgQTY5cDkBuL9C8dMVM7f8gel4n1CbFzrSsp70afMGxfR58tXbzCz0ai KgUde2lje2+6bmYnDIbAXJtxxCStoukQjDxDsdN4yJiBGvkdYR/xuVFj4NfeaOYJCwoml2HRW 8DrqEsg4pPpKbIkHVKu6xOWGJfQBpxm8D09agCbn8r/QYpYX36zVvE6gY6idpcUsdKkMoJsPU Fh2/oZrlYelYBKJEUtz1qEOJvW8H6d/Kv/ju0i8VYbWr88x5N7oWiv7YAZG0mmQbilWMqVk+j RE9ZWf2RO0uygF5It0emov7quwX1U0CcJgzbc8wbeiu7vJeQ4YkyefXtUe232T1/2lxU5ZoEv /FPz/qdlILEyiRjLrBNAwF+qqVRyCbi8DravSrWHbdlhmkUcMxW54SBQmJvUr+CvYRlGNRq0J BEvW1dcIs2KDOmjA4kI8Ow1A7M5O62b8t5N7PlgoH0H+mMo/uf9RF+pb9vx+mBq8qRQneJPB9 NcmkhL4M3EIk+rfZBFCGREtkFUy82EqTokhHuNHVMz5cM48nOh5c1ZLaVjjzyEy2V9TCikJ2M HEcJzV5uIdn0MVbiEI557fwLyZ+lNxdyIXFgSOv0qZe9FTnzmAzLPWO7vX4YFO7tiNA7hsnAn Kw4ocwlS2fcA0Iw0hhSyRQ1Gqi455UEX5LaubRfoCcitWQHGh28Him5+A+20k4l8cO9hRWhHp dQRcWmt82Jd93I= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov writes: > >> (defun wdired-change-to-wdired-mode () > >> @@ -238,8 +239,9 @@ wdired-change-to-wdired-mode > >> (setq-local wdired--old-point (point)) > >> (wdired--set-permission-bounds) > >> (setq-local query-replace-skip-read-only t) > >> - (add-function :after-while (local 'isearch-filter-predicate) > >> - #'wdired-isearch-filter-read-only) > >> + (add-function :around (local 'isearch-search-fun-function) > >> + #'dired-isearch-search-filenames) > >> + (setq-local replace-re-search-function #'dired-isearch-search-filenames) > > > > And: Is it intended that this is unconditional (I would expect a > > `dired-isearch-filenames-mode' test)? > > Currently it is unconditional when it's using isearch-filter-predicate. > So maybe it should be kept this way since it's what was used for many years? > Or is there a reason to change the current behavior? Ok, then better let's keep it. A different thing: I found that | + (setq-local replace-re-search-function #'dired-isearch-search-filenames) is not correct - of course, `dired-isearch-search-filenames' is a higher order function (used for the around advice), not something suitable for searching. With the patch installed query-replace in wdired errors. What's the correct value - the current binding of `isearch-search-fun-function'? Thanks, Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 15 20:11:30 2022 Received: (at submit) by debbugs.gnu.org; 16 Feb 2022 01:11:30 +0000 Received: from localhost ([127.0.0.1]:46813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nK8qv-0005RJ-Sz for submit@debbugs.gnu.org; Tue, 15 Feb 2022 20:11:30 -0500 Received: from lists.gnu.org ([209.51.188.17]:44628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nK8qu-0005RC-KE for submit@debbugs.gnu.org; Tue, 15 Feb 2022 20:11:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nK8qu-0001L0-Cg for bug-gnu-emacs@gnu.org; Tue, 15 Feb 2022 20:11:28 -0500 Received: from mout.web.de ([212.227.15.3]:58237) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nK8qq-0000ZQ-5d for bug-gnu-emacs@gnu.org; Tue, 15 Feb 2022 20:11:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1644973872; bh=8kosQ65kxmHhq4BZbeb2tEHCAGUf815LSBDZTpASY3E=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=USPi3IfMA224PV+gBTnwlvYWk+2vQsGuUzX1HKTk76ryRf9a1kVLJ9XBPporA2URP cnZomh+AxVEBoh60NCimESRRAfJoerMVul6B+HZBQ5NGLkqLwF5Wb51WByIh/hUpKd PQqldWKDP6cRV1dVZGA7uIKRCrnOcsL25BI1mrLg= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.60.174.212]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MxYbN-1oDUSH0NUv-00xZwJ; Wed, 16 Feb 2022 02:11:12 +0100 From: Michael Heerdegen To: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> Date: Wed, 16 Feb 2022 02:11:10 +0100 In-Reply-To: (Stefan Monnier via's message of "Mon, 14 Feb 2022 07:59:54 -0500") Message-ID: <878rub39ap.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:5DdIqMt6Rhl98bnyhxKoGaMozSWdMPmYMtMmkbWBM9r6O/Un5/I bPjGTrol0ogVYT/4bxVJtGkmuTl1gfhE5r6BeZsoIO7IeOwE2YPRCWOb3aP/73fEb/GTh5g jbifCIYvPhinzg8M8afYk2Vw+0v4J1lhR3iWHunPwqj8C8aUnq6Q+zQ/ACoTG92oGLgzuqP nklkhqT4Sky8Ox7TlYwsw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:+Rs0EulFtck=:m89T4E1mfB6edXTZHRbnvd CqgtMWXUj5G5YclD3o7SBvDheq8Mtj/dIwz/6irv0hW3VvqKbcGeATSRfpGh/sIfcQeyZjQPq lm+AOdPxZ0fgVgxllym1uLnck9ZpfOnVwuDa2rXdkEO/wmtMeBPXlYagdkTwvHccw/cQcQu60 EIJ1jiuoHWzx2Oakc1byTf7P8kBNfWfD1vKbbLsfmK+S4mixc6MCczVX5J0ucE4Nv05j7uqgZ uK3Q9UZExrgfJvLrgf3wtN8+3jgybRJA7k7Vli4VAr4fDFdbprQj+h9MgmrUIqqhpSk+JEwKG e7jqo2K3rKPJjY6wXTz495joKU7lEncFevU0rfMXU4qk8dcN2xwtqxKDtX3ayqINpGixceSxF uhxM5F4elogT/ugLkU5m2ZRxtJn94VbC3Tb6nGEunEAJWy7NL4Xmopk7Mla4tuy9Q4yc+ypmS HjzbRUq1YlVLzxRRY7qLxVszQiiE2q/xRvlU7vwy/OHgnrUOOUl/5kqbOpx3SawsW6ue2tgZZ IPnx8K46R+WeNHU830h1uqq9W6aCTNuNQbc7pYzHRUywkIYCKSXATxAkwOgksEQBpg3YF5EST YtMIaVLesIF7+u0Er9ZcG6Wx9ypRpYTC/GWieOXwXzYPnpWlW4OlYJQrswbth6Bjod31GMOOS u9zZjj0dJUKD2NhwrNbp0NRfbtRZCdLSdrXbM66qvuvqJhG8BYO07svgdRFeq86DL/Ex08yk5 h0wHTk2x4mqGBEUCaS9Tgp9OupHstBpMoOLJbIEdRw61gZgGHQODRDK6ST1agW8A42Le1k/sK uXfa9zhrYULTmgBNEVG30yPaUDfRaDLQS0IjJm0CQw+ZE6Ec4ZBZ9ogxZsewKnQsXBEnDD5if 0AjHjUk8OLwHFH7e+7ysd8bQOuGg29ftaPo5lqW8V9CE+BOsheZvdUkpOVI/puSnfHbByjr5k tEsYSg5sRNEusPevc33nDyDlJyMF3ArXVpyaDCW1A23/x/XlGd4TXIkrgx4PgwBFLwb3k20ph YSwqw60zL7jAZYutij4YatKR8Ia4EPzYC90ybv+m4ZZBYHVEVUVBTZgBtKEWtrfjG+dPwhjJj oNr7UouUG+yKd0= Received-SPF: pass client-ip=212.227.15.3; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: Juri Linkov , Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > I don't know if we want to handle ^ specially, but if we do we can use > something like: > > (while (string-match "\\^" RE i) > (setq i (match-end 0)) > (if (not (subregexp-context-p RE (match-beginning 0))) > ;; The ^ is inside a char-range or escaped or something. > nil > (setq RE (replace-match (concat "\\(?:" > directory-listing-before-filename-regexp > "\\)") > t t RE)))) Will matches then not be discarded by `dired-isearch-filenames-mode' because they start before the file name? Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 15 20:23:54 2022 Received: (at 14013) by debbugs.gnu.org; 16 Feb 2022 01:23:54 +0000 Received: from localhost ([127.0.0.1]:46943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nK92w-0005v9-0i for submit@debbugs.gnu.org; Tue, 15 Feb 2022 20:23:54 -0500 Received: from mout.web.de ([212.227.17.11]:50849) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nK92t-0005uU-V4 for 14013@debbugs.gnu.org; Tue, 15 Feb 2022 20:23:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1644974622; bh=aiPMpDcv1fubTHDrqUiVncrEpcC9bjxVa9a1z3ejSqw=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=EbbiJCT0XfutFM1M31PVyBVHBtj/XXH+B9o6XCtnyzKIMZeCEUAcX4gIEhjuXGGG0 91oqh2yOuTdvRAz6Ju9cgKQIdLg76ck8nC5Xtway0XJGrEZzHpha/zKV0S8P7xwZbX TmzoJTubE+6/1QwWQWVsYDLKOQwDng7WQTuAS5u8= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.60.174.212]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MTvw0-1nl3b21ply-00R42A; Wed, 16 Feb 2022 02:23:42 +0100 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87sfsk961i.fsf@web.de> <86leycoszt.fsf@mail.linkov.net> Date: Wed, 16 Feb 2022 02:23:41 +0100 In-Reply-To: <86leycoszt.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 15 Feb 2022 21:25:06 +0200") Message-ID: <874k4z38pu.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:kiUk2MyEfk/XBz8JBe5sNgYsvZ8dcFU8FjxPDA0CjIX4Y5sYoIC AIzcTUMlav0hCV9+BDcMZMZbzDzuN+hcm61NqdsOVJsrn3SZw41YQjf54E6QoNgCqtpc3uR JRZ+Su1hqPY7FCxit86FdM+iuGCMigqcV51QCnXU2NWOCc4YvhqxgfSy6Ak7ZpkD/ChvRMc G0ta/lgonc18ZHwIXO9yA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:gFoUSvIDixo=:CD/lCWTUuGFheL5tFC9EJg x6o+ZCMFCR8SEHmQB3Yrtlp8TVBq9ks2EhhpsUcouH/EHY9FnV0v5+zzYRziJH1RHB8jlkCxu nigTQlygE1M6Qvu9y3IMdm6DLIFTBIlLwsros/mw+JkrrWMIbTpPvfmcSnXTCsE+5E7d52TLM yLBHpPmWh6YrQAaiO2iXTuXEg+W/0ryoA/nYuvh6yGQTHDxfhY4R1rpDY2nZH7EfeVlHozV6K bc782nbHmGxmb5b1BlrkGpaOfniRofjXXHoppVh7U0RSs45UaXuyZUv5zUed+Bgk6hNjAAQNi q5qRhyHlJqVED1kJX7JciW6Y2O9ZybN+g97m0KuSldUJs/VcU+f6sTNmYAWrl8g/qBy6u3bBo wciW81Nmlasm2SkzzVCyYh7dOE/EYxbjjju9GT9/qI/8V2/Nycm4fDhlLp+R1Z6OKghyG7w2o 8DrHQnIZGUypMY++HLsnMdWl/wKe+wXo+CgcrPccZ7c7r7p631LxKXKFy/s6WeVNL+EtCDC/X wKxt6KNYfqMy0UXbNJxBuI7izu+X7QjEBW74sb1M+NFC3e6iVOy6yUbJeC/jmSHbvYWn9WOs6 NrPXhdEb+r7KsjLL676kjdZBpBVFBd8Y0zsWTRS2PZiFnzdkoQkKg4yr2CAxZn9ZMiFJFnOs+ 6Z5bPA254VrAssZ/KFBTHpJkfMS7sK/X9ORMW5yrvyFltjQ6GHlmGpu27c7frsbnXXasQqzkh 3IkHuaxtkm5cqovhMjMvNKuRgCw6o0Pm7p9akYPxi4aiCHtv6IoDJUlZLg7SkWlxOPT6yJ//q 6L2T2hx03dwoBqPi6ovroqyIhS1Qbn/m5tzrOpgnl3RMevTNNwt9c3cS6SVkf69hwb941kRMc z0EcMD7XPv+WLVDI8NtwkNFIY6n4mUzJeeomclPacMX9Ds9v8o0dwEL441LNTw8bebkpra2yK wg6toOLSp1wIGsQgHrNvvqxXe7e03IGjUNN2gq7GPOrqJc/rdFPWO84aGITAHad1oX/mqhMo2 VBvpTMvkY+GJ+uKy4slxScxjX6T6Pu5/ooUZDx5EsbW39gPwU209sg7Enza3EXDAKVk9M3UiV DY5aSODyE0UPpA= X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: > This works reliably only because the search function puts point at the > beginning of every file name during search. I'm not about non-interactive searches, seldom use them - can something like `dired-isearch-filenames-regexp' be done non-interactively? Anyway, my complete idea was: whenever we provide a special search command that limits isearch to certain entities, like file names in a dired buffer, we always guarantee that point can be matched at the beginning of each entity with \= (and maybe also \` and ^). In an interactive search \= is quite useless (right?), so we can use it for that and avoid hacks that would probably be worse. We would still not have a solution to match the end of the entities, however. Fortunately for files in dired $ works (by coincidence). > Since ^ is easier to type, maybe both ^ and \` should be transformed > into \=. Why not. Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 15 22:36:43 2022 Received: (at 14013) by debbugs.gnu.org; 16 Feb 2022 03:36:44 +0000 Received: from localhost ([127.0.0.1]:47062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKB7T-0003je-Ln for submit@debbugs.gnu.org; Tue, 15 Feb 2022 22:36:43 -0500 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:63602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKB7R-0003jS-Pz for 14013@debbugs.gnu.org; Tue, 15 Feb 2022 22:36:42 -0500 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 21FNJDl3003066; Wed, 16 Feb 2022 03:36:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=pV4nZDFjkmUYGfmZ28ujkhp2FFhI7MpPvcy26++vHUo=; b=Y98y0Y9apzqcVSFyYBlbUXkrxhpj22CcN+GAZOU6emMWTqH4UfNEES1yI/+06tJNxXk3 DylKG7WrAUTtJSjupluOA+Gr/mFRAWZXWj0HR4YNo5dOh/hHpM/HB9923a2HO5FSIi5f 0Mq00LWkSc+me9wxRw78I96BChxuEWxH08onjdtLBYLWF1JrMlEG60XTxt5Yim5UgdXf osw+yfaLx56AoR6W4FwgopOH12kifWm1wox/yYpVP05BRA0G/SkJ7d6VjH4moH8pUNSP h/EOf6KkxppjV6J8dnmZvoQ1yfzrch07xrEi17RDUhTakihjOA/ggNdNrlE/4IadjIPm 0A== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3e8nr90c4h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Feb 2022 03:36:40 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 21G3VRlT134128; Wed, 16 Feb 2022 03:36:39 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by userp3030.oracle.com with ESMTP id 3e8nkxkjya-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Feb 2022 03:36:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=de3emkKO3j2ObWPYsgQzfTpxpNdskNA9j0RiZtkJnnvdfSrAX/iu9Xu1rq0vqA+CzNPVtzfFiW4++BLz3g7H151OtHu4L0sTLyn44hJqMH2PvqEbXS0yIxteq2C/gr+9iOQfW+HByQR3MIitOtIbI5I+nc8t7Rpmef4tonv4kWZRo0lUhr6cJNDwsZqfv2c7Z2m80pgBiTd6OzUTO6MpsKQ4swrOG/wEa0kR55FuwiIp1ZVOydO6L9/mN7r+UBYHgWSgC6jzMOl4UEQNDSHUBkie1LtEZHXE6qam5s3WePHHhf/yactXD2UgWPcF3O1B3cMeNoGrE+CGXnC9LrFwIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pV4nZDFjkmUYGfmZ28ujkhp2FFhI7MpPvcy26++vHUo=; b=lD1RQyHzsZJ7OX/F4waKv5j145adxI+MiLSbRLqiHd0lwjjqm3KOFZJD0Xdj/n5zN2aPFhtAql+pOqGixM+taM7uz57Q2RysSdvQ6mzDRZ8Pc0VRYfcrztQv0VqaASk5iC2L9w1ozERUFsa/kHeO0RHRtR/B997TOQnM+7bhtEViuB/G0XNjpK8ibSfKM6o/4FdhNsgmTmjEwr691Kp4V0U8SSr4Vcw1mme2KbDZIGVGqhc1XzgElPWCxQI111savqKZK/7uI8dN8WFiCZMOYtdAgFMb5UdrxaxDEimD3Bc44K3QZQQAfXmi4gwCO/v9lKEOyhiFB2yqXx9BPFMLFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pV4nZDFjkmUYGfmZ28ujkhp2FFhI7MpPvcy26++vHUo=; b=rBNb+p8c16s1Bsaeccm1+xw8qYxetJcCyy1pItt84Fb/KAaCHjISMI1IvxQyu0W8y6HTGPRTWWZzyXX5CNtj5zvIDX1MY+Zo29t4EgVxyVneeAszmX3RmhpNXgWfj+7CNIEJjjZmEvjEpYmdly1w32InXnGbjpS7O8AAiH9sp58= Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by SN6PR10MB2847.namprd10.prod.outlook.com (2603:10b6:805:cb::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.17; Wed, 16 Feb 2022 03:36:37 +0000 Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::6d28:e29d:4c51:6d04]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::6d28:e29d:4c51:6d04%5]) with mapi id 15.20.4995.016; Wed, 16 Feb 2022 03:36:37 +0000 From: Drew Adams To: Michael Heerdegen , Juri Linkov Subject: RE: [External] : bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Thread-Topic: [External] : bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Thread-Index: AQHYItPU2saAFCoet06KSpzhRcy0u6yVecKA Date: Wed, 16 Feb 2022 03:36:37 +0000 Message-ID: References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87sfsk961i.fsf@web.de> <86leycoszt.fsf@mail.linkov.net> <874k4z38pu.fsf@web.de> In-Reply-To: <874k4z38pu.fsf@web.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c59ef309-d46c-4ab4-2ce6-08d9f0fd895b x-ms-traffictypediagnostic: SN6PR10MB2847:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: l+4VO9HJcLRCcINFaC2dfwXVyz9Wb6MXMOnc9KwVg6rHkTxHCjvbqEYzSi/c7FDp8pdXHcFazM3/KdaMp3D+IpMpQnNWmxUUMdZ1YrS9RB+FrX/SZms62C6UXmegTy/oukb3y0GTx73iNKEjottS35ED2Gc5dJDEFIMMvfPH+BZxa/y0BhXB6nuhQtSnS7HeHXe7DtiXYU7TznCuhd+CzOMHXp4oVlZKz+YQ72b6wMM6giFW/VZCbYEyUst55TWGQ2H8wGGDczHMhhxlzgalAUSmcrBCwVpt8OPRznm0qzXs4VR/mtDru4dyo4jNIXF1P1tVQ/3BWmFVneeN+lyL+1ODuNWKJ+XPzvDJTAWOvRhGL+kSsU2gfguyvfvTq6hjCZyVuyNjU6ePEis6hAUxMkJwpEK82K+U2cSYMoyzK4Fa4L8502J/IOw9x/PcGy8A48CvNWHT2mwxn3iBRgzyFiXQm7xqVY96Qvfy7JRLyCoh2kD0+mcgt0vssjIepXoXx1XHeOdc77RHLA5lKETR1QO/bbto5e+UXe8CW2ImRco9e2D/p5amhYCTKif5hX1LXbkAtqW6SePmGQ0RURRdTDj54NwFc2Rqg/H3KZ1HVcOmASnSVf8pYuJj9whDh9PYIM1W7cD2yNLhhq9Z43BCaigzx+wP0J4X752tTQXowtQRBYmqMR4dji58vXVl3H9iiKAd7Y7UrQpN75YPUdhFLg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(5660300002)(316002)(186003)(83380400001)(52536014)(33656002)(8936002)(9686003)(6506007)(4744005)(44832011)(7696005)(110136005)(71200400001)(26005)(4326008)(76116006)(508600001)(54906003)(66446008)(8676002)(66946007)(66556008)(66476007)(38100700002)(2906002)(64756008)(122000001)(38070700005)(86362001)(55016003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?cBrTAblLm1x651u/koEny42toX4DPYCWodteS4BCXpFIYBxMeOzVSd/0WK0e?= =?us-ascii?Q?4YACaQdNA7i5hcE1jExjkqcMyth4MV0PJKOQq8TCnlMKDYxag1H5cdLeFBS5?= =?us-ascii?Q?7H7F0sugifAYzGV6a+Pj0Mnop8ge09uOIqacCQdQ3SFqn95NCDdlqRfAcmFq?= =?us-ascii?Q?V0Pir8NtH/LpqzIOJXLfoosHjuGFZDpyHD5ic4aTyioyQ8y4CpxpDkUwlvq+?= =?us-ascii?Q?5kg8BlegtU+HrPhMtAh4EEi6LE9GQyCXjrtv8frTMFkxXDC0vtmR5qm01JAV?= =?us-ascii?Q?IBiWbGHw+WIxLyJxzNB9ZfIc6xFCWuq+XTezSVCxDB7t9sL5Abw2ahODq2d7?= =?us-ascii?Q?j5sa9Tsyjy8E5II5crHbi8PUz64dqwRlNMER4GKU1hBz++pY13RoT9VYM7M+?= =?us-ascii?Q?BsAwLoKgB7xU61sjp/RpU8dahJ4eksodPdFjbBouavMjdw34OwpTyL031VEe?= =?us-ascii?Q?Iu3ulqqq86QfLrEEOV+d5kYHg6rKK9I76V3899u9ZLPc33ZXJpbggYnn5k2I?= =?us-ascii?Q?x3Q4YrTgbRfa1KEbCovdAS2wV2XFHPk+9LSD0S7JNtKYkSn51J1nYqepBt/P?= =?us-ascii?Q?gjCzzdkpAvPgpf8jZDcnBeAoXTFYRi2usPHM0zZRrJOsqyZxZ31ZiIlHEYg3?= =?us-ascii?Q?dsVzGoZECnJZDTucYmfP/pVx1cUar+MysUDtVDjF4jIgImVm4Wh+HUlqfYqj?= =?us-ascii?Q?DdU4vNpJppHijlGyPIN8Ul4YLOQLpuYG+ZwrSyV33QOWvyz+hcuM5SAUVOw2?= =?us-ascii?Q?bIKazW7/qQbeIerUiCnFjiRFkY8c100pdAR/wOQrtsqUOgk+ebo/p490OiQv?= =?us-ascii?Q?QDg7c9Kr3mYuaVhbTx7Tmsqa5luR0DWjGBn8shO4Jy1cQw9OPfCx0TBHO9U3?= =?us-ascii?Q?LzDZUnYk4b+LnXMWvcGrH/ohk2EypLvtEOdsXKe41Lz11sdMuiHgfqE27ksH?= =?us-ascii?Q?dOthJm959YBwt51DP+N1RKZodcCsOYJzPGUWdg5BxQJr/zc9Oh/P6fRpB9zG?= =?us-ascii?Q?dUFSg8n+13X8w7VsBI6r5Jcbn0zyIh2ZozIpH18yEIi2BCX0UgtYD548msJ0?= =?us-ascii?Q?kGIOwYqtpDZwduf8UdZtPKSIc08fLmv+cGBZq3HdxVPQ1OY4pitfJC5jn+ZR?= =?us-ascii?Q?cZz1RC90sN4oYZ8anN/QEEWOeKRmSaQ8RFqDjnxQ+zSCSCiQzVm91yq/BSfa?= =?us-ascii?Q?XRzFHamiZpurVnhhr1fdAKcvhYBLgirEzVv5W7wMSy1lne4Q+DsMRB4e0fAq?= =?us-ascii?Q?zawPLS3cwHqn8NZLeV+nd64L3txnAwJwRllzx5YlEXOjYKRY5/TjIuygyzWN?= =?us-ascii?Q?sUwIfelH8QFmfirKO9YH1X0ROX0k+3SRSoLxuJOjU0hTNKg2HxlzRlQvMyq0?= =?us-ascii?Q?iLHZk/1yHFh6Uf0bINF1ZGm57BjPeR0Ibgkm5YpUmOP/7gj6qSPa01HSly2S?= =?us-ascii?Q?+JI4DL1k+Xb3tfcq6KXARhSy0tFAgYpEQXB/yNquGfo4HFNfaFA0+Gc6rj7Y?= =?us-ascii?Q?4vvb80RBODeqNiKYvyxvBhK2whsy4OzlawH9q3c7ComGuSlV0DwD9CYSI4N/?= =?us-ascii?Q?pw0ba/lPT/aejoC5r++oSAGWQP8KCIdsLAckgbnkwi0ZeFqPJ/Z/daJSI7sR?= =?us-ascii?Q?Gw=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c59ef309-d46c-4ab4-2ce6-08d9f0fd895b X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Feb 2022 03:36:37.0544 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: YtFNliMMPxHv+IS8h0Iu4ceir7xonMx5MG8l0i71cH7t5xptEB+k9KwBpPKebdIxiBpbuB91x5eN+XHxzDQbog== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR10MB2847 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10259 signatures=675924 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 phishscore=0 adultscore=0 mlxlogscore=743 mlxscore=0 suspectscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202160015 X-Proofpoint-GUID: Ac6ItAwODMyGD2fnHNrPu-Agtl-GbMbU X-Proofpoint-ORIG-GUID: Ac6ItAwODMyGD2fnHNrPu-Agtl-GbMbU X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , "14013@debbugs.gnu.org" <14013@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) BTW, I just noticed that a couple of functions (commands) in dired-aux.el b= ind _user option_ `dired-isearch-filenames'. Personally, I'm in favor of allowing code to do this, as long as its doc ma= kes clear to users that this is happening. But I thought this was a strict no-no - anathema for Emacs development. Wa= s this - as opposed to jumping through a hoop adding an additional variable= - OK'd by the priests? ;-) From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 15 22:58:15 2022 Received: (at 14013) by debbugs.gnu.org; 16 Feb 2022 03:58:15 +0000 Received: from localhost ([127.0.0.1]:47090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKBSJ-0004PA-Cf for submit@debbugs.gnu.org; Tue, 15 Feb 2022 22:58:15 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:20685) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKBSG-0004Ou-Mq for 14013@debbugs.gnu.org; Tue, 15 Feb 2022 22:58:13 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4BE88442410; Tue, 15 Feb 2022 22:58:06 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 9D925442417; Tue, 15 Feb 2022 22:58:00 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1644983880; bh=fqoE3YOBPOsOkHmalWDdwmnB70ObVb8DirYRadRVKsY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Eb/qrfE6GbruAi5k6JQwBw4mYfioO9pz8bUwxgfgIs+OJaExCcy5ygNKHhfvDwXF5 hARgKQpYrCR6whZ+fEvvqrn8lEncsAQk2IfFe3tStmiEa7Jjx6FkPd01pWb7D/hrQZ JgyZXhaRyKGqfmyHZcSqiRN97Lqb7GWx1RdmviXp4KOvfhvYwPemSI5LEBDRW9HHwe afdwmEL1VBAFRoybtrAYc55tiZUwJMjdKhq6x8jU1kXAVkbYpJNRAYQYwlfrKRUhdE sdTHMzXQVz2YYIe/H3Swm7lVfFMEqkSpuAThn6U+rO0Q0YnDvoqEDvGiVQpv2Jw1F1 8Bl+lxGZFBd3Q== Received: from pastel (unknown [45.72.237.157]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 644B21209EE; Tue, 15 Feb 2022 22:58:00 -0500 (EST) From: Stefan Monnier To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Message-ID: References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <878rub39ap.fsf@web.de> Date: Tue, 15 Feb 2022 22:57:57 -0500 In-Reply-To: <878rub39ap.fsf@web.de> (Michael Heerdegen's message of "Wed, 16 Feb 2022 02:11:10 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.081 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 14013 Cc: Juri Linkov , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> I don't know if we want to handle ^ specially, but if we do we can use >> something like: >> >> (while (string-match "\\^" RE i) >> (setq i (match-end 0)) >> (if (not (subregexp-context-p RE (match-beginning 0))) >> ;; The ^ is inside a char-range or escaped or something. >> nil >> (setq RE (replace-match (concat "\\(?:" >> directory-listing-before-filename-regexp >> "\\)") >> t t RE)))) > > Will matches then not be discarded by `dired-isearch-filenames-mode' > because they start before the file name? It all depends on the replacement regexp the code uses. I only used `directory-listing-before-filename-regexp` as an example. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 16 13:44:58 2022 Received: (at 14013) by debbugs.gnu.org; 16 Feb 2022 18:44:58 +0000 Received: from localhost ([127.0.0.1]:49440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKPIQ-00063u-By for submit@debbugs.gnu.org; Wed, 16 Feb 2022 13:44:58 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:48799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nKPIO-00063M-4P for 14013@debbugs.gnu.org; Wed, 16 Feb 2022 13:44:56 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 606676000A; Wed, 16 Feb 2022 18:44:47 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87sfsk961i.fsf@web.de> <86leycoszt.fsf@mail.linkov.net> <874k4z38pu.fsf@web.de> Date: Wed, 16 Feb 2022 20:11:09 +0200 In-Reply-To: <874k4z38pu.fsf@web.de> (Michael Heerdegen's message of "Wed, 16 Feb 2022 02:23:41 +0100") Message-ID: <86czjmzwi2.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) >> This works reliably only because the search function puts point at the >> beginning of every file name during search. > > I'm not about non-interactive searches, seldom use them - can something > like `dired-isearch-filenames-regexp' be done non-interactively? It should work non-interactively as well. > Anyway, my complete idea was: whenever we provide a special search > command that limits isearch to certain entities, like file names in a > dired buffer, we always guarantee that point can be matched at the > beginning of each entity with \= (and maybe also \` and ^). In an > interactive search \= is quite useless (right?), so we can use it for > that and avoid hacks that would probably be worse. This is more complicated for backward search where \= should match at the end of the file name, so \' and $ should be replaced with \=. > We would still not have a solution to match the end of the entities, > however. Fortunately for files in dired $ works (by coincidence). This is still not reliable since the dired line doesn't always end with the end of the file name such as "filename -> symlink" format. But with the previous patch this works because of the BOUND argument of the search function set to the end of the file name. For the backward search, the BOUND argument corresponds to $. This makes the search function more complicated, but this is doable, just needs more special-casing. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 20 20:16:17 2022 Received: (at 14013) by debbugs.gnu.org; 21 Feb 2022 01:16:17 +0000 Received: from localhost ([127.0.0.1]:34266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLxJJ-0005pR-4c for submit@debbugs.gnu.org; Sun, 20 Feb 2022 20:16:17 -0500 Received: from mout.web.de ([217.72.192.78]:60273) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLxJG-0005jF-R4 for 14013@debbugs.gnu.org; Sun, 20 Feb 2022 20:16:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1645406168; bh=FjqJhf0/cBfZbe0pqcyfsZ03h9slmPPxU7gr6/s+brM=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=ej5dvkjuPSdk8kNqa/qNsuZO4rVXugWJnWY9loYZ0QA9CJDyMdXCXbqaiTz2cr8o3 +SiXYa24wufzTC60SNw8uOmBAuneiLExGCmzDIkMbgMcZ48Ns1MmhTIhdFvSLVQLLt naHZ6FyciU5t08D8Say8One77CNKLBy/mL8R2dHU= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.60.174.212]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MjPU0-1o5R902qWg-00kvNx; Mon, 21 Feb 2022 02:16:08 +0100 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87sfsk961i.fsf@web.de> <86leycoszt.fsf@mail.linkov.net> <874k4z38pu.fsf@web.de> <86czjmzwi2.fsf@mail.linkov.net> Date: Mon, 21 Feb 2022 02:16:07 +0100 In-Reply-To: <86czjmzwi2.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 16 Feb 2022 20:11:09 +0200") Message-ID: <87wnhpyq7c.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:pmv1LUipytCgS8leMh1oUb5bqqQwKD9ab01nLkV8BAI+j2tiIdy Dnvthp+AImw3fHXNUFGxybz/j1xDA01ZR2CMLdpwLxfBXAhubpZRlGpyxytah+jcGRoUlZ3 HMpfaaZ0234UG7lVV+IX5reG2+gJYCjiFTtKkOktaacbZ+5ZZwdR+0/pkYxY0to/Bo+VHMh XUND3vM9adMjDKiCoS6BA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:qPLXSrka7uI=:AXAtCT2k1sN/PSrewK/egn mAmpfNfY1blHCChAN9hlC55XJmj9mjplc4oKo2UcWLWHEoxP9r/YOWQKOSLxC8TvNWyHyNCBk CopO4zwxjIdKe0XoT1GuAKCmVac6xDdMwYakUqR/hs//I+srpyjAEI8tfVnnKJ+TH01bv1ew/ uC+mM2u/6mlGAWfmoYTIMJBInGBw4klYiRCsA73iIP8VMVxuk9g0sxWBHlh4m13Mvw+ow6Wlj 9gH95Rz+W2tIMH7NeLXFs5Q6tYmq7PPpakvTHjZz7M8TnDAZidjvLKS74S0pMOVdx4DH6NcYf s+kHBQxwxo7elNFDVlkdpKBMcqJiNCv7oFql3LrMbZuwr4NCymRlUbcIwXrkSbp8ea2PP8ccg 3rHU5lilpj2A0fLIkKcJrUbToWRb0HYC8MAw5ZOmp5/BMJK3OcB6AYG6PiuHsoN7EFre5FLYb raaPRNqnY/tLwYQ4JOspduswgm6U9QyFE3yT9f4kGLPNLCLag6iQuW9A/pt9H/D0N2LNixd8X UAlq5Ebx52mSt3OLw7K8dACuANi0f4KtLH+BYExSvO6r/n3t9dtywpclQd7Zxg2mVGGQ0fBEp anOqq786Yo6hXjBXwy6loCvMLsB3hK8ZcCUbFD6HrPj2OyUFdWAqvLcd+iUHsZ42ivMDJsJ1q IJrW5wuJ0j/HjCbovL8Wa48rCrwixdh8sKPga2wTmlipYxcPA0wDZnTSMV7IMsHIwfW5Xs36m 1JAyKXW+XI9vVh9dn0g+x8/aUhi3hNIYArcbWQ4h35ear5u7eC1GSa+P0tdC4zUiCmWbLUvjY zodI9v8Vy20z0SqERiUzy9po2GeeXbRVQf9JoVT23/yNNYCpZrLy6oN7fxw38qMef659BtxuY 04vwRt6MMYFa7M2zcY2gwFjIvL+rzNdvvJrriQI8jhtFU/qrqgeNheqMRbTgTZEWhUuLr07ak lJhWrbK5QTcGzXa8HNxrK33insn4AArb0W/0jMHS8lkqippuvMbBoiBFvTI2xlRJKPiRPlZh0 sI0T6+K9l9ebO1Mquo6L3tLT7JtwOzzUSWcFajwZJmFt9Lho4wfvlO84y4YFQePNnt/nEheS5 UvTEcYNtklT1nw= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 14013 Cc: 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov writes: > For the backward search, the BOUND argument corresponds to $. > This makes the search function more complicated, but > this is doable, just needs more special-casing. Ok, cool, then I think this is something I really would like to see (and test). Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 22 12:27:46 2022 Received: (at 14013) by debbugs.gnu.org; 22 Feb 2022 17:27:46 +0000 Received: from localhost ([127.0.0.1]:42533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMYx0-0003sB-4S for submit@debbugs.gnu.org; Tue, 22 Feb 2022 12:27:46 -0500 Received: from relay11.mail.gandi.net ([217.70.178.231]:57517) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMYwy-0003ri-7l for 14013@debbugs.gnu.org; Tue, 22 Feb 2022 12:27:45 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 03416100002; Tue, 22 Feb 2022 17:27:35 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> Date: Tue, 22 Feb 2022 19:02:57 +0200 In-Reply-To: <87czjn39yf.fsf@web.de> (Michael Heerdegen's message of "Wed, 16 Feb 2022 01:56:56 +0100") Message-ID: <86y222n7da.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) > With the patch installed query-replace in wdired errors. > > What's the correct value - the current binding of > `isearch-search-fun-function'? While trying to find the correct value in WDired, I noticed a regression: in Emacs 27 search/replace skips read-only parts, but in Emacs 28 there are no more read-only properties in WDired buffers, so search/replace matches everything. Looks like quite a recent change. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 22 15:21:29 2022 Received: (at 14013) by debbugs.gnu.org; 22 Feb 2022 20:21:29 +0000 Received: from localhost ([127.0.0.1]:42732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMbf7-0004ep-6t for submit@debbugs.gnu.org; Tue, 22 Feb 2022 15:21:29 -0500 Received: from mout.web.de ([212.227.17.12]:57541) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMbf5-0004ea-Hi for 14013@debbugs.gnu.org; Tue, 22 Feb 2022 15:21:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1645561277; bh=Ei0TLhwENd9iNM2YYAyG74Rimu/7+ITjLxbQOQo/I6k=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=s1oC7/Kq6eVrp1nudd1sNv66R6uM+b5axGgceYgz/BSCLrOOqIQukJOZz9rzID1t3 omi7EKxHkXooF8bgCGMX+zrNQgujsEapz3094Qb7JD6RYomkPXMTjgtl8qPKaEm6Js qKntKDq9K0asJvCgxGIqrLqk1kGIbnw3TWVt9Sy8= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.60.174.212]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1M8C09-1nIV3O25Cd-005SWv; Tue, 22 Feb 2022 21:21:17 +0100 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y222n7da.fsf@mail.linkov.net> Date: Tue, 22 Feb 2022 21:21:16 +0100 In-Reply-To: <86y222n7da.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 22 Feb 2022 19:02:57 +0200") Message-ID: <87tucqbqkj.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:f9tnkXFck15H13iqknUa1Hfjn2XCBRCCJPddzO96/Vb07DXzFhL qo5CLolxdcLBaVIdoch0VnyAJryS/lT/bthhMIXknb1u7CjHEaC1bRvo3gx/CMmEmaU5O8E 8Ou7edr0wvMSzBgH5EiSJ2NFXq/TIFGVCwlb1oATCe91ZKX5ZAELhU79QKaApyQ3mQZD5sX k3xTyC5QjFqjt27JGCvbQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:L5UGMFytpbw=:w15BIHFiij1zk9x5qAYapX tmCkfOEfi6AYqOmJBuJRzsyytFjRrArjHz3CDsz0gjdfe21YkOGsX0wynMFEufieuibo55dqB H1s+Ooa/MQY0rvBDuPxYBsZzxK0Jw2cWJxx4LeLBjSL/JWhb+nv44fI60KFs+FJh9XaSf0VSe 9WK68P8K/p/7x7J1SMjvSpMzbJLPDRWgN7U0xCMZ7LS/Vs1FpROlm2uL5LMefR+gppsLdACX3 XemH+XZ1kfhlqPUCpM1Q1Dd1/iOvVb2aDBVeu3Eg5RSXjVB3wfJd7j1BHyBo+0Sm+PQLv74+c rymFQj+Aqyb+fXjMTAVnuRSYV96wGsCNXxgiDyDR8Npa3JPRl+IKgMlX1uKLvE+Lt9d3NJ62b iroP2LAxcxY29jwhSjfxwLckF2gVV2tv5pzhjQdgJmxgJJBxc03mtScVC50hkkrrUuaJ3RHJn IvGFxEt1EwI98qKZHI/Vs9fTwwdFtupae78ArWq7rik81pplR1ESfJ6+gTqZRcaiPplAjaI1/ S1kmGlIZLxnn3lUHfmF5AgQlk0CUaVySJSSAC0YzUFj5x29JMTTGeW8I8ahZNjsIPfSVEKPu3 wYVJHmEyiThljaMCc3LTucXHU0xrnn76dd3nkWVh82N4+4MsBHUfkGg+eQybZJcyHrDwO21UA /Na60xo1F//guiATPBKu/wVo0CoaY/dJ99cIm4VNeUatB7fdH0fUTIUGDZ5ZzgYyXBJ/WD6QL S4E3qEC7GzoTp0uiE+M+UY0JQtesHeFF5ahKy0Gu+wK76Dq5ZBCgFM9TkhEf55WYp1pv5ZWKQ zhaYL6eB7n9WZ7oImkgBwg4z8+0I0caaIrkyRVITO8pZ44Iom99zCe8e7shbi2lP19uzVpPFa HDIFb2hB+o6OIEc+iFnucCkz35Sh/pc9PWF90rB4GMPy1XYdSXaJuusbouFmiXwLuGFqdZLyc Gztf79PwEJWLGEpBobbC2OesfKt7itM+C3jsVBeogDbeyzI1ZwCb1XT9IVu6lBvsRQ6HPS3Z6 2tHEavYDuGPXQom4vjIAzJHdHCtUnwnRferXCbglZqfEkC9WWZdunQ14jK1GEjOi/eng4X3/G z8mKDpR6SAHloU= X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: > While trying to find the correct value in WDired, I noticed > a regression: in Emacs 27 search/replace skips read-only parts, > but in Emacs 28 there are no more read-only properties in > WDired buffers, so search/replace matches everything. > Looks like quite a recent change. There had been a change that made property changes be applied delayed on the fly for faster startup of wdired. This now happens only for lines that the user edits. Could that be related? Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 22 17:27:21 2022 Received: (at 14013) by debbugs.gnu.org; 22 Feb 2022 22:27:21 +0000 Received: from localhost ([127.0.0.1]:42801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMdcu-0001ox-Tk for submit@debbugs.gnu.org; Tue, 22 Feb 2022 17:27:21 -0500 Received: from mout.web.de ([212.227.15.4]:55361) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMdct-0001ok-0X for 14013@debbugs.gnu.org; Tue, 22 Feb 2022 17:27:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1645568829; bh=FB0xXFSOoGCh/GJfUJAmpveSBkZ1sopIAxOIiDg9Z/k=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=Xat61P4qa9grzLe5iYAQnjqmZa2e98Vd9P2HaGbl/ZHumYJwEqpjDOeQPdpDsZ69x pGNHoqACZm0UtuMISTdMyI89ariTMJF5vZgYbq741rjMF+Vg/marhTmi/hicqIN4gI z06tQ1DWvoLh1k3itYuTdpix6wUFtlFS01hzc7Qw= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.60.174.212]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MUlDJ-1nmeom24Dx-00Qq0n; Tue, 22 Feb 2022 23:27:09 +0100 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y222n7da.fsf@mail.linkov.net> <87tucqbqkj.fsf@web.de> Date: Tue, 22 Feb 2022 23:27:08 +0100 In-Reply-To: <87tucqbqkj.fsf@web.de> (Michael Heerdegen's message of "Tue, 22 Feb 2022 21:21:16 +0100") Message-ID: <87mtiibkqr.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:liaUNp60ZHXG1uHJruh/D2s5xJtmoVWLbm3c/ssE/eWkBJU33hJ r407jR2IdPlh//tUnA+KErz+Vqo1zPvjoHpv2UfQrt/37/wD7rgHI8HHVRgNFz3JUqVv7tb A4ZRrGpQVrH6Wo44AnInZhzi/oRelzc5qmt1AOM+36lc5YBhuVoiwuW7IYoAexnhFpxVHxi FblZZST5YRORmRJaad28A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:knzBWKPQUio=:Sn7rW1kOi+YspUA3Q7xp1Q s2x1wPDtWq+Qe+VW837TTW2rlQWNRwYEfQW/IAyKM5VDOemT2yhEiZufr9N2E/fzoiC0Dx7YL yVh9H6b1ea6aLtcUFLFy6hwmjULART+DB5O2GjaIM6bTGpG74i4LVLpdEgHfrZxD2TTYZkjZL UegpqqMqG32hMclJa+KB302fIMB0ax5SFteGKPtMb5DoHNy1rhdId2nFBEVxa8TfCcdyla2tt jfq6iYGh33atshokUQAIVdT4yqZT13QaMqEIOWybpJ6FLQ4xuHiTfvGrRSHbVTSzITu3JNdWK MCrAQFtYjfjVOTh3kICiFVKw0u5vbtq/BKeFn4i+O86C0DBAeTVkYgskvXA+oWEu3j/N4SxB3 HbljU3TS+z0aTfiGzsyAavcwC9q1BtJRDur3vsKRESQVTxzXeTy6u9PKM25ErxNUQRRO7dFB3 ksZxTBJyW1UN/wnz9QVDq80mFZz+xjQENuGM+oEZoSetgCIfKIgpnW2WpCsFQnn9MQ1MjCrhR gnCp2eF6yyBbul8JQIEouT+reFxCv252ZenMNRAb6ZcgTa8iTT3f5do56NgL0DynPV1tKmbUM aptfE4R/+FgGg0ZCoUwwPGYu1E3VwwaWkaMcb2vIEb8XshgNVhPJS9OxyPRPIg7oSQi8MseW3 9GxNel6J1GQIQcAsO9+legvE9drPuUePZ2C9uQB2McOI5QhEoUM9wOuyRvk9Y0/mUHzSxcfCq BxtT3Ej5C4CGQ8+25zGF/m4TMWDqPzBr82Go7cy2Hp/Dwh8RRH28OJKKC7J16usAUdknM6ZjN qqT+0sfMVczRUP7m0yfRXzj0Xy614WsaNz+ze+PtagDMTijAlTuSasQI/Ny0jlYrYeXEqF0ED bULQNvtD/y0O0N1+MlZAJ1jKZEJI0ZxhKVt+g/8RVQWG19J584tWHi1iWTBe016kgKEsHC4wu /Ab/tjJ124e3/pBn1kCRcfxzzSTTrXPadZTS7eYYVri/JmlCLEXEoYqhNP+8DDU61fsuYtX7K lC+gDD6rnbPz8buT8ofgku4E7BSvGjfLbDAPF2f0ggtt75ECIjSNH0lPPtmgCBbw0dQYi2a0x GvcPBd6iMoS8x4= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Michael Heerdegen writes: > There had been a change that made property changes be applied delayed on > the fly for faster startup of wdired. This now happens only for lines > that the user edits. Could that be related? But I remember that you were involved in fixing fallout of that change for the isearch side. So maybe a different change is the culprit. Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 23 03:39:41 2022 Received: (at 14013) by debbugs.gnu.org; 23 Feb 2022 08:39:41 +0000 Received: from localhost ([127.0.0.1]:43745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMnBV-00027X-6L for submit@debbugs.gnu.org; Wed, 23 Feb 2022 03:39:41 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:53435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMnBT-00027F-AO for 14013@debbugs.gnu.org; Wed, 23 Feb 2022 03:39:40 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 19027240007; Wed, 23 Feb 2022 08:39:29 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y222n7da.fsf@mail.linkov.net> <87tucqbqkj.fsf@web.de> <87mtiibkqr.fsf@web.de> Date: Wed, 23 Feb 2022 10:13:42 +0200 In-Reply-To: <87mtiibkqr.fsf@web.de> (Michael Heerdegen's message of "Tue, 22 Feb 2022 23:27:08 +0100") Message-ID: <86h78q9hsp.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) >> There had been a change that made property changes be applied delayed on >> the fly for faster startup of wdired. This now happens only for lines >> that the user edits. Could that be related? > > But I remember that you were involved in fixing fallout of that change > for the isearch side. So maybe a different change is the culprit. We fixed only the error raised in query-replace by adding save-match-data. And now we are fixing the matching only within filenames for Emacs 29. This means that Emacs 28 will be released with this regression. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 23 14:16:19 2022 Received: (at 14013) by debbugs.gnu.org; 23 Feb 2022 19:16:19 +0000 Received: from localhost ([127.0.0.1]:46518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMx7b-0007VB-6S for submit@debbugs.gnu.org; Wed, 23 Feb 2022 14:16:19 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:48051) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMx7Y-0007Uu-G6 for 14013@debbugs.gnu.org; Wed, 23 Feb 2022 14:16:18 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 9D4A71C0004; Wed, 23 Feb 2022 19:16:08 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> Date: Wed, 23 Feb 2022 20:53:48 +0200 In-Reply-To: <87czjn39yf.fsf@web.de> (Michael Heerdegen's message of "Wed, 16 Feb 2022 01:56:56 +0100") Message-ID: <86y2215rbn.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) --=-=-= Content-Type: text/plain >> >> + (add-function :around (local 'isearch-search-fun-function) >> >> + #'dired-isearch-search-filenames) >> > >> > And: Is it intended that this is unconditional (I would expect a >> > `dired-isearch-filenames-mode' test)? >> >> Currently it is unconditional when it's using isearch-filter-predicate. >> So maybe it should be kept this way since it's what was used for many years? >> Or is there a reason to change the current behavior? > > Ok, then better let's keep it. For more customizability I added a new user option 'wdired-search-replace-filenames' enabled by default. > A different thing: I found that > > | + (setq-local replace-re-search-function #'dired-isearch-search-filenames) > > is not correct - of course, `dired-isearch-search-filenames' is a higher > order function (used for the around advice), not something suitable for > searching. With the patch installed query-replace in wdired errors. > > What's the correct value - the current binding of > `isearch-search-fun-function'? You are right, the correct value is the current binding of `isearch-search-fun-function'. Everything is fixed now in this patch, i.e. search/replace works ok in dired/wdired buffers (except ^ at the beginning of filenames that is a separate feature): --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=dired-isearch-search-filenames.patch diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 56897826cb..92f2848334 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -3147,11 +3147,11 @@ dired-isearch-filenames-mode When off, it uses the original predicate." :lighter nil (if dired-isearch-filenames-mode - (add-function :before-while (local 'isearch-filter-predicate) - #'dired-isearch-filter-filenames + (add-function :around (local 'isearch-search-fun-function) + #'dired-isearch-search-filenames '((isearch-message-prefix . "filename "))) - (remove-function (local 'isearch-filter-predicate) - #'dired-isearch-filter-filenames)) + (remove-function (local 'isearch-search-fun-function) + #'dired-isearch-search-filenames)) (when isearch-mode (setq isearch-success t isearch-adjusted t) (isearch-update))) @@ -3175,12 +3175,42 @@ dired-isearch-filenames-end (unless isearch-suspended (kill-local-variable 'dired-isearch-filenames))) -(defun dired-isearch-filter-filenames (beg end) +(defun dired-isearch-search-filenames (orig-fun) "Test whether some part of the current search match is inside a file name. This function returns non-nil if some part of the text between BEG and END is part of a file name (i.e., has the text property `dired-filename')." - (text-property-not-all (min beg end) (max beg end) - 'dired-filename nil)) + (let ((search-fun (funcall orig-fun))) + (lambda (string &optional bound noerror count) + (let ((old-pos (point)) + (beg (when (get-text-property + (if isearch-forward (point) (max (1- (point)) (point-min))) + 'dired-filename) + (point))) + end found) + (unless beg + (setq beg (if isearch-forward + (next-single-property-change (point) 'dired-filename) + (previous-single-property-change (point) 'dired-filename))) + (when beg (goto-char beg))) + (while (and beg (not found)) + (setq end (if isearch-forward + (next-single-property-change beg 'dired-filename) + (previous-single-property-change beg 'dired-filename))) + (if (not end) + (setq beg nil) + (setq found (funcall + search-fun string (if bound (if isearch-forward + (min bound end) + (max bound end)) + end) + noerror count)) + (unless found + (setq beg (if isearch-forward + (next-single-property-change end 'dired-filename) + (previous-single-property-change end 'dired-filename))) + (when beg (goto-char beg))))) + (unless found (goto-char old-pos)) + found)))) ;;;###autoload (defun dired-isearch-filenames () diff --git a/lisp/wdired.el b/lisp/wdired.el index ab3b91bbe5..229a266d33 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -155,6 +155,11 @@ wdired-create-parent-directories :version "26.1" :type 'boolean) +(defcustom wdired-search-replace-filenames t + "Non-nil to search and replace in file names only." + :version "29.1" + :type 'boolean) + (defvar-keymap wdired-mode-map :doc "Keymap used in `wdired-mode'." "C-x C-s" #'wdired-finish-edit @@ -217,6 +222,7 @@ wdired-mode (error "This mode can be enabled only by `wdired-change-to-wdired-mode'")) (put 'wdired-mode 'mode-class 'special) +(declare-function dired-isearch-search-filenames "dired-aux") ;;;###autoload (defun wdired-change-to-wdired-mode () @@ -237,9 +243,12 @@ wdired-change-to-wdired-mode (dired-remember-marks (point-min) (point-max))) (setq-local wdired--old-point (point)) (wdired--set-permission-bounds) - (setq-local query-replace-skip-read-only t) - (add-function :after-while (local 'isearch-filter-predicate) - #'wdired-isearch-filter-read-only) + (when wdired-search-replace-filenames + (add-function :around (local 'isearch-search-fun-function) + #'dired-isearch-search-filenames + '((isearch-message-prefix . "filename "))) + (setq-local replace-search-function + (setq-local replace-re-search-function (funcall isearch-search-fun-function)))) (use-local-map wdired-mode-map) (force-mode-line-update) (setq buffer-read-only nil) @@ -319,11 +328,6 @@ wdired--before-change-fn ;; Is this good enough? Assumes no extra white lines from dired. (put-text-property (1- (point-max)) (point-max) 'read-only t))))))) -(defun wdired-isearch-filter-read-only (beg end) - "Skip matches that have a read-only property." - (not (text-property-not-all (min beg end) (max beg end) - 'read-only nil))) - ;; Protect the buffer so only the filenames can be changed, and put ;; properties so filenames (old and new) can be easily found. (defun wdired--preprocess-files () @@ -438,8 +442,11 @@ wdired-change-to-dired-mode (remove-text-properties (point-min) (point-max) '(front-sticky nil rear-nonsticky nil read-only nil keymap nil))) - (remove-function (local 'isearch-filter-predicate) - #'wdired-isearch-filter-read-only) + (when wdired-search-replace-filenames + (remove-function (local 'isearch-search-fun-function) + #'dired-isearch-search-filenames) + (kill-local-variable 'replace-search-function) + (kill-local-variable 'replace-re-search-function)) (use-local-map dired-mode-map) (force-mode-line-update) (setq buffer-read-only t) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 23 19:30:20 2022 Received: (at 14013) by debbugs.gnu.org; 24 Feb 2022 00:30:20 +0000 Received: from localhost ([127.0.0.1]:46872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nN21U-000355-B2 for submit@debbugs.gnu.org; Wed, 23 Feb 2022 19:30:20 -0500 Received: from mout.web.de ([212.227.15.14]:39795) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nN21S-00034r-UZ for 14013@debbugs.gnu.org; Wed, 23 Feb 2022 19:30:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1645662608; bh=il8o4tRX2Ffk8sK2z4+MLPOLQ7jkfw0fJoSx4PJqS5w=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=ISkTobvAITBIwccuGiUaJ4E4QWh/fNuDD/7ywPwafRIe/3OQuWHgvlAUA6elLXXte rhTr6hUytMcvTA0Ym9IZX4a35DoAE124AAmG4M04PfzZOXgzeAL61cXGWI01VJ9kI3 RTHLhG17pu2bR7ZXuNJ3FGyd09kdLyM5LMBafo44= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.60.174.212]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MOUxu-1nai5O315y-00QJOy; Thu, 24 Feb 2022 01:30:08 +0100 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> Date: Thu, 24 Feb 2022 01:30:07 +0100 In-Reply-To: <86y2215rbn.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 23 Feb 2022 20:53:48 +0200") Message-ID: <87ee3tjecw.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:DVw1uir08KSVB+8pVqD+VMjtVdZ5r4Ic43zmkG9swaT41TjZ4gX PWutPhEZOklUJSd0OE9eyq2RL2kbF4yFUariM5+pCjPM+UO183db3BJvHGCZJ/UEghW1eeZ UO2u5RfUCKVo669Ng9J9N8PendbkKdjytOSovNP76stO6EfRe3m28pqTUA2gkWaqrYajjGI uqJYe+G9UrzZo6VlbpYCw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:qY3OA97ON98=:ZhSPQdz440fv+tC5UtxD32 QJkRNUtP7SJaMNG9CxrNuVeKRBikZkpLOH5pHMtLH2lNmC+pwW49F46MtjcKf++rQWjQGAAKk //1UXPW1MUZ15Mo1b1e07zr1IAGhwE0Qxp8yVSfbj7RKjfouu9FB2Plem4yj4r1a1Azy3z4wF wJMJBx/r67uDgWrr/s6gpgKLv1mvrGpF5IT0UDmP3t0BMhyVT1u3CyCbI2Z3SXi1CReMsXO1x ZYR2K6W/vuDyMcA3u2PblTfGmGCuehTQtnvLd74z2Un44E6B0GIpO6Yf8hi/aKJoRLJKHJdUc wbUb+uzxlIV2bELKPjSOaWUN+cG3UDBC6XA7PG5s0ZJjb0iCXmxQ8ccx5ZKmJhTsXKGE6WdIq sfEpfKF9d5v1UWkkQDkljE3xFvilrJCtkrK1yTYXu6pvb3b4DiZilETgrK74TWqjJZaeC19cD FjKHW09IS7iFa8z+OqS+DWiIUvZlv959heW9ejAw1uGx9gG3dGf1Pu2BU6Qv78G4U+/BzZWiq i/igazm/q7bBrUIUbqiTiRLStXFKDQN9AnxM7Md1nNQdwUcifg3WWQ1cazt5HCTZlo+2aLg0G gYYV0yesakyzJXuL1dmgV0myR7aIgENyyCTklDo3LCQPZHgQTo3v7DolvMGiiwdVrAiFufXwY 9rJzaRHxNjB0t3i7n6LI0PfuvI/pyDNohQ/BI/rTXObup9a3ItTjE8+ASzal9JAyIT6TwRGw4 KjJHTCglHI++WvoZYa60QJQZZqM2oWA64X0lVXJ2FTHZpvPxKVOKovLMsoUQul5FtV/3XK2dD fQONpS9MZCVdRzdO1+Yiv6v6wCY5eswOmeOTSi227Y5Fj0UFGjMDpcUnLc/lsQVKdnIl/Gu2Q ruba4lq9VfYbaoLx80JsnpDLgLiEq9ANZvfkT1cDjS5ZNMD0CpVWwT+F4o7Q6c2190ZHT7jpm 3ujCn6ciQEYBz8LylZ5TgevFnz5ogqgho/3gCIgQ1oqM9C3v7Bi+2B5wC/f4YuQbjsqw16Yte GvN6H5iKfPVGKouc0jHtsnz966hih+SPE7D+8d7BZCMlleXqMjgXlUXL/i72H+xTO7YlDWAqM kX+EQCPpjGNT8c= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov writes: > Everything is fixed now in this patch, i.e. search/replace works ok in > dired/wdired buffers (except ^ at the beginning of filenames that is a > separate feature): Thanks - let me try it out! > + (setq-local replace-search-function > + (setq-local replace-re-search-function (funcall isearch-search-fun-function)))) Something's strange here. The indentation level of the second line suggests that you didn't intend this to be a nested `setq-local' call - or did you? Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 25 23:46:10 2022 Received: (at 14013) by debbugs.gnu.org; 26 Feb 2022 04:46:10 +0000 Received: from localhost ([127.0.0.1]:54088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNoyA-0005s5-Fk for submit@debbugs.gnu.org; Fri, 25 Feb 2022 23:46:10 -0500 Received: from mout.web.de ([212.227.15.4]:57679) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNoy9-0005rs-8h for 14013@debbugs.gnu.org; Fri, 25 Feb 2022 23:46:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1645850759; bh=fXGz/DlJjx8u2ZkfuszN64YXFAi79YMmD7DayPoXHNA=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=s+LcoWEWF5BfS+Lo4tx4xBblwwmRZspddcUC/L8M2TjAWS5jk6PC92tS9jhd9HIqf iwgkOMeWRli2sXHersMFeGxVuO1DE4le8M1TRLmc8X4JzB3qo1tp2IM48oIc6/2tTy h1zAfaIqvx5CAbrSjzQRLE/YkZjHR3G1pKUYBhiE= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.60.174.212]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1M8Bvz-1nJgN219b1-005DOn; Sat, 26 Feb 2022 05:45:59 +0100 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> Date: Sat, 26 Feb 2022 05:45:57 +0100 In-Reply-To: <87ee3tjecw.fsf@web.de> (Michael Heerdegen's message of "Thu, 24 Feb 2022 01:30:07 +0100") Message-ID: <87pmnap75m.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:6D/dtN3XIbw30mTbaIp1zC3fCRWPnucORqIstknmcGsVYx/CyKB iMMHmgS2qvj4QylTgqYZ2jJ0racPlFOIDkc49+wFM9kbYpVVI7+Nu4Bwg9II2fPDGD8K8us txu4fBNQIuKGnlpvM2mW7DB0TyGqm69ppJZlxp2xpebHdsQ62j0aR+2Na4Z3g3jWMEMsY29 n/7ATpvZ7fTmC4+nFnHdw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:NJ+/6Y6dvK4=:wOdtccwtASG5Wfvt0qXeBh 8lrvdzGBCldJveQSGmfIIuGWIvqgkUZV17uM68JhewwXqSQWt81mfJ0N4pHtCKSdmlwc5N+Mz AhBS/LxUaUcwXmdhUgHYOMrtI96Fl2Sr7fiR8XCODSSVmEOHCA2YqGgfZk+XUChFccB/A5hUw bVo4jUfpHCnrD2lqTx7SZluRDSX20qEiR4gnoYDyu4RAQK0qFmG7f4NQM4Pn9+YNKxkrXMpfv 6gmW7zjKms54xUKyuVsA4VJr6HU4GA4bmyKOssg23UH3Y186Gx6uE5CR/RXIneHJXnsdlDa1r NuXJ32ITXpbdNIUPRIqWOBRyz2LkP9QLpxWNiR8P4XG0DcI96QsleoweViqEtndwtdL741IRb mGX3nWFGNDfRNh3hwJMGryqigRvWl/vdTP3pkslpxARZbDUGFaNH3TATi+okfT6GRPveeuis9 U4OTH4vxDGNt0uTvAMGFk/xSCdd83ps8g4Q77JLX88BNeIx96t9UgjkWL2UqHozli+eS58UE4 nxBCasvqPvBWLLPfAEJRd3Gd5CQeMHqlsJrWiRZXIrS5/+zutG2J2lH7DoJpKaLCdTvwdzI/a NwPnu362jTdbjTkJvnsaxLns65d8gYflNuEMuqC/fgbYgv8kaGmrI3PBllL86VLZy8QEKTjXc RKDQIK/spgrQRgoAiF9nMaddCf5wDuRWRR938PX3uPs2UOlMs2LAWiCUDxiTrOqDbfgcwQv1A sM8cJSKNytxUAw01f9AFhm4dd5eV5qtTo1eArrKdhRCDYkWWfa/FUbz8Fo/ONXVqoXbN1pRKK 5/0hcWcHdKsHdSRIhW4X1xIaPoBpAzVcLM/piNBlJTgHvoo3ciYd2ixvEWY6II4llK5UmBPzw uLaOlm77Z0gVlJDJ/JMtBdnD7hOE923lc4+2L/bp60PHDAOfv3RNdOso15wDJ01QbXT5X8EFg kNKJZ2PDk4dSfMq3QZBDNjXsc+xidWe/ZqyiCX1jYTfF0g0U+JxsxvuULflXFh9hJkHRFXG8F BgHa5oCkHt6vb8qtz43EW3X91jnDyEpwgLJxUoG4zo3cUILjstf5WkFFlwr8lOXtouV/SPgmG wTZ0OGgeCyYE1g= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Michael Heerdegen writes: > Thanks - let me try it out! > > > + (setq-local replace-search-function > > + (setq-local replace-re-search-function (funcall > > isearch-search-fun-function)))) > > Something's strange here. The indentation level of the second line > suggests that you didn't intend this to be a nested `setq-local' call > - or did you? Yes, seems to work well. Only my \= trick doesn't work at all :-( Michael. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 10 14:29:30 2022 Received: (at 14013) by debbugs.gnu.org; 10 Mar 2022 19:29:30 +0000 Received: from localhost ([127.0.0.1]:35540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSOTa-0004sI-7Z for submit@debbugs.gnu.org; Thu, 10 Mar 2022 14:29:30 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:49743) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSOTY-0004s2-C0 for 14013@debbugs.gnu.org; Thu, 10 Mar 2022 14:29:28 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 909171BF206; Thu, 10 Mar 2022 19:29:19 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> Date: Thu, 10 Mar 2022 21:28:24 +0200 In-Reply-To: <87pmnap75m.fsf@web.de> (Michael Heerdegen's message of "Sat, 26 Feb 2022 05:45:57 +0100") Message-ID: <86h785obdz.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) >> > + (setq-local replace-search-function >> > + (setq-local replace-re-search-function (funcall >> > isearch-search-fun-function)))) >> >> Something's strange here. The indentation level of the second line >> suggests that you didn't intend this to be a nested `setq-local' call >> - or did you? > > Yes, seems to work well. Sorry for code obfuscation. It's really a nested `setq-local'. > Only my \= trick doesn't work at all :-( Alas, \= doesn't work, especially in backward search. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 28 14:01:35 2022 Received: (at 14013) by debbugs.gnu.org; 28 Mar 2022 18:01:35 +0000 Received: from localhost ([127.0.0.1]:59143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYtgN-0000RC-EX for submit@debbugs.gnu.org; Mon, 28 Mar 2022 14:01:35 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:42083) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYtgL-0000Qs-PO for 14013@debbugs.gnu.org; Mon, 28 Mar 2022 14:01:34 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 321D324000A; Mon, 28 Mar 2022 18:01:24 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> Date: Mon, 28 Mar 2022 21:01:03 +0300 In-Reply-To: <87pmnap75m.fsf@web.de> (Michael Heerdegen's message of "Sat, 26 Feb 2022 05:45:57 +0100") Message-ID: <86mtha7y8w.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) >> Thanks - let me try it out! > ... > Yes, seems to work well. Thanks for trying out. Now I pushed the patch to master that will clean up the platz for more features such as ^. From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 31 22:18:37 2022 Received: (at 14013) by debbugs.gnu.org; 1 Apr 2022 02:18:37 +0000 Received: from localhost ([127.0.0.1]:40431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1na6s1-0005n5-Bw for submit@debbugs.gnu.org; Thu, 31 Mar 2022 22:18:37 -0400 Received: from mout.web.de ([212.227.15.4]:40689) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1na6rz-0005mo-8H for 14013@debbugs.gnu.org; Thu, 31 Mar 2022 22:18:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1648779505; bh=b/vQ3lJz8aztFvpuLaa37QVNQICVbAQe+iIAB03Lp+Y=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=KwdRqw74ko35u7XXVCXyA6mZPu45Tw8rv522lhrw90k+cnOME6y/22FFj4oL/IMUx C5PqQBShz852HkssteqMSYNffOJpZgNsfXVZAlC+H035FVMTzCyoBRS098OWrD/id4 KTXA/Z0CUkqONAueyHjQ9Bc3PHFWafQ4EUTRZ0j8= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.59.210.63]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MK52w-1nJ0UZ1Tag-00Lf2O; Fri, 01 Apr 2022 04:18:25 +0200 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> Date: Fri, 01 Apr 2022 04:18:24 +0200 In-Reply-To: <86mtha7y8w.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 28 Mar 2022 21:01:03 +0300") Message-ID: <877d8935sf.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:ESrTxF+33gb7sha66hBIEMGW71q9d3x6b8SC92ZPQf8xltjAjQ9 8T8JL47vasLkehh75ZsFXu9l1r/GdqU3bqfNB5h0WJdysgR4SBs1YJ/Gt5HUxf/A+yf4UYb ujeg1sbdaLJQjUGyyhMtKRgTEx+bvbUbtNIDlfCR8iciDXXolGNTWc+4cdoLAzjAAnJVsXn tu/GqNzOAiXvht8u3vhXw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:M4y/87fKZ2E=:h5SkGfQDZ4d1nvqw06xCBu XVkN6eKM9lZUu4NJh+bbFqC7XpIScpSdtRIWulkF3Meq3E3QsAAShoRMuL/7DT5aUc5jz2Ute xud0n9jSC6SOSolnkCSsTSi4FJ2VymgHnfbBV8TxQN8z2Rt6Z6SgccKpda2zNwGCZUcaaxwDc Mtu2UEP5Plu4vtaqKOJTtgf30ap+Y86B/7XzHp9uPFE3eBTvkApjigL6rTtOsz1pTx7PEDi2Y PODNEtycoYzeZoMVhBo1WGzcpg9qfnZf0FTsnJULXCUiAa9dvqw63ECRDRuA7cL00ObYBULtf 1LlWu8YLrjUH+fV93p0S1XRe7tvPpFI/p9LskCfge+ZWL5EpSU9aVw3tGk9uNDSPHwgdg2Krr prmQ1sDbEHZJVs6NWwl25xCq+5dq9LXgw9kwXRS7If72XG3Cy9ILND1aC4ytFnC0Grjn/zURP b3l3rXgc27GK7uVzuG3Ry9RG1upYYDKsCSf+12L9m1JvVdq8hiRZsRfvHRecCUkF/wdKZePRb Z3sMG0Cn5D4qGU0yNQEmw8gXkK2WToTr9ygyZLa/DjgWIwtrVafZzRK3AHhuled1Nsk+pRWFi xsR54JKaE633ZEm/dQHsdJKOmydfsV6BO9vB0VwMNbmDXCBJlGTHIiQKNLiAC4IJXGd0ef6Uk FjcPmYU7xCYkJNKdmbMQgtYjrQb9wJhEQz5CYrrbRmY5Qz2FERYQHlTeq+Q+TBlKX3HBoIwin mSCEzxcmZrMmIHv5y3BVugteywITfnOH7N8wlOQ/SBD5V9nrf/KdHAukXNT8MRHZrP40KY8av xKMn3miNme48/pEkccz7g7xbYBXE8WT0RLWh6v9+PbF2cRvc31Kaaqre4+J74/nYPp6BWZjwe XoGNn16Y+AvpM1nBEamtViD1YH4Yhq7OiP7kXxTIGNjk1IstMpirfABALsdXUPKTU9m+Vp3A1 gBW9eqMucJfmF+SVd55svHJgH49125KqBHhMPZ6NBL405CMtptqP9Ak1ycUSyBZbNV01KvbX+ /7OOdMq9WSl78Vk7eztGiEr/EKOdzwwKNVtmM5zgewQgKQ59Pq6AjYqK/dISGAncseDrk0Z0h aE3QpQCg20geTM= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov writes: > Thanks for trying out. Now I pushed the patch to master > that will clean up the platz for more features such as ^. I wonder if it is realistic to use a temporary helper buffer to implement ^. I would like to have a kind of filter that would allow to restrict isearch and query replace to arbitrary parts of the buffer, defined e.g. by the presence of some text property, anything you can define. If we would use a helper buffer that contains only these chunks, ^ and such would work out of the box for all of these cases. I guess that such a helper buffer would have to be filled on the fly, successively, and the hard part is the details of handling (updating, killing, etc) these buffers. Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 01 12:44:06 2022 Received: (at 14013) by debbugs.gnu.org; 1 Apr 2022 16:44:07 +0000 Received: from localhost ([127.0.0.1]:43269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naKNa-0005Vl-M9 for submit@debbugs.gnu.org; Fri, 01 Apr 2022 12:44:06 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:37193) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naKNZ-0005Uy-AO for 14013@debbugs.gnu.org; Fri, 01 Apr 2022 12:44:05 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 7A88F20000C; Fri, 1 Apr 2022 16:43:57 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> Date: Fri, 01 Apr 2022 19:39:10 +0300 In-Reply-To: <877d8935sf.fsf@web.de> (Michael Heerdegen's message of "Fri, 01 Apr 2022 04:18:24 +0200") Message-ID: <861qygal8h.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) > I wonder if it is realistic to use a temporary helper buffer to > implement ^. Good idea. Maybe even not a buffer, but just a string. Are there any differences between buffer matching and string matching? Then first we could remove ^ from the search regexp, and when it finds something, then get the found buffer-substring using text properties and match it with the original regexp that contains ^. > I would like to have a kind of filter that would allow to restrict > isearch and query replace to arbitrary parts of the buffer, defined e.g. > by the presence of some text property, anything you can define. This has been asked before for search/replace in a rectangular region. So since we have pairs of beg/end bounds for parts of the rectangle, it shouldn't be different from search/replace in Dired that uses text properties. > If we would use a helper buffer that contains only these chunks, ^ and > such would work out of the box for all of these cases. I guess that > such a helper buffer would have to be filled on the fly, successively, > and the hard part is the details of handling (updating, killing, etc) > these buffers. It seems you intended to use such buffers for more complex feature than handling ^. Because when you copy such a rectangular region to a separate buffer: +---+ 123|456|789 abc|def|ghi +---+ then do you want to match the copied parts as contiguous text? So the above rectangle when copied to a separate buffer: 456 def do you expect it should match the regexp "456.def"? From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 03 14:19:57 2022 Received: (at 14013) by debbugs.gnu.org; 3 Apr 2022 18:19:57 +0000 Received: from localhost ([127.0.0.1]:49493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nb4pR-0001jq-9u for submit@debbugs.gnu.org; Sun, 03 Apr 2022 14:19:57 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:46637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nb4pO-0001jb-DP for 14013@debbugs.gnu.org; Sun, 03 Apr 2022 14:19:55 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 71E8A100002; Sun, 3 Apr 2022 18:19:46 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> Date: Sun, 03 Apr 2022 21:05:07 +0300 In-Reply-To: <861qygal8h.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 01 Apr 2022 19:39:10 +0300") Message-ID: <86pmlyqbfh.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) --=-=-= Content-Type: text/plain >> I wonder if it is realistic to use a temporary helper buffer to >> implement ^. > > Good idea. Maybe even not a buffer, but just a string. > Are there any differences between buffer matching and string matching? > > Then first we could remove ^ from the search regexp, and when it finds > something, then get the found buffer-substring using text properties > and match it with the original regexp that contains ^. This works surprisingly well. Maybe there are more corner cases, but something already works with quick tests: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=dired-isearch-search-filenames.patch diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index c49e4e91d8..0832ea1ddb 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -3202,7 +3202,16 @@ dired-isearch-search-filenames (if isearch-forward old (max (1- old) (point-min))) property) old)) - end found) + end found regexp (i 0)) + (when isearch-regexp + (setq regexp string) + (while (string-match "\\^\\|\\$\\|\\\\`\\|\\\\'" string i) + (setq i (- (match-end 0) (length (match-string 0 string)))) + (if (save-match-data (not (subregexp-context-p + string (match-beginning 0)))) + ;; The ^/$ is inside a char-range or escaped or something. + nil + (setq string (replace-match "" t t string))))) ;; Otherwise, try to search for the next property. (unless beg (setq beg (if isearch-forward @@ -3221,6 +3230,9 @@ dired-isearch-search-filenames (max bound end)) end) noerror count)) + (when (and regexp (not (string-match-p + regexp (buffer-substring beg end)))) + (setq found nil)) (unless found (setq beg (if isearch-forward (next-single-property-change end property) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 04 06:53:44 2022 Received: (at control) by debbugs.gnu.org; 4 Apr 2022 10:53:44 +0000 Received: from localhost ([127.0.0.1]:50616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbKLA-0002P9-LF for submit@debbugs.gnu.org; Mon, 04 Apr 2022 06:53:44 -0400 Received: from quimby.gnus.org ([95.216.78.240]:42456) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbKL8-0002Ov-Vi for control@debbugs.gnu.org; Mon, 04 Apr 2022 06:53:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Px0cL8vBCio/vpeQC8Y+lFPCCuvLXgCY0kKpiCwh7ss=; b=sAntm50l4GXQKb131JfL5e56m5 BplBwqMMheLFshoESdfCPQBPGXgqEMLpXoZ2Hax3DkkDLk5aGOgsC/I+12q4GX1QMpTH+yptz5X/D ZYttRWnXsHm1XBlT2KpqJaSHueIAdkY6FxeoCIDM9v60qotQovr4We34j9i0FKMWfUiY=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nbKL0-0004Ye-VG for control@debbugs.gnu.org; Mon, 04 Apr 2022 12:53:36 +0200 Date: Mon, 04 Apr 2022 12:53:31 +0200 Message-Id: <877d85glw4.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #14013 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 14013 + patch quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 14013 + patch quit From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 04 15:51:15 2022 Received: (at 14013) by debbugs.gnu.org; 4 Apr 2022 19:51:15 +0000 Received: from localhost ([127.0.0.1]:53108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbSjL-0004rO-5H for submit@debbugs.gnu.org; Mon, 04 Apr 2022 15:51:15 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:33249) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbSjJ-0004r3-FZ for 14013@debbugs.gnu.org; Mon, 04 Apr 2022 15:51:13 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 8DCDE20002; Mon, 4 Apr 2022 19:51:05 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> <86pmlyqbfh.fsf@mail.linkov.net> Date: Mon, 04 Apr 2022 22:40:11 +0300 In-Reply-To: <86pmlyqbfh.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 03 Apr 2022 21:05:07 +0300") Message-ID: <86lewk4oys.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) > This works surprisingly well. Maybe there are more corner cases, > but something already works with quick tests: But there is a long-standing bug in query-replace. The optimization that uses `match-again` and `looking-at` ignores search-related variables such as isearch-search-fun-function, replace-re-search-function, etc. Here's is a test case that demonstrates the problem in current master with the recent addition of dired-isearch-search-filenames: 1. cd /tmp; touch file1; ln -s file1 file2 2. enter Wdired and move point to the beginning of file2 3. C-M-% .* RET foo RET 4. answer `n` when asked to replace `file2` After that the remaining part of the same line is highlighted, i.e. the part after "file2" (that is a symbolic link) in: file2 -> file1 This is because the `match-again` optimization uses `(looking-at ".*")` after the previous replacement "file2" to ask about the next replacement of " -> file1" that ignores isearch-search-fun-function. I believe it would be safe to just remove this `match-again` optimization from `perform-replace`. From debbugs-submit-bounces@debbugs.gnu.org Tue May 31 04:33:51 2022 Received: (at 14013) by debbugs.gnu.org; 31 May 2022 08:33:51 +0000 Received: from localhost ([127.0.0.1]:46509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvxJz-0005dV-Qy for submit@debbugs.gnu.org; Tue, 31 May 2022 04:33:51 -0400 Received: from mout.web.de ([212.227.17.12]:54731) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvxJj-0005cx-T6 for 14013@debbugs.gnu.org; Tue, 31 May 2022 04:33:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1653986001; bh=CFyA3NFOopVNGAT6k1a1MmDMwXJ5KksaOnwTJzhCRuU=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=fTYTFT2x64S0AUYW1Co1/b6Ae6uHZw3HiCRrTkc7Guv9p5O1h60TjjfgFzS/b1lnV pzyBxxESwJlFdkeVK32rar5JN6MYvo5xo8yt4Y8TOnZat0YlVQLIi+0hqf+eHTx6yB i82zxaEDaLYBeJBm4MxwOZ/U+kmrGg9UvqumieP0= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.60.174.246]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1M9IOj-1nqiW63Dzr-006LzB; Tue, 31 May 2022 10:33:21 +0200 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> Date: Tue, 31 May 2022 10:33:20 +0200 In-Reply-To: <861qygal8h.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 01 Apr 2022 19:39:10 +0300") Message-ID: <87ilpm2jan.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:5ZiIQPLq/lfT25N+gBBEwUIiuHDEfPsL9BWtPHXzGqNAdPFylxy rdAFvRU89t0OZzWEtp7AvqOHDxhlVsZdxOldJlConu32KW6DbZs6CR3xfTkEqnq3PxEUXXX lQ4XIa7UcJSyzh4Q13GyULB6GJYiwLkngOMYgeHdCPSCMvDZjd6T8fypz+f7M7CuSJH9eUE TR9vEZBietsFzXI5zaEHQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:wqYMWYEeJfQ=:9XQm4v3VA6nZ/KbhOIfJ2o 3s9XAQn3yIp4EvxxB2nuZKYwzgizqteS9y9q+lykoXgQ4869yKEWShXItHX8xSL5p/WSfaE5G 6cn6cYB4KoFTTdoWhOLJU4TLDQcOBEvuH9GM9o5LSXR/Rum95P6UM09HHqZagbtYYDLGjM9KT Q0b0yvV6eisnWmUdCrmbPd6aCIV/jnDmc5SD8eg9UudUzax8DnrZ7219anKd4QfY/10Df27UM wwISNMWHlui7p4iowCrqgqQDXwb30m4bCK2BKzg/xUCFtQEXtmr0ohtqpvlAYo28BjB/umVFB 0RR+os6+YQTCDeSW1xOr5fgIjO5O8u8kGjQ2F7pIxBEJ7atE2uTSPnTkWX24xGCRM2MX8RD5z YOYrvpsw/+1PH9V8ROcS6dphBucNdGYGLTxT2w05kHtkbRgvecMPKILO4gtdApnzpijySYCs7 HeP/rK8CsKOmKm+tX7rMtZqIe+3+MFTuUU2upMrtcWhwsZeLSDvkrZgT731c5qtRx/XcsFAqW /f2wq/vJ8wsgQ4pUYPz1pieETT0jkB3e7m5KEEjG0YlBJO3YsOlFQJMW98/A6YTu3nb7gTsSl mYj0O6tqAYWyd57flJt6cnWyxehgIoaqXa9TPlyPNkQgq8io/4VsYYWZBaqAy3fiY1NCrOTtW aPYbYz4WOIItubDBKSnvyrCH/7xogZ93QVOpYn9RC6mgv6FvwnNF41onei48x0CCnxSLwZCob BdRMKZtNXW8x+P1zIW2mjvg9/ES63nGH5dJvB0ww7Ow9P5a/IHwyCywZm/E7Rq+wrcq/Qh97j Rn2dHpDtKMiek+Frf14UJybAj6JthEQoApplHZZWvYJrtJO+sKwzaj+vpR0e6uqO7oDq+ogFZ Kd3Hf6pMrYkBhvdJcHnaY7bGG4sgHh5J40z2i96SIA4cR0m7d5uTLm0gK52JLHw3YW4gXqhfc KoGTenIqfIDIRHQohVr4J3DYSMiDn1FpprFbXFcfbvn4V2AUlk5Q1IXRGS8/pSwyrM3Vttkqz mASpeRFcMufEEMFwDXilsdHdVWEYLaD7OD5Bo1CcmhVOrj8UiJEKAHFWYi+lu0t11il7h2bZ6 jDsD9pWs//35iTczqy56Hogch09e2NxarLo/sAqc8lApu4PrRS8oA3d/w== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: > So the above rectangle when copied to a separate buffer: > > 456 > def > > do you expect it should match the regexp "456.def"? I would not want that this matches. Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue May 31 05:40:18 2022 Received: (at 14013) by debbugs.gnu.org; 31 May 2022 09:40:18 +0000 Received: from localhost ([127.0.0.1]:46661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvyMM-0007VK-39 for submit@debbugs.gnu.org; Tue, 31 May 2022 05:40:18 -0400 Received: from mout.web.de ([212.227.15.14]:44381) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nvyMJ-0007Ur-AB for 14013@debbugs.gnu.org; Tue, 31 May 2022 05:40:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1653990006; bh=rXkCZfdqWOlecCcvNUAoPCDXOdSyWcdAHDIN2MaKJl4=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=LTmfE9U1fSc7FSNZvLOAec0yoT7Gq26eIfrflr5BYLs9wUL/sF/rx7Z76MGNV0qkd R/Qdysxp7nWtmXgYeX9HM9/I5lhc3NRwB2dH2hMzRwcU/QY6M6TJtXtwZH0anHb5VO gI1L8AXtNzBdsRHWRZtwSD8VwQjr91KC4Luz13do= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.60.174.246]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N6K1l-1nkU6W49f7-016TGg; Tue, 31 May 2022 11:40:06 +0200 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> <86pmlyqbfh.fsf@mail.linkov.net> Date: Tue, 31 May 2022 11:40:04 +0200 In-Reply-To: <86pmlyqbfh.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 03 Apr 2022 21:05:07 +0300") Message-ID: <87pmjudoqz.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:tAmmbykunWuPYEhxkB7aDPdct/VSu+SOAjglAytBinK5/BZb0tO JCYEKbW/ZFf0Q+BFM5cxzJKHu9Oziml2wjKgo6rS5xmQEHBhIxEKYZGol2bb7y65ZuNxHqD efMoDeYPUyUGsEuCKHzKl/xzxRSNA9/ioWAhxTDBZcJdPSl4z39fJiDNQGQFx3Z69yESCcY 9ViJxQbB4l2tg8X6hV4mQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:vS0qkIPCC7M=:d+tzOylCxrH/TTAhOZbX1V jGcPDIGq/gT4RinAyOPnlUrP1LRa9K0WAF6Yyq6ARTx2XPALCbf0ayEuH/A5IV/KnzTy2GCWQ Pyo60QL3uaYQcfQ1BdIy82gq2z7ZsZ8Li4WP7pAMSDjVfVUQodE9ciiz63k2hBQvL1VIEX5s4 dXFj0Ue6VPhTJSmHeuec5vvF02D1jNsJOBGfSlXv5bqtj+GshWgZYsN7085bn4klOQ9I5wNQk nH/sGKWfpX/PXhs19+3D4Nph9giGv3jxIeODhn9snSD9jAo6a7gVwtw9blnG37inoX9QFCbCM TFZgodXZtJTy7ehSfayCPTP0pSKecZu7H5iZltV5/OC9r/2KMxWQPy+fu9rxCAg5li08eVuLz AfYtiI6yutAiD4cXxKupzyltaqhzrfTP4ef73MpvjAcqq5ExfSp/5q48o8ajuL9jCnxCS+sPN 4HcX64cMuVVZspMuQghJUlr7k40G4mt8U02SOVZOvDGI7YsZt3JldljHmUwuRuPaJsGNeliRa qMSVtOqUfCOcm/e3fTt9ZlFU924Hdpm12XGnJPmxhsoY5Ohh1ypU5KZ9vARtjn1oC1ThTH3GV jIq7d1w1I1LMTd7tZriAxYvwYcaV5fZImznxpEaKgHl3huVIKfN53vYz+6o8hqurpMGMPFYhC 3zprN8c7dQNPasEM3VulRaSzYVHvqEpi8Ibde0CMvEV/SgDFKw42c0/quxU9AGU7b53SIZQv4 HCnuvNTWmEzrj64GrXkiCvANrJpFcLtoFYT4/m3+55Ld//aqFfooOYVVL4EtwM7hY8Vn8reBb E+qLgQxt0Fhf6eW78Zyk6XZ2zJymmzXCcCNp5IcFS3e/LAaq5Oep5gSF1X/uzCdc2RB0nNr5w zk+rbOlyYifzLm1u/c00eKwVlVDWicfulRCPWE3aeVpVNgLkK6kgSjI9vEeycZTN+ilQNyHRl Zq6QEAg288GOMFVHZjNBRClzqFBwtMg5h0/q4Xji70GSRJYFEVM4HMpJE22j8qwQ+hlWDeVRm uAi5G/sS8sQFLt/yPff9gnsLKKrve+Qz5NyNIJ/xouA3goR7jfqPlq0DjVllHmUsqqIIP2y6/ vXu+znhapnbDiInlObOVTNCDa43DGaVPpJJzIq0BiKPA1OrXEatnDCyJA== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov writes: > This works surprisingly well. Maybe there are more corner cases, > but something already works with quick tests: > > diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el Yes, not bad indeed. Did you find any corner cases? Thanks, Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 08 12:29:08 2022 Received: (at 14013) by debbugs.gnu.org; 8 Jun 2022 16:29:08 +0000 Received: from localhost ([127.0.0.1]:44052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nyyYO-0008PY-GJ for submit@debbugs.gnu.org; Wed, 08 Jun 2022 12:29:08 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:56703) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nyyYM-0008Ol-Ry for 14013@debbugs.gnu.org; Wed, 08 Jun 2022 12:29:07 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 4E5EA24000A; Wed, 8 Jun 2022 16:28:58 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> <86pmlyqbfh.fsf@mail.linkov.net> <87pmjudoqz.fsf@web.de> Date: Wed, 08 Jun 2022 19:28:42 +0300 In-Reply-To: <87pmjudoqz.fsf@web.de> (Michael Heerdegen's message of "Tue, 31 May 2022 11:40:04 +0200") Message-ID: <86v8tbi0th.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) --=-=-= Content-Type: text/plain >> This works surprisingly well. Maybe there are more corner cases, >> but something already works with quick tests: > > Yes, not bad indeed. Did you find any corner cases? Below is the patch that works quite well for the most use cases. But unfortunately, there are still some unsolvable corner cases: when a file name is e.g. "aaxbbx" and the search regexp is "x$", then after removing "$", searching for "x" will find the first occurrence of "x", and will set match-data to it. Later code that uses string-match can adjust the found position to the last occurrence of "x". But it can't change match-data used by isearch. And using a temporary buffer won't help either to set the real buffer positions in match-data to the last "x". IOW, no post-processing can help the main search function to set match-data to the correct place that matches "x$" in the dired buffer (and file name doesn't always end at eol). --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=dired-isearch-search-filenames.patch diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 4faf9431aa..bb17760598 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -3217,7 +3217,17 @@ dired-isearch-search-filenames (if isearch-forward old (max (1- old) (point-min))) property) old)) - end found) + end found regexp regexp-^ regexp-$ (i 0)) + (when isearch-regexp + (setq regexp string) + (while (string-match "\\(\\^\\|\\\\`\\)\\|\\$\\|\\\\'" string i) + (setq i (match-beginning 0)) + (if (save-match-data (not (subregexp-context-p + string (match-beginning 0)))) + ;; The ^/$ is inside a char-range or escaped or something. + (setq i (1+ i)) + (setq string (replace-match "" t t string)) + (if (match-beginning 1) (setq regexp-^ t) (setq regexp-$ t))))) ;; Otherwise, try to search for the next property. (unless beg (setq beg (if isearch-forward @@ -3236,6 +3246,29 @@ dired-isearch-search-filenames (max bound end)) end) noerror count)) + ;; Handle ^/$ specially + (when (and regexp found) + ;; Apply ^/$ regexp on the whole filename field + (save-match-data + (if (string-match regexp (buffer-substring beg end)) + ;; FIXME: better to modify previous match-data + (setq found (if isearch-forward + (+ beg (match-end 0)) + (- beg (match-end 0)))) + (setq found nil))) + ;; Check ^/$ matches at filename field boundaries + (when found + (goto-char found) + (unless (and (or (not regexp-^) + (eq (if isearch-forward beg end) (point-min)) + (null (get-text-property + (1- (if isearch-forward beg end)) property))) + (or (not regexp-$) + (eq (point) (point-max)) + (null (get-text-property + (point) property)))) + (setq found nil)))) + ;; Get the next filename field (unless found (setq beg (if isearch-forward (next-single-property-change end property) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 09 13:52:07 2022 Received: (at 14013) by debbugs.gnu.org; 9 Jun 2022 17:52:07 +0000 Received: from localhost ([127.0.0.1]:47692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzMKF-0007Dq-8E for submit@debbugs.gnu.org; Thu, 09 Jun 2022 13:52:07 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:51813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzMKD-0007DK-2M for 14013@debbugs.gnu.org; Thu, 09 Jun 2022 13:52:06 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 69F2E240005; Thu, 9 Jun 2022 17:51:56 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> <87ilpm2jan.fsf@web.de> Date: Thu, 09 Jun 2022 20:30:45 +0300 In-Reply-To: <87ilpm2jan.fsf@web.de> (Michael Heerdegen's message of "Tue, 31 May 2022 10:33:20 +0200") Message-ID: <86mtelbua2.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) >> So the above rectangle when copied to a separate buffer: >> >> 456 >> def >> >> do you expect it should match the regexp "456.def"? > > I would not want that this matches. BTW, do you think that such regexps as ".*" and "^.*$" should be supported not only in Dired buffers, but also when making replacements in rectangular regions? E.g. C-x SPC ... C-M-% .* RET RET should effectively clear the region, etc. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 10 12:44:55 2022 Received: (at 14013) by debbugs.gnu.org; 10 Jun 2022 16:44:56 +0000 Received: from localhost ([127.0.0.1]:51129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzhkl-0003xx-PP for submit@debbugs.gnu.org; Fri, 10 Jun 2022 12:44:55 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:42687) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzhkj-0003xR-WB for 14013@debbugs.gnu.org; Fri, 10 Jun 2022 12:44:54 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 3BBF14000A; Fri, 10 Jun 2022 16:44:45 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> <87ilpm2jan.fsf@web.de> Date: Fri, 10 Jun 2022 19:44:09 +0300 In-Reply-To: <87ilpm2jan.fsf@web.de> (Michael Heerdegen's message of "Tue, 31 May 2022 10:33:20 +0200") Message-ID: <86czfgbh9i.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) >> So the above rectangle when copied to a separate buffer: >> >> 456 >> def >> >> do you expect it should match the regexp "456.def"? > > I would not want that this matches. I generalized dired-isearch-search-filenames to a new function that can search in any text property, so e.g. after evaluating (setq-local isearch-search-fun-function (lambda () (isearch-search-fun-in-text-property 'face))) isearch will match .* in all fontified chunks, etc. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 10 13:40:28 2022 Received: (at 14013) by debbugs.gnu.org; 10 Jun 2022 17:40:28 +0000 Received: from localhost ([127.0.0.1]:51244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzicW-0005OU-6W for submit@debbugs.gnu.org; Fri, 10 Jun 2022 13:40:28 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:43541) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nzicU-0005OG-4s for 14013@debbugs.gnu.org; Fri, 10 Jun 2022 13:40:26 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 3ED0B1C0006; Fri, 10 Jun 2022 17:40:17 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> <86pmlyqbfh.fsf@mail.linkov.net> <87pmjudoqz.fsf@web.de> Date: Fri, 10 Jun 2022 20:17:25 +0300 In-Reply-To: <87pmjudoqz.fsf@web.de> (Michael Heerdegen's message of "Tue, 31 May 2022 11:40:04 +0200") Message-ID: <861qvw773e.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) --=-=-= Content-Type: text/plain >> This works surprisingly well. Maybe there are more corner cases, >> but something already works with quick tests: >> >> diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el > > Yes, not bad indeed. Did you find any corner cases? Using a temporary buffer like you proposed works fine, and handles all possible regexps including corner cases. However, wouldn't this make the search too inefficient? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=isearch-search-fun-in-text-property.patch diff --git a/lisp/isearch.el b/lisp/isearch.el index 5fbfb724a3..8470170f24 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -4482,12 +4545,25 @@ isearch-search-fun-in-text-property (setq end (if isearch-forward (next-single-property-change beg property) (previous-single-property-change beg property))) - (setq found (funcall (or search-fun (isearch-search-fun-default)) - string (if bound (if isearch-forward - (min bound end) - (max bound end)) - end) - noerror count)) + (if (and isearch-regexp (string-match-p "\\(\\^\\)\\|\\$" string)) + (let ((substring (buffer-substring beg end)) + match-data) + (with-temp-buffer + (insert substring) + (goto-char (point-min)) + (setq found (funcall (or search-fun (isearch-search-fun-default)) + string (if bound (- bound beg) (1+ (- end beg))) + noerror count)) + (when found + (setq found (+ found beg) + match-data (mapcar (lambda (m) (1- (+ m beg))) (match-data))))) + (when match-data (set-match-data match-data))) + (setq found (funcall (or search-fun (isearch-search-fun-default)) + string (if bound (if isearch-forward + (min bound end) + (max bound end)) + end) + noerror count))) (unless found (setq beg (if isearch-forward (next-single-property-change end property) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 12 12:46:44 2022 Received: (at 14013) by debbugs.gnu.org; 12 Jun 2022 16:46:44 +0000 Received: from localhost ([127.0.0.1]:56416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0Qjc-0005Pe-8N for submit@debbugs.gnu.org; Sun, 12 Jun 2022 12:46:44 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:57209) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0Qja-0005PN-Mf; Sun, 12 Jun 2022 12:46:43 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 172761BF206; Sun, 12 Jun 2022 16:46:33 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> <86pmlyqbfh.fsf@mail.linkov.net> <87pmjudoqz.fsf@web.de> <861qvw773e.fsf@mail.linkov.net> Date: Sun, 12 Jun 2022 19:46:04 +0300 In-Reply-To: <861qvw773e.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 10 Jun 2022 20:17:25 +0300") Message-ID: <86y1y1q183.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) close 14013 29.0.50 thanks >>> This works surprisingly well. Maybe there are more corner cases, >>> but something already works with quick tests: >> >> Yes, not bad indeed. Did you find any corner cases? > > Using a temporary buffer like you proposed works fine, > and handles all possible regexps including corner cases. > However, wouldn't this make the search too inefficient? Now the implementation that supports all cases is pushed. Thanks for all suggestions that helped to achieve this. Any ideas for more improvements are welcome. From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 14 12:33:15 2022 Received: (at 14013) by debbugs.gnu.org; 14 Jun 2022 16:33:15 +0000 Received: from localhost ([127.0.0.1]:35594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o19Te-0001cY-PT for submit@debbugs.gnu.org; Tue, 14 Jun 2022 12:33:14 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:35795) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o19Tc-0001cI-P1 for 14013@debbugs.gnu.org; Tue, 14 Jun 2022 12:33:13 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id C8692FF806; Tue, 14 Jun 2022 16:33:04 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> <87ilpm2jan.fsf@web.de> <86czfgbh9i.fsf@mail.linkov.net> Date: Tue, 14 Jun 2022 19:31:42 +0300 In-Reply-To: <86czfgbh9i.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 10 Jun 2022 19:44:09 +0300") Message-ID: <865yl3gqa9.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) > I generalized dired-isearch-search-filenames to a new function > that can search in any text property, so e.g. after evaluating > > (setq-local isearch-search-fun-function > (lambda () (isearch-search-fun-in-text-property 'face))) > > isearch will match .* in all fontified chunks, etc. I'm sure later someone might want to add more args such as e.g. text-property-search-forward has PROPERTY &optional VALUE PREDICATE ... So better to change the signature in anticipation of adding more args after PROPERTY: diff --git a/lisp/isearch.el b/lisp/isearch.el -(defun isearch-search-fun-in-text-property (property &optional search-fun) +(defun isearch-search-fun-in-text-property (search-fun property) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el @@ -3208,7 +3208,7 @@ dired-isearch-search-filenames - (isearch-search-fun-in-text-property 'dired-filename (funcall orig-fun))) + (isearch-search-fun-in-text-property (funcall orig-fun) 'dired-filename)) From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 15 12:36:22 2022 Received: (at 14013) by debbugs.gnu.org; 15 Jun 2022 16:36:22 +0000 Received: from localhost ([127.0.0.1]:39695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1W0D-0006yH-Pg for submit@debbugs.gnu.org; Wed, 15 Jun 2022 12:36:22 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:41121) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1W0B-0006xz-KZ for 14013@debbugs.gnu.org; Wed, 15 Jun 2022 12:36:20 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 8FEC0200005; Wed, 15 Jun 2022 16:36:11 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> <87ilpm2jan.fsf@web.de> <86mtelbua2.fsf@mail.linkov.net> Date: Wed, 15 Jun 2022 19:34:39 +0300 In-Reply-To: <86mtelbua2.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 09 Jun 2022 20:30:45 +0300") Message-ID: <86a6ad6i2c.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) --=-=-= Content-Type: text/plain > BTW, do you think that such regexps as ".*" and "^.*$" > should be supported not only in Dired buffers, but also > when making replacements in rectangular regions? > E.g. C-x SPC ... C-M-% .* RET RET should effectively > clear the region, etc. After a small refactoring, searching in rectangular regions is implemented as well: --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=isearch-search-fun-in-noncontiguous-region.patch Content-Transfer-Encoding: 8bit diff --git a/lisp/isearch.el b/lisp/isearch.el index 7650ebcfce..2fd172e75c 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -4455,18 +4518,45 @@ minibuffer-lazy-highlight-setup (funcall after-change nil nil nil))))) +(defun isearch-search-fun-in-noncontiguous-region (search-fun region-bounds) + "Return the function that searches inside noncontiguous regions." + (apply-partially + #'search-within-boundaries + search-fun + (lambda (pos) + (seq-some (lambda (b) (and (>= pos (car b)) (<= pos (cdr b)))) + region-bounds)) + (lambda (pos) + (let* ((bounds (flatten-list region-bounds)) + found) + (unless isearch-forward + (setq bounds (nreverse bounds))) + (while (and bounds (not found)) + (if (if isearch-forward (< pos (car bounds)) (> pos (car bounds))) + (setq found (car bounds)) + (setq bounds (cdr bounds)))) + found)))) + (defun isearch-search-fun-in-text-property (search-fun property) "Return the function to search inside text that has the specified PROPERTY. The function will limit the search for matches only inside text which has this property in the current buffer. The argument SEARCH-FUN provides the function to search text, and defaults to the value of `isearch-search-fun-default' when nil." - (lambda (string &optional bound noerror count) + (apply-partially + #'search-within-boundaries + search-fun + (lambda (pos) (get-text-property pos property)) + (lambda (pos) (if isearch-forward + (next-single-property-change pos property) + (previous-single-property-change pos property))))) + +(defun search-within-boundaries ( search-fun get-fun next-fun + string &optional bound noerror count) (let* ((old (point)) ;; Check if point is already on the property. - (beg (when (get-text-property - (if isearch-forward old (max (1- old) (point-min))) - property) + (beg (when (funcall get-fun (if isearch-forward old + (max (1- old) (point-min)))) old)) end found (i 0) (subregexp @@ -4480,30 +4570,23 @@ isearch-search-fun-in-text-property (throw 'subregexp t)))))))) ;; Otherwise, try to search for the next property. (unless beg - (setq beg (if isearch-forward - (next-single-property-change old property) - (previous-single-property-change old property))) + (setq beg (funcall next-fun old)) (when beg (goto-char beg))) ;; Non-nil `beg' means there are more properties. (while (and beg (not found)) ;; Search for the end of the current property. - (setq end (if isearch-forward - (next-single-property-change beg property) - (previous-single-property-change beg property))) + (setq end (funcall next-fun beg)) ;; Handle ^/$ specially by matching in a temporary buffer. (if subregexp (let* ((prop-beg (if (or (if isearch-forward (bobp) (eobp)) - (null (get-text-property - (+ (point) (if isearch-forward -1 0)) - property))) + (null (funcall get-fun (+ (point) + (if isearch-forward -1 0))))) ;; Already at the beginning of the field. beg ;; Get the real beginning of the field when ;; the search was started in the middle. - (if isearch-forward - (previous-single-property-change beg property) - (next-single-property-change beg property)))) + (funcall next-fun beg))) (substring (buffer-substring prop-beg end)) (offset (if isearch-forward prop-beg end)) match-data) @@ -4532,12 +4615,10 @@ isearch-search-fun-in-text-property noerror count))) ;; Get the next text property. (unless found - (setq beg (if isearch-forward - (next-single-property-change end property) - (previous-single-property-change end property))) + (setq beg (funcall next-fun end)) (when beg (goto-char beg)))) (unless found (goto-char old)) - found))) + found)) (defun isearch-resume (string regexp word forward message case-fold) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 30 14:02:25 2022 Received: (at 14013) by debbugs.gnu.org; 30 Jun 2022 18:02:25 +0000 Received: from localhost ([127.0.0.1]:35562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6yUi-0002ML-N3 for submit@debbugs.gnu.org; Thu, 30 Jun 2022 14:02:25 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:54561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6yUg-0002M3-0H for 14013@debbugs.gnu.org; Thu, 30 Jun 2022 14:02:23 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 96D9B20010; Thu, 30 Jun 2022 18:02:12 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames In-Reply-To: <86mtelbua2.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 09 Jun 2022 20:30:45 +0300") Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> <87ilpm2jan.fsf@web.de> <86mtelbua2.fsf@mail.linkov.net> Date: Thu, 30 Jun 2022 20:45:17 +0300 Message-ID: <86mtduuk02.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) --=-=-= Content-Type: text/plain > BTW, do you think that such regexps as ".*" and "^.*$" > should be supported not only in Dired buffers, but also > when making replacements in rectangular regions? > E.g. C-x SPC ... C-M-% .* RET RET should effectively > clear the region, etc. Here is a complete patch with tests: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=search-noncontiguous-region.patch diff --git a/lisp/isearch.el b/lisp/isearch.el index 34c3665bd8..14e5bfb93f 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2805,12 +2806,10 @@ isearch-search-and-update (if (and (eq case-fold-search t) search-upper-case) (setq case-fold-search (isearch-no-upper-case-p isearch-string isearch-regexp))) - (looking-at (cond - ((functionp isearch-regexp-function) - (funcall isearch-regexp-function isearch-string t)) - (isearch-regexp-function (word-search-regexp isearch-string t)) - (isearch-regexp isearch-string) - (t (regexp-quote isearch-string))))) + ;; Like `looking-at' but uses search functions: + (let ((isearch-forward t)) + (isearch-search-string + (concat "\\=\\(?:" isearch-string "\\)") nil t))) (error nil)) (or isearch-yank-flag (<= (match-end 0) @@ -4381,6 +4401,7 @@ minibuffer-lazy-highlight-setup (cleanup lazy-highlight-cleanup) (transform #'identity) (filter nil) + (search-fun nil) (regexp isearch-regexp) (regexp-function isearch-regexp-function) (case-fold isearch-case-fold-search) @@ -4400,6 +4421,7 @@ minibuffer-lazy-highlight-setup TRANSFORM: A function taking one argument, the minibuffer contents, and returning the `isearch-string' to use for lazy highlighting. FILTER: A function to add to `isearch-filter-predicate'. +SEARCH-FUN: A function to add to `isearch-search-fun-function'. REGEXP: The value of `isearch-regexp' to use for lazy highlighting. REGEXP-FUNCTION: The value of `isearch-regexp-function' to use for lazy highlighting. @@ -4419,6 +4441,9 @@ minibuffer-lazy-highlight-setup (when filter (with-current-buffer buffer (remove-function (local 'isearch-filter-predicate) filter))) + (when search-fun + (with-current-buffer buffer + (remove-function (local 'isearch-search-fun-function) search-fun))) (remove-hook 'lazy-count-update-hook display-count) (when overlay (delete-overlay overlay)) (remove-hook 'after-change-functions after-change t) @@ -4454,92 +4479,123 @@ minibuffer-lazy-highlight-setup (when filter (with-current-buffer buffer (add-function :after-while (local 'isearch-filter-predicate) filter))) + (when search-fun + (with-current-buffer buffer + (add-function :around (local 'isearch-search-fun-function) search-fun))) (funcall after-change nil nil nil))))) +(defun isearch-search-fun-in-noncontiguous-region (search-fun bounds) + "Return the function that searches inside noncontiguous regions. +A noncontiguous regions is defined by the argument BOUNDS that +is a list of cons cells of the form (START . END)." + (apply-partially + #'search-within-boundaries + search-fun + (lambda (pos) + (seq-some (lambda (b) (if isearch-forward + (and (>= pos (car b)) (< pos (cdr b))) + (and (> pos (car b)) (<= pos (cdr b))))) + bounds)) + (lambda (pos) + (let ((bounds (flatten-list bounds)) + found) + (unless isearch-forward + (setq bounds (nreverse bounds))) + (while (and bounds (not found)) + (if (if isearch-forward (< pos (car bounds)) (> pos (car bounds))) + (setq found (car bounds)) + (setq bounds (cdr bounds)))) + found)))) + (defun isearch-search-fun-in-text-property (search-fun property) "Return the function to search inside text that has the specified PROPERTY. The function will limit the search for matches only inside text which has this property in the current buffer. The argument SEARCH-FUN provides the function to search text, and defaults to the value of `isearch-search-fun-default' when nil." - (lambda (string &optional bound noerror count) - (let* ((old (point)) - ;; Check if point is already on the property. - (beg (when (get-text-property - (if isearch-forward old (max (1- old) (point-min))) - property) - old)) - end found (i 0) - (subregexp - (and isearch-regexp - (save-match-data - (catch 'subregexp - (while (string-match "\\^\\|\\$" string i) - (setq i (match-end 0)) - (when (subregexp-context-p string (match-beginning 0)) - ;; The ^/$ is not inside a char-range or escaped. - (throw 'subregexp t)))))))) - ;; Otherwise, try to search for the next property. - (unless beg - (setq beg (if isearch-forward - (next-single-property-change old property) - (previous-single-property-change old property))) - (when beg (goto-char beg))) - ;; Non-nil `beg' means there are more properties. - (while (and beg (not found)) - ;; Search for the end of the current property. - (setq end (if isearch-forward - (next-single-property-change beg property) - (previous-single-property-change beg property))) - ;; Handle ^/$ specially by matching in a temporary buffer. - (if subregexp - (let* ((prop-beg - (if (or (if isearch-forward (bobp) (eobp)) - (null (get-text-property - (+ (point) (if isearch-forward -1 0)) - property))) - ;; Already at the beginning of the field. - beg - ;; Get the real beginning of the field when - ;; the search was started in the middle. - (if isearch-forward - (previous-single-property-change beg property) - (next-single-property-change beg property)))) - (substring (buffer-substring prop-beg end)) - (offset (if isearch-forward prop-beg end)) - match-data) - (with-temp-buffer - (insert substring) - (goto-char (- beg offset -1)) - ;; Apply ^/$ regexp on the whole extracted substring. - (setq found (funcall - (or search-fun (isearch-search-fun-default)) - string (and bound (max (point-min) - (min (point-max) - (- bound offset -1)))) - noerror count)) - ;; Adjust match data as if it's matched in original buffer. - (when found - (setq found (+ found offset -1) - match-data (mapcar (lambda (m) (+ m offset -1)) - (match-data))))) - (when match-data (set-match-data match-data))) - (setq found (funcall - (or search-fun (isearch-search-fun-default)) - string (if bound (if isearch-forward - (min bound end) - (max bound end)) - end) - noerror count))) - ;; Get the next text property. - (unless found - (setq beg (if isearch-forward - (next-single-property-change end property) - (previous-single-property-change end property))) - (when beg (goto-char beg)))) - (unless found (goto-char old)) - found))) + (apply-partially + #'search-within-boundaries + search-fun + (lambda (pos) (get-text-property (if isearch-forward pos + (max (1- pos) (point-min))) + property)) + (lambda (pos) (if isearch-forward + (next-single-property-change pos property) + (previous-single-property-change pos property))))) + +(defun search-within-boundaries ( search-fun get-fun next-fun + string &optional bound noerror count) + (let* ((old (point)) + ;; Check if point is already on the property. + (beg (when (funcall get-fun old) old)) + end found (i 0) + (subregexp + (and isearch-regexp + (save-match-data + (catch 'subregexp + (while (string-match "\\^\\|\\$" string i) + (setq i (match-end 0)) + (when (subregexp-context-p string (match-beginning 0)) + ;; The ^/$ is not inside a char-range or escaped. + (throw 'subregexp t)))))))) + ;; Otherwise, try to search for the next property. + (unless beg + (setq beg (funcall next-fun old)) + (when beg (goto-char beg))) + ;; Non-nil `beg' means there are more properties. + (while (and beg (not found)) + ;; Search for the end of the current property. + (setq end (funcall next-fun beg)) + ;; Handle ^/$ specially by matching in a temporary buffer. + (if subregexp + (let* ((prop-beg + (if (or (if isearch-forward (bobp) (eobp)) + (null (funcall get-fun + (+ (point) + (if isearch-forward -1 1))))) + ;; Already at the beginning of the field. + beg + ;; Get the real beginning of the field when + ;; the search was started in the middle. + (let ((isearch-forward (not isearch-forward))) + ;; Search in the reverse direction. + (funcall next-fun beg)))) + (substring (buffer-substring prop-beg end)) + (offset (if isearch-forward prop-beg end)) + match-data) + (with-temp-buffer + (insert substring) + (goto-char (- beg offset -1)) + ;; Apply ^/$ regexp on the whole extracted substring. + (setq found (funcall + (or search-fun (isearch-search-fun-default)) + string (and bound (max (point-min) + (min (point-max) + (- bound offset -1)))) + noerror count)) + ;; Adjust match data as if it's matched in original buffer. + (when found + (setq found (+ found offset -1) + match-data (mapcar (lambda (m) (+ m offset -1)) + (match-data))))) + (when found (goto-char found)) + (when match-data (set-match-data + (mapcar (lambda (m) (copy-marker m)) + match-data)))) + (setq found (funcall + (or search-fun (isearch-search-fun-default)) + string (if bound (if isearch-forward + (min bound end) + (max bound end)) + end) + noerror count))) + ;; Get the next text property. + (unless found + (setq beg (funcall next-fun end)) + (when beg (goto-char beg)))) + (unless found (goto-char old)) + found)) (defun isearch-resume (string regexp word forward message case-fold) diff --git a/lisp/replace.el b/lisp/replace.el index 34c3d5299e..ca2edbf8ea 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -371,9 +371,6 @@ query-replace-read-args (from (minibuffer-with-setup-hook (minibuffer-lazy-highlight-setup :case-fold case-fold-search - :filter (when (use-region-p) - (replace--region-filter - (funcall region-extract-function 'bounds))) :highlight query-replace-lazy-highlight :regexp regexp-flag :regexp-function (or replace-regexp-function @@ -381,6 +378,15 @@ query-replace-read-args (and replace-char-fold (not regexp-flag) #'char-fold-to-regexp)) + :search-fun (when (use-region-p) + (let ((bounds + (mapcar (lambda (p) + (cons (copy-marker (car p)) + (copy-marker (cdr p)))) + (funcall region-extract-function 'bounds)))) + (lambda (orig-fun) + (isearch-search-fun-in-noncontiguous-region + (funcall orig-fun) bounds)))) :transform (lambda (string) (let* ((split (query-replace--split-string string)) (from-string (if (consp split) (car split) split))) @@ -2850,26 +2856,6 @@ replace--push-stack ,search-str ,next-replace) ,stack)) -(defun replace--region-filter (bounds) - "Return a function that decides if a region is inside BOUNDS. -BOUNDS is a list of cons cells of the form (START . END). The -returned function takes as argument two buffer positions, START -and END." - (let ((region-bounds - (mapcar (lambda (position) - (cons (copy-marker (car position)) - (copy-marker (cdr position)))) - bounds))) - (lambda (start end) - (delq nil (mapcar - (lambda (bounds) - (and - (>= start (car bounds)) - (<= start (cdr bounds)) - (>= end (car bounds)) - (<= end (cdr bounds)))) - region-bounds))))) - (defun perform-replace (from-string replacements query-flag regexp-flag delimited-flag &optional repeat-count map start end backward region-noncontiguous-p) @@ -2930,7 +2916,28 @@ perform-replace ;; If non-nil, it is marker saying where in the buffer to stop. (limit nil) - (region-filter nil) + + ;; Unless a single contiguous chunk is selected, operate on multiple chunks. + (noncontiguous-region-bounds + (when region-noncontiguous-p + (mapcar (lambda (p) + (cons (copy-marker (car p)) + (copy-marker (cdr p)))) + (funcall region-extract-function 'bounds)))) + (noncontiguous-search-fun + (when noncontiguous-region-bounds + (isearch-search-fun-in-noncontiguous-region + nil noncontiguous-region-bounds))) + (replace-search-function + (or replace-search-function noncontiguous-search-fun)) + (replace-re-search-function + ;; To be able to use "^.*$" on rectangles + (or replace-re-search-function noncontiguous-search-fun)) + (replace-search-fun-function + (when noncontiguous-region-bounds + (lambda (orig-fun) + (isearch-search-fun-in-noncontiguous-region + (funcall orig-fun) noncontiguous-region-bounds)))) ;; Data for the next match. If a cons, it has the same format as ;; (match-data); otherwise it is t if a match is possible at point. @@ -2952,11 +2959,10 @@ perform-replace "(\\\\[help] for help) ")) minibuffer-prompt-properties)))) - ;; Unless a single contiguous chunk is selected, operate on multiple chunks. - (when region-noncontiguous-p - (setq region-filter (replace--region-filter - (funcall region-extract-function 'bounds))) - (add-function :after-while isearch-filter-predicate region-filter)) + ;; For lazy-highlight during replacement + (when replace-search-fun-function + (add-function :around isearch-search-fun-function + replace-search-fun-function)) ;; If region is active, in Transient Mark mode, operate on region. (if backward @@ -3052,9 +3058,11 @@ perform-replace (setq match-again (and nonempty-match (or (not regexp-flag) - (and (if backward - (looking-back search-string nil) - (looking-at search-string)) + ;; Like `looking-at' but uses search functions: + (and (replace-search + (concat "\\=\\(?:" search-string "\\)") + limit regexp-flag delimited-flag + case-fold-search backward) (let ((match (match-data))) (and (/= (nth 0 match) (nth 1 match)) match)))))) @@ -3323,7 +3331,8 @@ perform-replace ;; when perform-replace was started from ;; `xref--query-replace-1' that let-binds ;; `isearch-filter-predicate' (bug#53758). - (isearch-filter-predicate #'isearch-filter-visible)) + (isearch-filter-predicate #'isearch-filter-visible) + (isearch-search-fun-function #'isearch-search-fun-default)) (setq real-match-data (replace-match-data nil real-match-data real-match-data)) @@ -3337,8 +3346,13 @@ perform-replace ;; decide whether the search string ;; can match again just after this match. (if (and regexp-flag nonempty-match) - (setq match-again (and (looking-at search-string) - (match-data))))) + (setq match-again + (and (save-window-excursion + (replace-search + (concat "\\=\\(?:" search-string "\\)") + limit regexp-flag delimited-flag + case-fold-search backward)) + (match-data))))) ;; Edit replacement. ((or (eq def 'edit-replacement) (eq def 'edit-replacement-exact-case)) @@ -3406,8 +3420,9 @@ perform-replace search-string-replaced nil last-was-act-and-show nil)))))) (replace-dehighlight) - (when region-filter - (remove-function isearch-filter-predicate region-filter))) + (when replace-search-fun-function + (remove-function isearch-search-fun-function + replace-search-fun-function))) (or unread-command-events (message (ngettext "Replaced %d occurrence%s" "Replaced %d occurrences%s" diff --git a/test/lisp/isearch-tests.el b/test/lisp/isearch-tests.el index 4600757d94..82f9fb0fe9 100644 --- a/test/lisp/isearch-tests.el +++ b/test/lisp/isearch-tests.el @@ -38,5 +38,85 @@ isearch--test-done ;; Bug #21091: let `isearch-done' work without `isearch-update'. (isearch-done)) + +;; Search functions. + +(defun isearch--test-search-within-boundaries (pairs) + (goto-char (point-min)) + (let ((isearch-forward t) + (isearch-regexp nil)) + (dolist (pos (append pairs nil)) + (should (eq (cdr pos) (isearch-search-string "foo" nil t))) + (should (equal (match-string 0) "foo")) + (when (car pos) (should (eq (car pos) (match-beginning 0)))))) + + (goto-char (point-max)) + (let ((isearch-forward nil) + (isearch-regexp nil)) + (dolist (pos (append (reverse pairs) nil)) + (should (eq (car pos) (isearch-search-string "foo" nil t))) + (should (equal (match-string 0) "foo")) + (when (cdr pos) (should (eq (cdr pos) (match-end 0)))))) + + (goto-char (point-min)) + (let ((isearch-forward t) + (isearch-regexp t)) + (dolist (pos (append pairs nil)) + (should (eq (cdr pos) (isearch-search-string ".*" nil t))) + (should (equal (match-string 0) "foo")) + (when (car pos) (should (eq (car pos) (match-beginning 0)))))) + + (goto-char (point-min)) + (let ((isearch-forward t) + (isearch-regexp t)) + (dolist (pos (append pairs nil)) + (should (eq (cdr pos) (isearch-search-string "^.*" nil t))) + (should (equal (match-string 0) "foo")) + (when (car pos) (should (eq (car pos) (match-beginning 0)))))) + + (goto-char (point-min)) + (let ((isearch-forward t) + (isearch-regexp t)) + (dolist (pos (append pairs nil)) + (should (eq (cdr pos) (isearch-search-string ".*$" nil t))) + (should (equal (match-string 0) "foo")) + (when (car pos) (should (eq (car pos) (match-beginning 0)))))) + + (goto-char (point-max)) + (let ((isearch-forward nil) + (isearch-regexp t)) + (dolist (pos (append (reverse pairs) nil)) + (should (eq (car pos) (isearch-search-string "^.*" nil t))) + (should (equal (match-string 0) "foo")) + (when (cdr pos) (should (eq (cdr pos) (match-end 0)))))) + + (goto-char (point-max)) + (let ((isearch-forward nil) + (isearch-regexp t)) + (dolist (pos (append (reverse pairs) nil)) + (should (eq (car pos) (isearch-search-string "foo$" nil t))) + (should (equal (match-string 0) "foo")) + (when (cdr pos) (should (eq (cdr pos) (match-end 0))))))) + +(ert-deftest isearch--test-search-fun-in-text-property () + (let* ((pairs '((4 . 7) (11 . 14) (21 . 24))) + (isearch-search-fun-function + (lambda () (isearch-search-fun-in-text-property nil 'dired-filename)))) + (with-temp-buffer + (insert "foo" (propertize "foo" 'dired-filename t) "foo\n") + (insert (propertize "foo" 'dired-filename t) "foo\n") + (insert "foo" (propertize "foo" 'dired-filename t) "\n") + (isearch--test-search-within-boundaries pairs)))) + +(ert-deftest isearch--test-search-fun-in-noncontiguous-region () + (let* ((pairs '((4 . 7) (11 . 14) (21 . 24))) + (isearch-search-fun-function + (lambda () (isearch-search-fun-in-noncontiguous-region nil pairs)))) + (with-temp-buffer + (insert "foofoofoo\n") + (insert "foofoo\n") + (insert "foofoo\n") + (isearch--test-search-within-boundaries pairs)))) + (provide 'isearch-tests) ;;; isearch-tests.el ends here diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el index ef1e5c3eaf..e59883b5b6 100644 --- a/test/lisp/replace-tests.el +++ b/test/lisp/replace-tests.el @@ -460,20 +460,12 @@ query-replace-search-function-tests (let* ((replace-re-search-function #'re-search-forward)) (query-replace--run-tests query-replace-tests)) - (let* ((pairs '((1 . 2) (3 . 4))) + (let* ((bounds '((1 . 2) (3 . 4))) (replace-re-search-function - (lambda (string &optional _bound noerror count) - (let (found) - (while (and (not found) pairs) - (goto-char (caar pairs)) - (when (re-search-forward string (cdar pairs) noerror count) - (setq found t)) - (pop pairs)) - found))) + (isearch-search-fun-in-noncontiguous-region nil bounds)) (tests '( - ;; FIXME: this test should pass after fixing bug#54733: - ;; ("aaaa" "C-M-% .* RET 1 RET !" "1a1a") + ("aaaa" "C-M-% .* RET 1 RET !" "1a1a") ))) (query-replace--run-tests tests))) @@ -485,8 +477,9 @@ perform-replace-tests ;; Test case from commit 5632eb272c7 ("a a a " "\\ba " "c" nil t nil nil nil nil nil nil nil "ccc") ; not "ca c" ;; The same with region inside the second match - ;; FIXME: this test should pass after fixing bug#54733: - ;; ("a a a " "\\ba " "c" nil t nil nil nil 1 4 nil nil "ca a ") + ("a a a " "\\ba " "c" nil t nil nil nil 1 3 nil nil "ca a ") + ("a a a " "\\ba " "c" nil t nil nil nil 1 4 nil nil "ca a ") + ("a a a " "\\ba " "c" nil t nil nil nil 1 5 nil nil "cca ") )) (defun perform-replace--run-tests (tests) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 03 13:34:38 2022 Received: (at 14013) by debbugs.gnu.org; 3 Jul 2022 17:34:39 +0000 Received: from localhost ([127.0.0.1]:45479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o83UU-0008Mv-Nz for submit@debbugs.gnu.org; Sun, 03 Jul 2022 13:34:38 -0400 Received: from mout.web.de ([212.227.15.14]:46291) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o83UT-0008Mi-48 for 14013@debbugs.gnu.org; Sun, 03 Jul 2022 13:34:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1656869667; bh=EwYWBd4InlfneRjXP0U4LOM0CkzFln8Ocs/i/KHUEe8=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=HLSqT7AVE2WkjDsIk0mbekTDAr6YUpN4n11tZ7GVMEeAiFUoL/efYaSh9ouIROJ1s r2WFYRLQGlyWFSRlW+Pyg67NP6afQHWRO0g0C0gEebj9dRhZVVcpmHNlxltEjwhFW4 ezKxC+0ZPrLaA49R8Ow3bhQ5WEadc0b+5T46Hmk0= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([88.66.201.45]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MTfon-1o2G4c1bK9-00UDmO; Sun, 03 Jul 2022 19:34:27 +0200 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames In-Reply-To: <86mtduuk02.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 30 Jun 2022 20:45:17 +0300") References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> <87ilpm2jan.fsf@web.de> <86mtelbua2.fsf@mail.linkov.net> <86mtduuk02.fsf@mail.linkov.net> Date: Sun, 03 Jul 2022 19:34:26 +0200 Message-ID: <87tu7y85i5.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:Tgu+gfj+VWHlcQl9wK+jB+Ik1WzK2V0/BiLD67VPJoqCFo2U45E AhVUPr7VjPML+vxiJn+IfgvY5YDrH3LKjKlFSomOBlWxP328mKo2ClD8FqaInWQalA67nJG CmltBNO4xyaUMMUvWtNUdcWc6N5fwAnBHeL9iFCkdPwNrGsRIiFiSgngBZ4v69gd4xheY7C cEGWMxNyC3jeVKO+25Rdw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:KyoMrP1rEoY=:goF1Ms+w2i4MLCriY8bn4I cFMufNpOumwByBsq4YxLW4Wj78JCI8S3cJs1s2PPMTEJfKiu6I1wQ1WX6UmgE91cqKD1yV/nH sjYYmvshKcthdwF9IMHCBvwjYJCxe7qeabP5ytrzYKk6J8oOk1tUSxM4prmYFwu+kljBzqHGW BcBGviZXfyGkLEYKV1wy+/0zUNzBhvxp+rmmUNDQ+nFkjTfoPEv+AWDK0o6ZJVOIzN4WTWuq0 tKS/8T/nVh2PzygSb1nVAoW01vOJnWz7l/dzAHadkYtx9K9iBei6TgZufuVwK6ashq8pDY424 zsCX9Y90jb0YOC+LU7m5u1DYm4HfaBgXcatncGKqLj0orpp3RbraxaQIdX2g1/lPobRo7TyXe zEGjJI/Ic7OyB1tO6xAWKWnUU9psBVeGxuqhPexntaaU8vNjKWB3P9W0X6n0KGtxrqMxlI6nv J9dl0VnNqGzMQ1fJEILf+u77MX4AAyzcpadV9LNLNYQMzxinonWeUCaRzpvyBxodpo+8Lb+Y5 5wubhC7hE+5P51VBLiv2ex3Jz1JywbR6EXFw7Hw/D0bUmeyIiw7iX5HBFMK/A4g9cRyj002jl t+PqE/Ol2kVW/uMtgXd4Gp7hpD+klpbQY9WkU2OpRj1sF1+OOjk7F02k2aYMvyPCgenOulzr+ xdqGORVYtGZ5jLrtQeHbhrY/stR27JDuNOS/Gn+FIbQW7knqChFP2S1aDuCa+ggAaMWIUsKVs NE4XjQVfINLdVR2o3Ebe+mlwnBlo7kPhIUZoW8KQAo+W037yp85q+gDF2LQbp4Vpl/NaCGx1i CSud4/6RPDlPhyJN7O/XnBdL9ivdpK1eJsGXBn9cHjYV2+tcDgeiSLtofHFSSfuGZRbEkmiLw R19WD1BJXhQeI/0Z0hqGIH3FQsyU9rCuH38IHu02hNXG3REMjzP0qDYPqMGJbQNZUi6qlg9c4 +qEEBy7kDPuoBchnoQAyyPFOlC2y+GCSTTz/3yz4tqcJ7t81gUaOrKl0zZtM3mtJlu2hlaUfH mNZxDa2ccCvQT0oYPUNCAw6P3+L/pW/TwT9kdfNNY3PxHBZD9wVeeWjHpwEO316mZTOkvHOmb v5GKVhq1uTb76JSMCamgjh0ltZxAt2Iu0jziGmE1FFmcrngi6kVCoTkqw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov writes: > - (looking-at (cond > - ((functionp isearch-regexp-function) > - (funcall isearch-regexp-function isearch-string t)) > - (isearch-regexp-function (word-search-regexp isearch-string t)) > - (isearch-regexp isearch-string) > - (t (regexp-quote isearch-string))))) > + ;; Like `looking-at' but uses search functions: > + (let ((isearch-forward t)) > + (isearch-search-string > + (concat "\\=\\(?:" isearch-string "\\)") nil t))) > (error nil)) These lines seem to break backwards char-fold isearch for me. Test case: Insert "creme" in an empty buffer (yes, all just ascii latin chars), go to eob, and C-r M-s ' creme ==> fails. Works with forward search and non-char-folding backward search. Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 03 14:28:00 2022 Received: (at 14013) by debbugs.gnu.org; 3 Jul 2022 18:28:00 +0000 Received: from localhost ([127.0.0.1]:45501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o84K7-0001LE-7v for submit@debbugs.gnu.org; Sun, 03 Jul 2022 14:28:00 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:62579) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o84K0-0001Kv-UJ for 14013@debbugs.gnu.org; Sun, 03 Jul 2022 14:27:57 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id B66D040005; Sun, 3 Jul 2022 18:27:44 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames In-Reply-To: <87tu7y85i5.fsf@web.de> (Michael Heerdegen's message of "Sun, 03 Jul 2022 19:34:26 +0200") Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> <87ilpm2jan.fsf@web.de> <86mtelbua2.fsf@mail.linkov.net> <86mtduuk02.fsf@mail.linkov.net> <87tu7y85i5.fsf@web.de> Date: Sun, 03 Jul 2022 21:23:19 +0300 Message-ID: <86k08u6oo8.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) >> - (looking-at (cond >> - ((functionp isearch-regexp-function) >> - (funcall isearch-regexp-function isearch-string t)) >> - (isearch-regexp-function (word-search-regexp isearch-string t)) >> - (isearch-regexp isearch-string) >> - (t (regexp-quote isearch-string))))) >> + ;; Like `looking-at' but uses search functions: >> + (let ((isearch-forward t)) >> + (isearch-search-string >> + (concat "\\=\\(?:" isearch-string "\\)") nil t))) >> (error nil)) > > These lines seem to break backwards char-fold isearch for me. Test > case: > > Insert "creme" in an empty buffer (yes, all just ascii latin chars), go > to eob, and C-r M-s ' creme ==> fails. > > Works with forward search and non-char-folding backward search. Thanks for testing. So this is a new reason why this hunk should be left out. Another reason is that some search functions are unsuitable to be called instead of looking-at, such as when the search function in the minibuffer starts to visit history items here. I hope that ‘(replace-search (concat "\\=\\(?:"’ in perform-replace has no such problems. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 03 14:43:17 2022 Received: (at 14013) by debbugs.gnu.org; 3 Jul 2022 18:43:17 +0000 Received: from localhost ([127.0.0.1]:45506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o84Yv-0001iQ-I5 for submit@debbugs.gnu.org; Sun, 03 Jul 2022 14:43:17 -0400 Received: from mout.web.de ([217.72.192.78]:51827) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o84Yr-0001iA-D3 for 14013@debbugs.gnu.org; Sun, 03 Jul 2022 14:43:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1656873783; bh=ryqm12r8p3IJR6aQoXy/l6rHQVG/wqGgTAeRhmxrBdE=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=o4p/la06Enz4X6jVc0R1txRIt17KtrwFxUDLPjVqzkobmPV/BM27rtKnJZ49oAPdi 4czyVpdIOGCJ4ER23hUchsUwuwJ1ArQLclozg6fWxmYlN7KeqI9ffIoAZncjEvSOlX S2zuMdnoDVmFEiScl+LQ/LKXLPREdmzHSH0itgGE= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([88.66.201.45]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MpTxm-1npESo41mu-00q8y7; Sun, 03 Jul 2022 20:43:03 +0200 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames In-Reply-To: <86mtduuk02.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 30 Jun 2022 20:45:17 +0300") References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> <87ilpm2jan.fsf@web.de> <86mtelbua2.fsf@mail.linkov.net> <86mtduuk02.fsf@mail.linkov.net> Date: Sun, 03 Jul 2022 20:43:01 +0200 Message-ID: <87pmim82bu.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:HOEoCi6O34uckv/67SCCV72IvUh6k+6QQrPHugLt/FUqrivJ3zQ lZUvgnqp5jLR/hbHVVrNAC3r2U0ZQi5jQ/4tqXQ1FIa3ajYcBOHaOvtAJagy7KKU7dqf/ql cIkWsAGdZZRn8hRpTISkkaJAJ+tt+oIqA4RO4IV8nxtEOUkh7TXwMftdUgPapfyMQkZIzdP Bl1OnlQRAlWSfgfjrWPUg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:QG/UZAnu4jY=:UUO9WXPSBLpEakgC8hkvh6 fSxVSLAyBVRhbbozKSuPY0TnVY6hXuDL9D9L/FdcREJrceB8WUZsWColQ1RHyxrfTNe8WvnsX SmCnlvgEJAHkweU+KcrstImtQII137r9eHiNh/nl5sBidLH2pIzTsJu/dtnX9mgsNSpTahVgs oX3IctF62qaCr1lunbImmeoXmnlzuEKuNmJdCkwko/5YMjuTxCLsRh7lIXzayoh7cxyqpYD2w OBqZb/h86AFRPtyz+OpN8ktH+1mQFUgukvy51Z6BqmHjw8b+xAIp0GTtxjs73bWgvTGvcCINZ E5FeFjxaJlfUyECChUYNhVXHxsm0PXClyDykhFh+NuqyR4W5o0GWWQyuq+qcYjKPLSrteshqz hgekwF9LEPmNzG/QxT1XOu6TnAA5tS8rrDY2ulpAco+HmFNOV62V7ky/ztBQP7Zs8BSVWzsZ7 r+IvlPLHgA6jlCim8u4wTsA0EDADNI5x/FBeMABCLhAf1Zi7NbJMnp2P0uvywqXDahZdSN/zA hH8tXJ4DBWYKfjwfoENPMSTm9qs/40UEl0VJYJoK7B71zPtiiYZ/XyBp5uSE2+sGyfDl2AnW7 3zgLnvtLOKxbYvNWYUxKpbZTIQnhwzNzPrWyghiFvjcGl/E1f+7dWyU7OPf/ESwTS7T11eW41 2MHOFm51v9UCPWHdfDsfqcdXOD+cGnegv9NwIDO3Whuv/E0Fh1vztPY6EUcENjxZR+qaSag2M Mywv/8eslONkUlIo/IG/Dan7BC6ivl1CBEdBkdch/HtCeBbpGK3tkuccXNPbvIuVKURYhwpCA fzmltXze5VfMfW92mCdCZFGoGsow1LXkYpqxDtijWQOVHASCr4tycfRo37snXCqKzbitxHH6z MRKpNYTFYWStvuMo13l4qpWr2hJ3b6yai3/4PEaWkqwDQLBnh+MmXXvVGvDHBZCZJwFABGIaz V8mPzun5y8K0dTWkBS0fRI4jRbYlwVXyAhpLsabhKXzU4MgWqe/hxJ4NwENtsujmr8siTOl+D /0/KTAk8rsa6nwW0SD98md71xgWOM09/mMgPMaEjjNNMLJtLNzJrSe0BqkdN3bm0W3fGyAwgi PWbiTCIBdVa9NZ/5m/ghdXtwdQwF9O9HMdh5oZpwXnvSqdtP8xVvCKaLg== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello again, only two more small things: > +(defun isearch-search-fun-in-noncontiguous-region (search-fun bounds) > + "Return the function that searches inside noncontiguous regions. > +A noncontiguous regions is defined by the argument BOUNDS that ^ Typo. > +(defun search-within-boundaries ( search-fun get-fun next-fun > + string &optional bound noerror count) ^ Is this space intended (looks a bit strange)? Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 03 15:49:47 2022 Received: (at 14013) by debbugs.gnu.org; 3 Jul 2022 19:49:47 +0000 Received: from localhost ([127.0.0.1]:45517 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o85bG-0003Lc-Te for submit@debbugs.gnu.org; Sun, 03 Jul 2022 15:49:47 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:37689) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o85bD-0003LQ-NR for 14013@debbugs.gnu.org; Sun, 03 Jul 2022 15:49:45 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C532680323; Sun, 3 Jul 2022 15:49:37 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 0CA75803DC; Sun, 3 Jul 2022 15:49:36 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1656877776; bh=0IorLQFrD8b56F4AYJbud0GsYOXYhJdE9RodngEg+Y8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=n5WL+6F/o851+hrcNyCNi/sO5vemD1W55zjNo+YwKhkJb1HfgeGmTH89uRffCNIB7 ALFpsScorostFQn13/Sv2cpi1J7DkSZGJEXX2qkEN72PjeINk5VyTxiBHOxIcpjk4a kh2XnL2PDawdhiRyjAq7KAC+bcLXCX3Vmc2EEqAiu3yYL7VRStbt9nVhBO51kR92zf O+euw1oxis/RkCeua1KtbuVgsyU3Yj30ciF3ITOQm11ANnzG1t1xlX0A9D76nnL52f wdf4Kz+tEs9V2cVqJOX6T5dkSL+fdI8QAGgSCKa2M7qaFHfSymLU06cD1AhsnJLj6q w4DGKCJVNgJnw== Received: from alfajor (unknown [45.72.196.165]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id CDF9D12043F; Sun, 3 Jul 2022 15:49:35 -0400 (EDT) From: Stefan Monnier To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames Message-ID: References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> <87ilpm2jan.fsf@web.de> <86mtelbua2.fsf@mail.linkov.net> <86mtduuk02.fsf@mail.linkov.net> <87pmim82bu.fsf@web.de> Date: Sun, 03 Jul 2022 15:49:28 -0400 In-Reply-To: <87pmim82bu.fsf@web.de> (Michael Heerdegen's message of "Sun, 03 Jul 2022 20:43:01 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.054 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 14013 Cc: Juri Linkov , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> +(defun search-within-boundaries ( search-fun get-fun next-fun >> + string &optional bound noerror count) > ^ > Is this space intended (looks a bit strange)? Yes, it tells emacs-lisp-mode that this list should be indented like you see instead of aligning `string` under `get-fun`. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 08 13:59:32 2022 Received: (at 14013) by debbugs.gnu.org; 8 Jul 2022 17:59:32 +0000 Received: from localhost ([127.0.0.1]:33150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9sGK-00072z-C4 for submit@debbugs.gnu.org; Fri, 08 Jul 2022 13:59:32 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:34677) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9sGH-00072i-DL for 14013@debbugs.gnu.org; Fri, 08 Jul 2022 13:59:30 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 72F561BF209; Fri, 8 Jul 2022 17:59:20 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames In-Reply-To: <87pmim82bu.fsf@web.de> (Michael Heerdegen's message of "Sun, 03 Jul 2022 20:43:01 +0200") Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87ee3tjecw.fsf@web.de> <87pmnap75m.fsf@web.de> <86mtha7y8w.fsf@mail.linkov.net> <877d8935sf.fsf@web.de> <861qygal8h.fsf@mail.linkov.net> <87ilpm2jan.fsf@web.de> <86mtelbua2.fsf@mail.linkov.net> <86mtduuk02.fsf@mail.linkov.net> <87pmim82bu.fsf@web.de> Date: Fri, 08 Jul 2022 20:59:04 +0300 Message-ID: <86h73rscyf.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) >> +(defun isearch-search-fun-in-noncontiguous-region (search-fun bounds) >> + "Return the function that searches inside noncontiguous regions. >> +A noncontiguous regions is defined by the argument BOUNDS that > ^ > Typo. Thanks for noticing, now pushed the fixed version. From unknown Sun Aug 10 09:46:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 06 Aug 2022 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 01 21:27:05 2023 Received: (at control) by debbugs.gnu.org; 2 Jun 2023 01:27:05 +0000 Received: from localhost ([127.0.0.1]:38677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4tZJ-0002EM-Fa for submit@debbugs.gnu.org; Thu, 01 Jun 2023 21:27:05 -0400 Received: from mout.web.de ([212.227.15.4]:33221) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4tZD-0002Dm-9s for control@debbugs.gnu.org; Thu, 01 Jun 2023 21:27:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1685669213; x=1686274013; i=michael_heerdegen@web.de; bh=OOmYLqbsOnLq/7kheyKGe8qjGAOXTuUMvhgRxq9GhbI=; h=X-UI-Sender-Class:Date:To:From:Subject; b=GYKrfnXAYXN8M4fJG5NoPI8Nig95AOQvoo9dGBos5GAaHV0UJt1ffvo9n4B5BJZWZTrMvMo 5MZTAphHde8BYMg0Va8vdJH3ocdIClBJtJnCoD++HYbJgzWgl+GAAoJl+MW7jwAi8GIauCdyn 10D+5Pj9qJGuU2Xuj8tTkK3hs9OuQrIqz1+viiU/AFdkrjnHU30klHyyUYrBobCkUaDsVNCjd YYit4YhG4JtgrbGi0kDv0Lcce5agFx7ft/8vhAxP2ADibrXGczwt7UP23t5bWsji/keu6Oq4d 2orjUdz7BMdGt6PtyZVsn3E5xZE+c3jeSvrKfsC9O9R3GbZ1DNmw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([178.14.74.62]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1M9qcr-1q1Kem0Gmr-005tNq for ; Fri, 02 Jun 2023 03:26:53 +0200 Date: Fri, 02 Jun 2023 03:26:52 +0200 Message-Id: <87wn0mr6w3.fsf@web.de> To: control@debbugs.gnu.org From: Michael Heerdegen Subject: control message for bug #14013 X-Provags-ID: V03:K1:DjxCz5TUSZMV71sQLc7G8w56PKKZcIcpPTFOSMS+/hTPkilB7ST cPb+Wu4E/lIxR6jaJPrsdR6t62x5sAdSA569pMsQk7GmymABDUhSAWc/tL6amFJSwfeLjai LZ3IjkQvNdZUYxd1vns2L/Qonrn/2HEvhlsf5xnkxHq6yNty2zhrua+1aFiU+B399wZjuzd Nm0asOZIq9BW3YYehrX8w== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:Oa/7s5pNKCY=;7JFwdZXrVJI8WSHTlNM6Zaxe7lX VuNNW1EUzLMtJsuR1W+PLGONzfDDHRSZZ4zp8B3u4M10qO48qAhNdDP/76cd9k+bDKt5jPd6Y W2rbXqg2p8QpxIIQHDy/aCD0Q12iqbse/DWqmqCejNkaiND6pshj7frfxZtV9muSFP43wcIWg FNRpKSx0Hq5HCJLNYOTiP1xGSVIWzOl7P51fbwhfRtcPTe62aqj5G5A0tGRbDhx4Y+P7ye796 XB+1eukcIMvQ4AOkiX4p82h44MqelCCJhlRk07T2NGBdfQwGBZtszrrUBEt//eZL+1h0PTJUC 4Wqoa+KApybj7VnClsdpr+N9hHfPbBp3chmb3Tw7bvevpC4K4bXfST/wYI9u03Hb1PC+4WtNL VtVgtcCvjdwlwEf+hzmVST1Gvx5Hovn1rRntcjtjlzn9P894m9lqA1NvzHW8vz440pjJSbGjr hGvNFeWlMyeu6vZ7vb8sTgL2NxOtelR1rDq4Ng8S4hYPMeKD/w+kxUWEKzcNl5eKB1paKbDJh 2BaMhL4CKofBRuSpLYF4mo7COoUCW0PWHRJifNPRU6UXCU9B+TCj3jRHDWjqpcM/gu7wrKI/U znfAsusnmfgWjwR6Zut3mkXAugJ21Iej3Wq/GQjGybmoiKXYOCusgS792GTRCs69fGrjWpg32 d6yDP4S/NQ1Rs6UcBcnZEjA0+YIzCxlYPKtXjt+1rL4OpEfZwJoP1SetlDzuLsJdOMpdxtJND Jh2jXn8mPc46IGme6JnIuqBgHEeu7fFDDlsm+Yom+effTHSShuXEjc8UsAHaVV/02LWGfueEx NV73H4g5tNHzeaX2G9/HTql7uZxU44gvYD2pp/fBBvKVHiRDBsfqBJdUAACp6VaVVPeBIUe7j 3/DNWqTvITLvXYcvA4/2JJLsg/ZDjiwEFamgNcEYgQsd2YvaJTfBYUVtkWKvQRNsJrSK77pBU K3LMlpiPOwdM7clmpwbGleJovK4= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) unarchive 14013 quit From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 01 21:34:52 2023 Received: (at 14013) by debbugs.gnu.org; 2 Jun 2023 01:34:52 +0000 Received: from localhost ([127.0.0.1]:38683 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4tgq-0004vT-DJ for submit@debbugs.gnu.org; Thu, 01 Jun 2023 21:34:52 -0400 Received: from mout.web.de ([212.227.15.3]:59345) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4tgl-0004vC-59 for 14013@debbugs.gnu.org; Thu, 01 Jun 2023 21:34:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1685669678; x=1686274478; i=michael_heerdegen@web.de; bh=dKKbBgO4IluXoyAxoXIToLYGc6/S6v4tCE1y9yztiPs=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=Qx7FFxpGYj+VywS2ALF8UMVhdZHKo/iCvhQtipRStWy+OGrogi87TMTcitb/03sykWtfiIh rKjbgElqwBqBeiZdEIkhctxFFHGQHGi853ZLZlvEjsvLfiS1fJ+HF1jO02zybigm9YJ6N5buO BUwrRMZlQxyKLPgLcvM0ef7BXEz4nBmBIm/LkHJYRdklVcJdOPN1z5bAb4olbxniciWSF9XMT xJ4y9JY6E9EoTqcYCyTBX6gS3r8gA+GGOfFM32YrrjNmORKOfNASmP5M8AwCvXZxGX2IrVKzP rzVmN/UIICjw/6RxQTcdvNEKc6kL1LrpTy2AMT0Nu3Igy44OMHcg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([178.14.74.62]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MJWoe-1pl2Ry0dFA-00Js40; Fri, 02 Jun 2023 03:34:38 +0200 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames In-Reply-To: <86y2215rbn.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 23 Feb 2022 20:53:48 +0200") References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> Date: Fri, 02 Jun 2023 03:34:37 +0200 Message-ID: <87sfbar6j6.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:mDKb5ckncF0QmkBnw4XeR6E07a/UxdIUyls5wdUEqL/TeaaT40y ZjARmK7UBmPca40Mm5aDg3Ju86jKAQOGT9UFkckTUof2nMPBUuuplr9JV5OTQjmvg2axzJT samQlQDDBODxxd8qlJmyQ/rMqqLXYYhajS6GOscF2Rx4hW+LkUabCrIGojLY31YLpEtPhrt I/dYsNnUxVtbhuVNsGaBA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:w/HPKs5C6/g=;0NesMPWhUcsBQg57bYemAVSK2xt DUbaFfZTU2jnA5ojzjfoh/tB6yfW7Wd3+IXyKEjmwbMcxjC11yIqL2CHn2Ciy2C7NwXt9FAAO hse9nG1v83nI1aq6/hgxgB2aUdd+ii7Nt1IrJ4PNEdVDmt0Ule9iLnyjynDBR1kAKhKbZ+lKi sGj8cxkTI94Ub5ChH4xJNfbRHU7uWCN3C48uuBXMQD+nW1TRYuEXlB6H8fRKrtHnhfYO7DGVo RTxHPqdImZ8McWWRzcXDxeTNi3PE/SxP1lzhtQNO7sD0HLXM8o5rt5VT4vIbawc4YIkQjpXBz jNqF6yehZaFZVBjsi47nouLyQBUu5pw74/QoxccS8VYnItPScNBBYN3aat4yHTmekAzP5M9Sa s9f+s1sjNZ3dCxRAARgjGaGeXzRYFvUjud6xq/G2o+ncWr6dhjRokq+xOOTb7CvHgvd6XJiTh p684oUvREOXAsdc4zyqqLn3H4lKuRQeWWjBgVAcD63Wzvu9A6oRTLboYlsoEz05rvElf4tITP uw4eS8fDRhL92ToPxJ4cJmsQwNm1fuDNb05goKYVFrnO9m4Ki6pXY65WHDnV0yfuzf9ZoHTiQ Ic3mSaXB7yccrsvaOpv1OHGIPsz3CWC5A/Vxwa9v6YBZizCu9ScC8d1nAUIDiv3nzRbs6KYWW 1K31Z8o0WMZpe8D0ODyPHRZo97P/zr4GlhR3rZW15fse7BIDYRzcQ7FWbGxH0DviOBfs+i0MT 9eMF3jeD5DKxw+PPzFotRK7O80eaG+5SVb1edEqAxlpmmCxkkQTzIJoZgvHTcA8aCRBFsl6am nB07chEHn6rTVAHuSpDcM7RknO5zCYdsTkbPEcfIzApz9PM+es0l/dDDCuTCgazYONCEoN+4O cdXxvsdQ4XBXcwq6dbxO06gZbTtcAcJJSbqsoxCMlfU637E/9LuNpvULqiT952MZdAj+CBAM8 6ioUkw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov writes: > - (remove-function (local 'isearch-filter-predicate) > - #'wdired-isearch-filter-read-only) > + (when wdired-search-replace-filenames > + (remove-function (local 'isearch-search-fun-function) > + #'dired-isearch-search-filenames) > + (kill-local-variable 'replace-search-function) > + (kill-local-variable 'replace-re-search-function)) Juri, when a user disables `wdired-search-replace-filenames' while still in wdired-mode, won't we fail to undo these settings when the user then returns to normal dired? - should we not better undo these things unconditionally? Second question: could we advice (local 'replace-search-function) and (local 'replace-re-search-function) instead of replacing the value (it might be nicer to users of other packages)? TIA, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 02 03:05:20 2023 Received: (at 14013) by debbugs.gnu.org; 2 Jun 2023 07:05:20 +0000 Received: from localhost ([127.0.0.1]:39002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4yqe-00085I-By for submit@debbugs.gnu.org; Fri, 02 Jun 2023 03:05:20 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:50271) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4yqb-00084y-Ui for 14013@debbugs.gnu.org; Fri, 02 Jun 2023 03:05:18 -0400 X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net Received: by mail.gandi.net (Postfix) with ESMTPSA id 48A3440008; Fri, 2 Jun 2023 07:05:09 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames In-Reply-To: <87sfbar6j6.fsf@web.de> (Michael Heerdegen's message of "Fri, 02 Jun 2023 03:34:37 +0200") Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87sfbar6j6.fsf@web.de> Date: Fri, 02 Jun 2023 09:28:39 +0300 Message-ID: <86wn0m4fq0.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) >> - (remove-function (local 'isearch-filter-predicate) >> - #'wdired-isearch-filter-read-only) >> + (when wdired-search-replace-filenames >> + (remove-function (local 'isearch-search-fun-function) >> + #'dired-isearch-search-filenames) >> + (kill-local-variable 'replace-search-function) >> + (kill-local-variable 'replace-re-search-function)) > > Juri, when a user disables `wdired-search-replace-filenames' while still > in wdired-mode, won't we fail to undo these settings when the user > then returns to normal dired? - should we not better undo these things > unconditionally? If these calls are idempotent, we could remove the condition. Could you please confirm there is no adverse effect after removing this. Also there is another call at the end that can't be removed: (add-hook 'isearch-mode-hook #'dired-isearch-filenames-setup nil t) > Second question: could we advice (local 'replace-search-function) and > (local 'replace-re-search-function) instead of replacing the value (it > might be nicer to users of other packages)? This looks nicer in theory. But in practice I expect to see a lot of conflicts. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 02 18:29:48 2023 Received: (at 14013) by debbugs.gnu.org; 2 Jun 2023 22:29:48 +0000 Received: from localhost ([127.0.0.1]:40979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5DHI-0001bt-Ae for submit@debbugs.gnu.org; Fri, 02 Jun 2023 18:29:48 -0400 Received: from mout.web.de ([212.227.15.14]:44985) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5DHE-0001be-2N for 14013@debbugs.gnu.org; Fri, 02 Jun 2023 18:29:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1685744974; x=1686349774; i=michael_heerdegen@web.de; bh=dQ+VaGHL+UlM1bWb3qliSREVx9Zh0Lvhe4ArNhS7Bz8=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=M57pr+bpJcZxi6zNTfkyCuyKlo6iOTc5JVXNrkvbrzb7hu5Ux+N8+qsSbCqyZuYjxJl+l9Y EbC4L6MDgDlVnRLAMD4T0Xmj4hKsKP8zKk5Q0CTplVm9uwFFV8oaIebhX2cbeE59ekRnNcD0K 34TKrkVf4gwxDmjDrJVM6CsNQ0b5jB24q8jbAcgYmU4NteWMvXJRolSOTaVxCSD8mTgEoaZ0E mLdeNziWePCn53Fo9qKB5yfVgNV29+HsdWa8vFDcQlOGszCxmPKJA8l1AIafLxpl662ZBPoo2 IOvggoKOvBWPGt3ARLLDB4X23+ApHs4CU2Jg6uwAMPzTarHjObsA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([178.14.74.62]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N6sG3-1q8HIn1gI3-018NYo; Sat, 03 Jun 2023 00:29:34 +0200 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames In-Reply-To: <86wn0m4fq0.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 02 Jun 2023 09:28:39 +0300") References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87sfbar6j6.fsf@web.de> <86wn0m4fq0.fsf@mail.linkov.net> Date: Sat, 03 Jun 2023 00:29:33 +0200 Message-ID: <87wn0lpkfm.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:eQt4mq5Y4muwUjlNlTaujX+Yv9m0M1/Jc1epSsY4NmEutkvKlG8 LEWKAllGkqtXtWJsL/Yxe8/blmftR4uQF59Kwmw8oP6ZbhM1U5lAJaFWapt93YXKpkcA5RX /SmZKDvk8hD3CE7tN9teU9if7kmDB/hSp167rSGNhz4/fw35YIG7/J/6MqIzpW4VRqQBRLW ZVWL8Kom4PySlnLgs81iw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:5LldYNLq0Eo=;brnT58Iiryezl55bQ3ABOVCojN5 VSWSsXgzl1wkSaDfKV5ow8lfTjvuNUGG21UOiUJQ8lMPnql5eKWOJqNWrej7wVnX6qv2nJU0d ye3WACJapu2JOYDSYCzLhbG/GSRB97gsAeb9EhuG6QudTP3lnd5PKhTjHvaV3cWjldNVrlnnb bOP4uDOgBu3D9rkTNzChL3QQNPhYzqx6MSNeZV0YM3sZ+2Kyhox7FkWulaxy6gCOxBRw5oqh4 zVufs0iOH4Y97DXYe6ed5xSLEVrkoNTYIAcLD0MJtGz/L7lRPfJCaPp3EY0Z6XD/NkMHdNVNA vT+g9vqWIK1pe9n7ETYjCZI08tHtkJCTONjGCdQDGJmGB5i+VXfe3Ufa6vvT/3xHO3mhsQI47 GcK+rETADR4nFl76uPDTSXmPE6EIifchgbhGmvKg0As8sfHYJc1Da6ZQIywipSRFdFEFCScoe IEbzuTF/oLJ71rZAWTuraCVFRMBWy+NmU/He1j9RRms8fNM8j4QUn50L55u2SW/u2RcYSTe/+ c7Cy8rR20dxvpHtyQWQxM6o86r1EOYIhm1A0efjeZnVYIRLNyEKihHQ4UVJjzgAcGHKn58Vjt jsWyAdooCnhRkHyUQs3RlUyDLt3EDHs9VSiwF3hRktmDPrgpWzbqjlDGjHXs6blVF3VyYykOs GWYD5bEX+4QZloy5MGXE4wnzVH0K/MOl+fzMXN07FcrSxaIKzhfR2gn8qu0xOQ+1mypdh5CWk 4rcF+9xyrlw0lPCwKRHiJwv1q1kAjesqGWLnElG0b6P6edBk0k4lj+TB+udvZvvGwT479LwDb ACtKZlhSoI5OvGPTSEnmZauVqIFzSLIrvOzU+zplg3hysCgby/WZ6th1Xn/wLiuDuBD7KGWeb +SCfeTpzj98f7j7O0RfgQ4Fc9NDhwGv8R0UC29jq9/3gKjnoHc4FTCSNKKfea8sCMvAWhdYG5 JvMQ6HmtDTZGVEULaHCoCecQpDo= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov writes: > >> - (remove-function (local 'isearch-filter-predicate) > >> - #'wdired-isearch-filter-read-only) > >> + (when wdired-search-replace-filenames > >> + (remove-function (local 'isearch-search-fun-function) > >> + #'dired-isearch-search-filenames) > >> + (kill-local-variable 'replace-search-function) > >> + (kill-local-variable 'replace-re-search-function)) > > > > Juri, when a user disables `wdired-search-replace-filenames' while still > > in wdired-mode, won't we fail to undo these settings when the user > > then returns to normal dired? - should we not better undo these things > > unconditionally? > > If these calls are idempotent, we could remove the condition. > Could you please confirm there is no adverse effect after removing this. Both `remove-function' and `k-l-variable' are documented to do nothing when the function to be removed is not present/ there is no local variable binding. > Also there is another call at the end that can't be removed: > > (add-hook 'isearch-mode-hook #'dired-isearch-filenames-setup nil t) I think we should remove the condition when entering wdired here (for the same reason). > > Second question: could we advice (local 'replace-search-function) and > > (local 'replace-re-search-function) instead of replacing the value (it > > might be nicer to users of other packages)? > > This looks nicer in theory. But in practice I expect to see a lot of > conflicts. What conflicts? Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 04 04:32:23 2023 Received: (at 14013) by debbugs.gnu.org; 4 Jun 2023 08:32:23 +0000 Received: from localhost ([127.0.0.1]:44914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5j9y-0002EK-N3 for submit@debbugs.gnu.org; Sun, 04 Jun 2023 04:32:22 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:49233) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5j9v-0002E3-9E for 14013@debbugs.gnu.org; Sun, 04 Jun 2023 04:32:21 -0400 X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net Received: by mail.gandi.net (Postfix) with ESMTPSA id 479BC1BF205; Sun, 4 Jun 2023 08:32:10 +0000 (UTC) From: Juri Linkov To: Michael Heerdegen Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames In-Reply-To: <87wn0lpkfm.fsf@web.de> (Michael Heerdegen's message of "Sat, 03 Jun 2023 00:29:33 +0200") Organization: LINKOV.NET References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87sfbar6j6.fsf@web.de> <86wn0m4fq0.fsf@mail.linkov.net> <87wn0lpkfm.fsf@web.de> Date: Sun, 04 Jun 2023 10:36:01 +0300 Message-ID: <868rcz4vre.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) >> >> - (remove-function (local 'isearch-filter-predicate) >> >> - #'wdired-isearch-filter-read-only) >> >> + (when wdired-search-replace-filenames >> >> + (remove-function (local 'isearch-search-fun-function) >> >> + #'dired-isearch-search-filenames) >> >> + (kill-local-variable 'replace-search-function) >> >> + (kill-local-variable 'replace-re-search-function)) >> > >> > Juri, when a user disables `wdired-search-replace-filenames' while still >> > in wdired-mode, won't we fail to undo these settings when the user >> > then returns to normal dired? - should we not better undo these things >> > unconditionally? >> >> If these calls are idempotent, we could remove the condition. >> Could you please confirm there is no adverse effect after removing this. > > Both `remove-function' and `k-l-variable' are documented to do nothing > when the function to be removed is not present/ there is no local > variable binding. > >> Also there is another call at the end that can't be removed: >> >> (add-hook 'isearch-mode-hook #'dired-isearch-filenames-setup nil t) > > I think we should remove the condition when entering wdired here (for > the same reason). If you don't see a problem, then let's change this in master. >> > Second question: could we advice (local 'replace-search-function) and >> > (local 'replace-re-search-function) instead of replacing the value (it >> > might be nicer to users of other packages)? >> >> This looks nicer in theory. But in practice I expect to see a lot of >> conflicts. > > What conflicts? Usual conflicts when two pieces of code are working simultaneously on the same thing. So we need concrete examples to verify if everything is correct. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 05 20:27:38 2023 Received: (at 14013) by debbugs.gnu.org; 6 Jun 2023 00:27:38 +0000 Received: from localhost ([127.0.0.1]:50546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6KXx-0000Kd-UB for submit@debbugs.gnu.org; Mon, 05 Jun 2023 20:27:38 -0400 Received: from mout.web.de ([212.227.15.3]:37131) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6KXu-0000KP-Q1 for 14013@debbugs.gnu.org; Mon, 05 Jun 2023 20:27:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1686011245; x=1686616045; i=michael_heerdegen@web.de; bh=cGwuhkV//qHlHoHke9VVRIxiLYfzp2dK4/tgz7EjbDQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=ahPP7AFZ7ZHplWGwXiyKACEJMuFaLEnqtRc+25Cn8kSpnv/bu6KBHzaZD1v8w0AE/enuqya yp76ibHtqjdy2DwcvzGgya9IGmR8hF6f0Ud/v0ig/+XUvR/EjSQxo3qYJJEGL8h9bbtRPcGOK HJzKPeXtqhsaLkjFKSp+FfMrogxkxI4JWesnm5XCuYVW8HO5czdXl5i/y0Y3BbQ1j6DF/1fOp p56y3TZz4lUN8JbcpWkljt+2P7MvXAtgg+rP8CAJpqcyErglOgUG6igCsUGEMxR0kdsCnuoNk oqDEdxnfCAdYfT+k2dxPCTZJFucdAfN+qeSgRmY/GW32bF+rV5LQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from drachen.dragon ([178.14.74.62]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MnpL4-1qPevH2LQg-00pM7n; Tue, 06 Jun 2023 02:27:25 +0200 From: Michael Heerdegen To: Juri Linkov Subject: Re: bug#14013: 24.3.50; dired-isearch-filenames-regexp is matching text outside filenames In-Reply-To: <868rcz4vre.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 04 Jun 2023 10:36:01 +0300") References: <87li9hk5e5.fsf@web.de> <87wqt1vd0o.fsf@mail.jurta.org> <87d2ut4mji.fsf@web.de> <87620lvavl.fsf@mail.jurta.org> <87zjxxsd6c.fsf@web.de> <87vc8ke4os.fsf@mail.jurta.org> <86zgmutwx9.fsf@mail.linkov.net> <87o83ab67d.fsf@web.de> <86r185520f.fsf@mail.linkov.net> <87czjn39yf.fsf@web.de> <86y2215rbn.fsf@mail.linkov.net> <87sfbar6j6.fsf@web.de> <86wn0m4fq0.fsf@mail.linkov.net> <87wn0lpkfm.fsf@web.de> <868rcz4vre.fsf@mail.linkov.net> Date: Tue, 06 Jun 2023 02:27:24 +0200 Message-ID: <87zg5da103.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:bx/D3rPOvjL/Nu53XN1ajGAtMY1IhhxrHfPSdrv5j7qxuZgZ3Ko cq4h158BV4s69dkWhdHgIgw/u9tB0baa9kpGKyYl0XUCsTBwm558j1sWbrfMx+HqiaCHjCS BzowPnAAV979YXbJggFl4AaXfcGCfGt2oFau5pRdEZwbsbd2ECNa5i4mzOWlRwkXr0NyY6I oBHyvkfVoB1nD6pivfuGQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:Y90V0btqhUg=;2arHDIrnHk0CPCMsYOu9sHGTbTT xFl/oo4elScfVdjL44A+vYHhSHUsO7K1pUZ+Ih00HIqVGDAeLlX3GYmB6UwCmjlipl96sd5dp YF3cBp2IKfnj0MXn/6oNmrXQ03vTNDn9iVxu0kmuIbcrD52la3nScV/yTF5k2q1xVxHxmDorO X5uj+ZvKI6ZFyPLYuREtwwfKSG0y/Le3EXE420RvhbI14F7DEwTOBkND8hMRFmKzFjEqvFTTh BtVgO4aBfcxmF7Y0TiFsvGEEozeY0ERVMsJKY3Blpu0G8Lg5kXj4m8zWgYXAgQP38rJblp4Ee JXpJrigcTd3OCYdck+dJrHlVBbtL/v2CHBfNXxxBVX70vSA9iVU35wKuIWaqxRVH/I7hR01C1 11AYhOYFHvfhyDVcjTOq7LatZI5IOMVQNfG/pYtpS78JYNmuKpUeXxy5hEi5kftqKyhlCbiJ3 YnTgb1vbERioxuCImdZgvzkOWxa9StYRFFm59xTUTfWRp8jdEMYz3jiXCY9E7CfU4/j2FEpv8 oXQTnXNGmOWUpUAAFGYKIGf/nm5Po+NDDB+sDqKnGEhjC9WPQpbAv9PtOeo8CJzZpkeAlp3Lf kO8LhHxpeYpMPPOM39hXBLcx5dWcCwfv//qv3k04oPRpIpzeFxogfXCLTG6ZduANQU+yzTje+ CsafKduuk/MZyKiKPgvSqy0BKpvOQs0wRa+LPyx8/lSBmDWPNwhMDPO5ooRfk6yqzus00bjO+ awYA/gt8j4QK8uSeHhTTCB/l2j0PTvWqpCu278bGaqA6a/Bp9XGs7myBXL9Cu7Ldf28QNlCMB 4cv30aP5SFvGfBxWBrvyka5EutH/wsb5WGyt9SU41ckNEgc7c7mk33o8q0CPCAF3El0X/qPtn lXa+qTiAO1gLrsNky/gvO3+ZX8O8z/8zdltONvxPzWYrFXfF/gUnRGgQhPgQbIP9s+4wFbxX+ pItvJQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 14013 Cc: Stefan Monnier , 14013@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Juri Linkov writes: > >> > Second question: could we advice (local 'replace-search-function) and > >> > (local 'replace-re-search-function) instead of replacing the value (it > >> > might be nicer to users of other packages)? > >> > >> This looks nicer in theory. But in practice I expect to see a lot of > >> conflicts. > > > > What conflicts? > > Usual conflicts when two pieces of code are working simultaneously > on the same thing. So we need concrete examples to verify if > everything is correct. Not sure I understand. We would do this to get any control over conflicts at all (by using the different types of advices and the depth property). How would such examples behave currently, and why do you think changing the code to use advices would be more problematic? Currently we `setq' and so the last one completely overwrites everything conflicting. Isn't that a problem per se (at least it's the thing I want to mitigate). Michael. From unknown Sun Aug 10 09:46:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 04 Jul 2023 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator