From unknown Tue Aug 19 05:11:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22694: 25.0.91; dired-mark-files-containing-regexp read file disk Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Feb 2016 12:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22694 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22694@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.145562666912855 (code B ref -1); Tue, 16 Feb 2016 12:45:02 +0000 Received: (at submit) by debbugs.gnu.org; 16 Feb 2016 12:44:29 +0000 Received: from localhost ([127.0.0.1]:40859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aVezU-0003LH-RL for submit@debbugs.gnu.org; Tue, 16 Feb 2016 07:44:29 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40188) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aVezT-0003L3-P9 for submit@debbugs.gnu.org; Tue, 16 Feb 2016 07:44:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVezN-0003xX-PF for submit@debbugs.gnu.org; Tue, 16 Feb 2016 07:44:22 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVezN-0003xT-M7 for submit@debbugs.gnu.org; Tue, 16 Feb 2016 07:44:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVezM-0007Pj-P5 for bug-gnu-emacs@gnu.org; Tue, 16 Feb 2016 07:44:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVezH-0003vj-Ou for bug-gnu-emacs@gnu.org; Tue, 16 Feb 2016 07:44:20 -0500 Received: from calancha-ilc.kek.jp ([130.87.234.234]:57021) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVezH-0003vV-FP for bug-gnu-emacs@gnu.org; Tue, 16 Feb 2016 07:44:15 -0500 Received: by calancha-ilc.kek.jp (Postfix, from userid 500) id 1816ADAB6; Tue, 16 Feb 2016 21:47:28 +0900 (JST) Received: from localhost (localhost [127.0.0.1]) by calancha-ilc.kek.jp (Postfix) with ESMTP id AA657DAB1 for ; Tue, 16 Feb 2016 21:47:28 +0900 (JST) Date: Tue, 16 Feb 2016 21:47:28 +0900 (JST) From: Tino Calancha X-X-Sender: calancha@calancha-ilc.kek.jp Message-ID: User-Agent: Alpine 2.20 (LRH 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="1468197610-405949849-1455626848=:6276" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) 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: -4.0 (----) --1468197610-405949849-1455626848=:6276 Content-Type: text/plain; format=flowed; charset=US-ASCII When a buffer visiting the file on disk exists, the matching is performed on this buffer: if the buffer is out of sync with the file, the result may be wrong. emacs -Q /tmp/foo --eval='(progn (with-current-buffer "foo" (insert "baz")) (save-buffer))' C-x d RET M-! printf baz >> bar; for f in foo bar; do printf qux >> $f ; done RET g % g \`bazqux$ RET ;; Just match bar. It may signal an error if trying to read a non regular file. *) Files satisfying predicate `file-regular-p'. *) A buffer visiting the file on disk need to be updated before matching the input regexp. In GNU Emacs 25.0.91.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23) Repository revision: b1a3ebedba88689d26f44cf7db338104b849ae99 --1468197610-405949849-1455626848=:6276 Content-Type: text/plain; charset=US-ASCII; name=dired.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=dired.patch ZGlmZiAtLWdpdCBhL2xpc3AvZGlyZWQuZWwgYi9saXNwL2RpcmVkLmVsDQpp bmRleCAyNGIxMjhmLi5mNDIwNDBkIDEwMDY0NA0KLS0tIGEvbGlzcC9kaXJl ZC5lbA0KKysrIGIvbGlzcC9kaXJlZC5lbA0KQEAgLTMzNTUsOCArMzM1NSw4 IEBAIGRpcmVkLW1hcmstZmlsZXMtY29udGFpbmluZy1yZWdleHANCiAgICAg IChhbmQgKG5vdCAobG9va2luZy1hdC1wIGRpcmVkLXJlLWRvdCkpDQogCSAg KG5vdCAoZW9scCkpCQkJOyBlbXB0eSBsaW5lDQogCSAgKGxldCAoKGZuIChk aXJlZC1nZXQtZmlsZW5hbWUgbmlsIHQpKSkNCi0JICAgICh3aGVuIChhbmQg Zm4gKGZpbGUtcmVhZGFibGUtcCBmbikNCi0JCSAgICAgICAobm90IChmaWxl LWRpcmVjdG9yeS1wIGZuKSkpDQorCSAgICAod2hlbiAoYW5kIGZuIChmaWxl LXJlZ3VsYXItcCBmbikNCisJCSAgICAgICAoZmlsZS1yZWFkYWJsZS1wIGZu KSkNCiAJICAgICAgKGxldCAoKHByZWJ1ZiAoZ2V0LWZpbGUtYnVmZmVyIGZu KSkpDQogCQkobWVzc2FnZSAiQ2hlY2tpbmcgJXMiIGZuKQ0KIAkJOzsgRm9y IG5vdyB3ZSBkbyBpdCBpbnNpZGUgZW1hY3MNCkBAIC0zMzY0LDYgKzMzNjQs NyBAQCBkaXJlZC1tYXJrLWZpbGVzLWNvbnRhaW5pbmctcmVnZXhwDQogCQko aWYgcHJlYnVmDQogCQkgICAgKHdpdGgtY3VycmVudC1idWZmZXIgcHJlYnVm DQogCQkgICAgICAoc2F2ZS1leGN1cnNpb24NCisgICAgICAgICAgICAocmV2 ZXJ0LWJ1ZmZlciB0IHQgdCkNCiAJCQkoZ290by1jaGFyIChwb2ludC1taW4p KQ0KIAkJCShyZS1zZWFyY2gtZm9yd2FyZCByZWdleHAgbmlsIHQpKSkNCiAJ CSAgKHdpdGgtdGVtcC1idWZmZXINCg== --1468197610-405949849-1455626848=:6276-- From unknown Tue Aug 19 05:11:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22694: 25.0.91; dired-mark-files-containing-regexp read file disk Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Feb 2016 16:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22694 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Tino Calancha Cc: 22694@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 22694-submit@debbugs.gnu.org id=B22694.14556387406284 (code B ref 22694); Tue, 16 Feb 2016 16:06:01 +0000 Received: (at 22694) by debbugs.gnu.org; 16 Feb 2016 16:05:40 +0000 Received: from localhost ([127.0.0.1]:38235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aVi8B-0001dI-Nq for submit@debbugs.gnu.org; Tue, 16 Feb 2016 11:05:39 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42621) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aVi8A-0001d6-1i for 22694@debbugs.gnu.org; Tue, 16 Feb 2016 11:05:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVi81-0007Mh-80 for 22694@debbugs.gnu.org; Tue, 16 Feb 2016 11:05:32 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVi81-0007Md-4r; Tue, 16 Feb 2016 11:05:29 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3075 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aVi80-0004L1-GL; Tue, 16 Feb 2016 11:05:28 -0500 Date: Tue, 16 Feb 2016 18:05:39 +0200 Message-Id: <83h9h8wsh8.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Tino Calancha on Tue, 16 Feb 2016 21:47:28 +0900 (JST)) References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) 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: -5.0 (-----) > Date: Tue, 16 Feb 2016 21:47:28 +0900 (JST) > From: Tino Calancha > > When a buffer visiting the file on disk exists, the matching is performed > on this buffer: if the buffer is out of sync with the file, the > result may be wrong. > > emacs -Q /tmp/foo --eval='(progn (with-current-buffer "foo" (insert "baz")) (save-buffer))' > C-x d RET > M-! printf baz >> bar; for f in foo bar; do printf qux >> $f ; done RET > g > % g \`bazqux$ RET > ;; Just match bar. It may signal an error if trying to read a non regular file. > > > *) Files satisfying predicate `file-regular-p'. > *) A buffer visiting the file on disk need to be updated before matching the input regexp. Isn't this by design? Dired doesn't by default re-sync with the disk; if you don't like this, you can turn on auto-revert in the Dired buffer. From unknown Tue Aug 19 05:11:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22694: 25.0.91; dired-mark-files-containing-regexp read file disk Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Feb 2016 14:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22694 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Cc: 22694@debbugs.gnu.org Received: via spool by 22694-submit@debbugs.gnu.org id=B22694.145571785328109 (code B ref 22694); Wed, 17 Feb 2016 14:05:02 +0000 Received: (at 22694) by debbugs.gnu.org; 17 Feb 2016 14:04:13 +0000 Received: from localhost ([127.0.0.1]:38960 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aW2iD-0007JJ-5i for submit@debbugs.gnu.org; Wed, 17 Feb 2016 09:04:13 -0500 Received: from calancha-ilc.kek.jp ([130.87.234.234]:35497) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aW2iB-0007J3-7s for 22694@debbugs.gnu.org; Wed, 17 Feb 2016 09:04:11 -0500 Received: by calancha-ilc.kek.jp (Postfix, from userid 500) id C9A83DAB2; Wed, 17 Feb 2016 23:07:16 +0900 (JST) Received: from localhost (localhost [127.0.0.1]) by calancha-ilc.kek.jp (Postfix) with ESMTP id 60332D99C for <22694@debbugs.gnu.org>; Wed, 17 Feb 2016 23:07:16 +0900 (JST) Date: Wed, 17 Feb 2016 23:07:16 +0900 (JST) From: Tino Calancha X-X-Sender: calancha@calancha-ilc.kek.jp In-Reply-To: <83h9h8wsh8.fsf@gnu.org> Message-ID: References: <83h9h8wsh8.fsf@gnu.org> User-Agent: Alpine 2.20 (LRH 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Spam-Score: 2.2 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.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 the administrator of that system for details. Content preview: > Isn't this by design? Dired doesn't by default re-sync with the disk; > if you don't like this, you can turn on auto-revert in the Dired > buffer. I don't like reverting the buffer either. I found better to ignore the buffers visiting and handle all files with with-temp-buffer. Using grep is also nice, but it would change the type of regexp. [...] Content analysis details: (2.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f92capac[at]gmail.com) 1.2 MISSING_HEADERS Missing To: header 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.2 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.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 the administrator of that system for details. Content preview: > Isn't this by design? Dired doesn't by default re-sync with the disk; > if you don't like this, you can turn on auto-revert in the Dired > buffer. I don't like reverting the buffer either. I found better to ignore the buffers visiting and handle all files with with-temp-buffer. Using grep is also nice, but it would change the type of regexp. [...] Content analysis details: (2.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f92capac[at]gmail.com) 1.2 MISSING_HEADERS Missing To: header > Isn't this by design? Dired doesn't by default re-sync with the disk; > if you don't like this, you can turn on auto-revert in the Dired > buffer. I don't like reverting the buffer either. I found better to ignore the buffers visiting and handle all files with with-temp-buffer. Using grep is also nice, but it would change the type of regexp. Regardless of whether auto-revert is enabled or not, the doc. string of this function says that it marks files whose contain match a regexp, so, it should check the file instead of relying in the visiting buffer. From unknown Tue Aug 19 05:11:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22694: 25.0.91; dired-mark-files-containing-regexp read file disk References: In-Reply-To: Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Feb 2016 09:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22694 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22694@debbugs.gnu.org Cc: Tino Calancha Received: via spool by 22694-submit@debbugs.gnu.org id=B22694.14563061274841 (code B ref 22694); Wed, 24 Feb 2016 09:29:02 +0000 Received: (at 22694) by debbugs.gnu.org; 24 Feb 2016 09:28:47 +0000 Received: from localhost ([127.0.0.1]:42450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYVkU-0001G1-SY for submit@debbugs.gnu.org; Wed, 24 Feb 2016 04:28:47 -0500 Received: from calancha-ilc.kek.jp ([130.87.234.234]:48732) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYVkT-0001Fm-1d for 22694@debbugs.gnu.org; Wed, 24 Feb 2016 04:28:45 -0500 Received: by calancha-ilc.kek.jp (Postfix, from userid 500) id 1DCCFD9C7; Wed, 24 Feb 2016 18:31:54 +0900 (JST) Received: from localhost (localhost [127.0.0.1]) by calancha-ilc.kek.jp (Postfix) with ESMTP id 04DFA6108; Wed, 24 Feb 2016 18:31:54 +0900 (JST) Date: Wed, 24 Feb 2016 18:31:53 +0900 (JST) From: Tino Calancha X-X-Sender: calancha@calancha-ilc.kek.jp Message-ID: User-Agent: Alpine 2.20 (LRH 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="1468197610-1363473501-1456306314=:17491" X-Spam-Score: 1.0 (+) 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 (+) --1468197610-1363473501-1456306314=:17491 Content-Type: text/plain; format=flowed; charset=US-ASCII I think is better to not use the buffer and always read the file. This way we always mark all the files containing the regexp, regardless of the user customization. --1468197610-1363473501-1456306314=:17491 Content-Type: text/plain; charset=US-ASCII; name=dired.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=dired.patch ZGlmZiAtLWdpdCBhL2xpc3AvZGlyZWQuZWwgYi9saXNwL2RpcmVkLmVsDQpp bmRleCA2Yzc0NDVjLi4xOTllNmZmIDEwMDY0NA0KLS0tIGEvbGlzcC9kaXJl ZC5lbA0KKysrIGIvbGlzcC9kaXJlZC5lbA0KQEAgLTMzNTksMjMgKzMzNTks MTYgQEAgZGlyZWQtbWFyay1maWxlcy1jb250YWluaW5nLXJlZ2V4cA0KICAg ICAgKGFuZCAobm90IChsb29raW5nLWF0LXAgZGlyZWQtcmUtZG90KSkNCiAJ ICAobm90IChlb2xwKSkJCQk7IGVtcHR5IGxpbmUNCiAJICAobGV0ICgoZm4g KGRpcmVkLWdldC1maWxlbmFtZSBuaWwgdCkpKQ0KLQkgICAgKHdoZW4gKGFu ZCBmbiAoZmlsZS1yZWFkYWJsZS1wIGZuKQ0KLQkJICAgICAgIChub3QgKGZp bGUtZGlyZWN0b3J5LXAgZm4pKSkNCi0JICAgICAgKGxldCAoKHByZWJ1ZiAo Z2V0LWZpbGUtYnVmZmVyIGZuKSkpDQorCSAgICAod2hlbiAoYW5kIGZuIChm aWxlLXJlZ3VsYXItcCBmbikNCisgICAgICAgICAgICAgICAgICAgKGZpbGUt cmVhZGFibGUtcCBmbikpDQogCQkobWVzc2FnZSAiQ2hlY2tpbmcgJXMiIGZu KQ0KIAkJOzsgRm9yIG5vdyB3ZSBkbyBpdCBpbnNpZGUgZW1hY3MNCiAJCTs7 IEdyZXAgbWlnaHQgYmUgYmV0dGVyIGlmIHRoZXJlIGFyZSBhIGxvdCBvZiBm aWxlcw0KLQkJKGlmIHByZWJ1Zg0KLQkJICAgICh3aXRoLWN1cnJlbnQtYnVm ZmVyIHByZWJ1Zg0KLQkJICAgICAgKHNhdmUtZXhjdXJzaW9uDQotCQkJKGdv dG8tY2hhciAocG9pbnQtbWluKSkNCi0JCQkocmUtc2VhcmNoLWZvcndhcmQg cmVnZXhwIG5pbCB0KSkpDQotCQkgICh3aXRoLXRlbXAtYnVmZmVyDQotCQkg ICAgKGluc2VydC1maWxlLWNvbnRlbnRzIGZuKQ0KLQkJICAgIChnb3RvLWNo YXIgKHBvaW50LW1pbikpDQotCQkgICAgKHJlLXNlYXJjaC1mb3J3YXJkIHJl Z2V4cCBuaWwgdCkpKSkNCi0JCSAgICAgICkpKQ0KLSAgICAgIm1hdGNoaW5n IGZpbGUiKSkpDQorCQkod2l0aC10ZW1wLWJ1ZmZlcg0KKwkJICAoaW5zZXJ0 LWZpbGUtY29udGVudHMgZm4pDQorCQkgIChnb3RvLWNoYXIgKHBvaW50LW1p bikpDQorCQkgIChyZS1zZWFyY2gtZm9yd2FyZCByZWdleHAgbmlsIHQpKSkp KQ0KKwkibWF0Y2hpbmcgZmlsZSIpKSkNCiANCiAoZGVmdW4gZGlyZWQtZmxh Zy1maWxlcy1yZWdleHAgKHJlZ2V4cCkNCiAgICJJbiBEaXJlZCwgZmxhZyBh bGwgZmlsZXMgY29udGFpbmluZyB0aGUgc3BlY2lmaWVkIFJFR0VYUCBmb3Ig ZGVsZXRpb24uDQo= --1468197610-1363473501-1456306314=:17491-- From unknown Tue Aug 19 05:11:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22694: 25.0.91; dired-mark-files-containing-regexp read file disk References: In-Reply-To: Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Apr 2016 07:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22694 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 22694@debbugs.gnu.org Received: via spool by 22694-submit@debbugs.gnu.org id=B22694.146027159127549 (code B ref 22694); Sun, 10 Apr 2016 07:00:02 +0000 Received: (at 22694) by debbugs.gnu.org; 10 Apr 2016 06:59:51 +0000 Received: from localhost ([127.0.0.1]:56508 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ap9Lb-0007AG-IH for submit@debbugs.gnu.org; Sun, 10 Apr 2016 02:59:51 -0400 Received: from calancha-ilc.kek.jp ([130.87.234.234]:57815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ap9LZ-0007A1-NQ for 22694@debbugs.gnu.org; Sun, 10 Apr 2016 02:59:50 -0400 Received: by calancha-ilc.kek.jp (Postfix, from userid 500) id 624B45959; Sun, 10 Apr 2016 16:03:00 +0900 (JST) Received: from localhost (localhost [127.0.0.1]) by calancha-ilc.kek.jp (Postfix) with ESMTP id 0241CC83 for <22694@debbugs.gnu.org>; Sun, 10 Apr 2016 16:03:00 +0900 (JST) Date: Sun, 10 Apr 2016 16:02:59 +0900 (JST) From: Tino Calancha X-X-Sender: calancha@calancha-ilc.kek.jp Message-ID: User-Agent: Alpine 2.20 (LRH 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Spam-Score: 1.0 (+) 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 (+) Let me argue more about why i found more useful if we change the current behaviour: Let's suppose the following case: 1) An user submit several hundred of jobs to a batch server. 2) The output consist of just log files (1 per job) which are written under the submission directory until the jobs succeded of fail. When the job fails, the logfile contains the word 'aborting'. 3) To resubmit the failed jobs, the user may put all logfiles together in a dired buffer using `find-name-dired'. From time to time, he/she call `dired-mark-files-containing-regexp' using 'aborting' as regexp: from this, he/she obtain directly the list of failed jobs... 4) ...But if the user has opened some of the logfiles from failed jobs, the word 'aborting' may not be in the buffer (the user need to revert it first), so the list of failed jobs at 3) will not be exhaustive. This behaviour is not consistent with the doc. string of the function: "Mark all files with contents containing REGEXP for use in later commands. A prefix argument means to unmark them instead. `.' and `..' are never marked." - As mentioned in 4) this function may not mark all files containing REGEXP and this is not obvious unless you read the source code. - Just from the doc. string i would expect this function behaves as in the patch within this thread. - Using the buffer when available seems like an optimization but in fact it's not because it may produce different results. I suggest in order of preference: A) Apply the patch in this thread: then, the funcion behaves as described in the doc. string. B) Modify the doc. string to account for the case when there are buffers visiting the files. From unknown Tue Aug 19 05:11:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22694: 25.0.91; dired-mark-files-containing-regexp read file disk Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Apr 2016 14:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22694 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Tino Calancha Cc: 22694@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 22694-submit@debbugs.gnu.org id=B22694.146116413024880 (code B ref 22694); Wed, 20 Apr 2016 14:56:01 +0000 Received: (at 22694) by debbugs.gnu.org; 20 Apr 2016 14:55:30 +0000 Received: from localhost ([127.0.0.1]:41527 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1astXO-0006TD-4n for submit@debbugs.gnu.org; Wed, 20 Apr 2016 10:55:30 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48935) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1astXL-0006T1-Pj for 22694@debbugs.gnu.org; Wed, 20 Apr 2016 10:55:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1astXA-0006xX-Ff for 22694@debbugs.gnu.org; Wed, 20 Apr 2016 10:55:22 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45699) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1astXA-0006xP-CP; Wed, 20 Apr 2016 10:55:16 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3377 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1astX9-00044X-9M; Wed, 20 Apr 2016 10:55:15 -0400 Date: Wed, 20 Apr 2016 17:55:07 +0300 Message-Id: <83twiw72k4.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Tino Calancha on Sun, 10 Apr 2016 16:02:59 +0900 (JST)) References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.0 (------) 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: -6.0 (------) > Date: Sun, 10 Apr 2016 16:02:59 +0900 (JST) > From: Tino Calancha > > 1) An user submit several hundred of jobs to a batch server. > > 2) The output consist of just log files (1 per job) which are written > under the submission directory until the jobs succeded of fail. > When the job fails, the logfile contains the word 'aborting'. > > 3) To resubmit the failed jobs, the user may put all logfiles together in a > dired buffer using `find-name-dired'. From time to time, he/she call > `dired-mark-files-containing-regexp' using 'aborting' as regexp: from this, > he/she obtain directly the list of failed jobs... > > 4) ...But if the user has opened some of the logfiles from failed jobs, the word > 'aborting' may not be in the buffer (the user need to revert it first), so the > list of failed jobs at 3) will not be exhaustive. This behaviour is not > consistent with the doc. string of the function: Making the doc string more explicit about this aspect is indeed a good idea. I've just did it on the emacs-25 branch. As for your scenario: when you work with logfiles, or any other kind of files that get updated regularly behind Emacs's back, you should turn on auto-revert-mode or auto-revert-tail-mode in the buffers of those files. Then the buffer's contents will be synchronized with the relevant files on disk, and the problem you describe would not exist. Bottom line, I don't think I agree with permanently changing the implementation along the lines you suggest, as that would be against the general principles (AFAIK them) of Dired's design, and actually also against the general principles of Emacs design vis-a-vis files and buffers that visit them: we don't automatically sync a buffer with the file it visits, and we don't automatically look on disk when the file's buffer differs from what's on disk. I guess we could have an option to switch to the behavior you would like to see, but such an option, if we introduce it, IMO should not be specific to this command, it should affect all the Dired commands which might produce different results when buffers are not auto-reverted. Another alternative is to have an optional feature that would ask whether to revert a buffer if Emacs finds that it was changed on disk since last visited. Thanks. From unknown Tue Aug 19 05:11:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22694: 25.0.91; dired-mark-files-containing-regexp read file disk Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Apr 2016 15:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22694 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Tino Calancha , 22694@debbugs.gnu.org Received: via spool by 22694-submit@debbugs.gnu.org id=B22694.146116608527788 (code B ref 22694); Wed, 20 Apr 2016 15:29:02 +0000 Received: (at 22694) by debbugs.gnu.org; 20 Apr 2016 15:28:05 +0000 Received: from localhost ([127.0.0.1]:41552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1asu2v-0007E8-84 for submit@debbugs.gnu.org; Wed, 20 Apr 2016 11:28:05 -0400 Received: from calancha-ilc.kek.jp ([130.87.234.234]:33555) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1asu2t-0007Dd-Kt for 22694@debbugs.gnu.org; Wed, 20 Apr 2016 11:28:04 -0400 Received: by calancha-ilc.kek.jp (Postfix, from userid 500) id D7E897271; Thu, 21 Apr 2016 00:31:14 +0900 (JST) Received: from localhost (localhost [127.0.0.1]) by calancha-ilc.kek.jp (Postfix) with ESMTP id BF3E16A24; Thu, 21 Apr 2016 00:31:14 +0900 (JST) Date: Thu, 21 Apr 2016 00:31:14 +0900 (JST) From: Tino Calancha X-X-Sender: calancha@calancha-ilc.kek.jp In-Reply-To: <83twiw72k4.fsf@gnu.org> Message-ID: References: <83twiw72k4.fsf@gnu.org> User-Agent: Alpine 2.20 (LRH 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Spam-Score: 1.0 (+) 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 (+) Thank you very much for your response. > Making the doc string more explicit about this aspect is indeed a good > idea. I've just did it on the emacs-25 branch. Thanks. The doc. string is very clear now. Certainly the function name is very suggestive about what the function should do, so may be people who will not read the doc and still suffer the issue... (i know, they should read the doc.). > As for your scenario: when you work with logfiles, or any other kind > of files that get updated regularly behind Emacs's back, you should > turn on auto-revert-mode or auto-revert-tail-mode in the buffers of > those files. Then the buffer's contents will be synchronized with the > relevant files on disk, and the problem you describe would not exist. Thank you for the advise. Definitely i need to use one of these options. > Bottom line, I don't think I agree with permanently changing the > implementation along the lines you suggest, as that would be against > the general principles (AFAIK them) of Dired's design, and actually > also against the general principles of Emacs design vis-a-vis files > and buffers that visit them: we don't automatically sync a buffer with > the file it visits, and we don't automatically look on disk when the > file's buffer differs from what's on disk. I have no comment on this: i am not expert enough. > I guess we could have an option to switch to the behavior you would > like to see, but such an option, if we introduce it, IMO should not be > specific to this command, it should affect all the Dired commands > which might produce different results when buffers are not > auto-reverted. I like this way. I may work on implement such option if you want. From unknown Tue Aug 19 05:11:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22694: 25.0.91; dired-mark-files-containing-regexp read file disk Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Apr 2016 15:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22694 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Tino Calancha Cc: 22694@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 22694-submit@debbugs.gnu.org id=B22694.146116732929646 (code B ref 22694); Wed, 20 Apr 2016 15:49:02 +0000 Received: (at 22694) by debbugs.gnu.org; 20 Apr 2016 15:48:49 +0000 Received: from localhost ([127.0.0.1]:41564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1asuMz-0007i5-Fb for submit@debbugs.gnu.org; Wed, 20 Apr 2016 11:48:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41837) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1asuMx-0007ht-US for 22694@debbugs.gnu.org; Wed, 20 Apr 2016 11:48:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asuMn-000820-Oo for 22694@debbugs.gnu.org; Wed, 20 Apr 2016 11:48:42 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asuMn-00081w-Lg; Wed, 20 Apr 2016 11:48:37 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3442 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1asuMn-0005Id-0l; Wed, 20 Apr 2016 11:48:37 -0400 Date: Wed, 20 Apr 2016 18:48:29 +0300 Message-Id: <83lh487036.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Tino Calancha on Thu, 21 Apr 2016 00:31:14 +0900 (JST)) References: <83twiw72k4.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.0 (------) 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: -6.0 (------) > Date: Thu, 21 Apr 2016 00:31:14 +0900 (JST) > From: Tino Calancha > cc: Tino Calancha , 22694@debbugs.gnu.org > > Thank you very much for your response. Thanks for raising the issue and for perseverance. > > I guess we could have an option to switch to the behavior you would > > like to see, but such an option, if we introduce it, IMO should not be > > specific to this command, it should affect all the Dired commands > > which might produce different results when buffers are not > > auto-reverted. > I like this way. I may work on implement such option if you want. I suggest to wait for a couple of days in case someone objects to such an option, and if no comments are posted, please go ahead and work on it. Thanks. From unknown Tue Aug 19 05:11:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22694: 25.0.91; dired-mark-files-containing-regexp read file disk Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Jun 2016 15:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22694 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Tino Calancha , 22694@debbugs.gnu.org Received: via spool by 22694-submit@debbugs.gnu.org id=B22694.146695514914064 (code B ref 22694); Sun, 26 Jun 2016 15:33:01 +0000 Received: (at 22694) by debbugs.gnu.org; 26 Jun 2016 15:32:29 +0000 Received: from localhost ([127.0.0.1]:56901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHC2v-0003em-AA for submit@debbugs.gnu.org; Sun, 26 Jun 2016 11:32:29 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:34824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHC2t-0003eY-KA for 22694@debbugs.gnu.org; Sun, 26 Jun 2016 11:32:28 -0400 Received: by mail-pf0-f169.google.com with SMTP id c2so53742553pfa.2 for <22694@debbugs.gnu.org>; Sun, 26 Jun 2016 08:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=DNM+4mvoj5+5iBUePF9PVHQmXRapxXlbJCYVUUXLx3Q=; b=KQnYI+Rp3rSbly/isZ0Ko07+/Gz8bJc2AERtkElkZBHyE+r4WPgwe8UaDV62UyzLDr gjhg+j0oUIvbElmK9LEXAfGWiBIz50n8sTN8BCGY35VLX3i9puxM5ITwShOnQjZuK6/g G5VhrCur5lakgIh4faWh8puFTykvgkAWLzTrbfkibAjrPg3Tr6+rvSZfrLzZ87wwNs6n Oinhx7wYrA08EP7WNL4e7pL9nUAmaeFbt0BHG09pht1TlokMk/xUoKVLGqN0hVEasAj6 4SlijOdGpT8ZANSnvz5M1+z2WAZHjLS7zGw/zI0yU034FOn9byVIAQLvawRodMc6J33h EQaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=DNM+4mvoj5+5iBUePF9PVHQmXRapxXlbJCYVUUXLx3Q=; b=Rk/7AJS/MJ99z7FiG+kfbeVoBDuFuXhqlUzrRFg3NvWnkQmaENFiKJujevDe9UvIJK 2sP9DyNuCa6G7X6KSlvbb3/JoZyVLXcg7UaWA1TwMYTolu89MEWpEM40cyMfoTLT2Qa4 bX3UFPFRHqVgF/J1oAUlp+Wg1gZ/GcFb5llkzCRza3aegm8wnq5zugSX/uLk52rhOT2d c5BroxVbUgNzFNSoTo8z4TURmsXIw8bArOl+0VNk1vojS8iudKu3LL0lre7qQo5ibEsc cT3ktAjmiXM2ar80e8bNX4xTJEFsPxy3Gp2VicF8FGIAM8Gx3qXU/CZ7HZMCXlDtPCgF SlDQ== X-Gm-Message-State: ALyK8tI+d5F/0XJPjn/OI48Y+sGtQEpFLnxG60PrgeiLDs7zoswvByayPa9t2WdkS0z3pw== X-Received: by 10.98.50.1 with SMTP id y1mr25173298pfy.120.1466955141838; Sun, 26 Jun 2016 08:32:21 -0700 (PDT) Received: from calancha-pc (softbank126103139048.bbtec.net. [126.103.139.48]) by smtp.gmail.com with ESMTPSA id y10sm476938pas.24.2016.06.26.08.32.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Jun 2016 08:32:21 -0700 (PDT) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Mon, 27 Jun 2016 00:32:18 +0900 (JST) X-X-Sender: calancha@calancha-pc In-Reply-To: <83lh487036.fsf@gnu.org> Message-ID: References: <83twiw72k4.fsf@gnu.org> <83lh487036.fsf@gnu.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Spam-Score: -0.7 (/) 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: -0.7 (/) On Wed, 20 Apr 2016, Eli Zaretskii wrote: >I guess we could have an option to switch to the behavior you would >like to see, but such an option, if we introduce it, IMO should not be >specific to this command, it should affect all the Dired commands >which might produce different results when buffers are not >auto-reverted. I have only found another Dired command which might require the new option: `dired-do-query-replace-regexp'. But it seems unnecessary because this command already alert the user if the file has being modified 'externally': ./emacs -Q -eval '(progn (with-temp-file "/tmp/foo" (insert "foobar")) (find-file "/tmp/foo") (dired "/tmp"))' % g \`foobar$ RET M-! echo foo > foo M-x dired-do-query-replace-regexp RET \`foobar$ RET bar RET ;; File foo changed on disk. Reread from disk? (yes or no) ;;; So i propose a patch which: 1) Adds a new option `dired-always-read-filesystem' (default value nil). 2) Use it just in `dired-mark-files-containing-regexp'. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >From e6449456c023e86511cd09dbcacefba471c5f1d5 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Mon, 27 Jun 2016 00:10:57 +0900 Subject: [PATCH] Dired always read file system * dired.el (dired-always-read-filesystem): Add new option. (dired-mark-files-containing-regexp): Use it (Bug#22694). * doc/emacs/dired.texi: Mention it in the manual. ; * etc/NEWS: Add entry for this change. --- doc/emacs/dired.texi | 7 +++++-- etc/NEWS | 3 +++ lisp/dired.el | 14 ++++++++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index 486e92a..763c1f5 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -550,13 +550,16 @@ Marks vs Flags the regular expression @var{regexp} (@code{dired-mark-files-containing-regexp}). This command is like @kbd{% m}, except that it searches the file contents instead of the file -name. Note that if a file is visited in an Emacs buffer, this command +name. Note that if a file is visited in an Emacs buffer, +and @code{dired-always-read-filesystem} evaluates @code{nil}, this command will look in the buffer without revisiting the file, so the results might be inconsistent with the file on disk if its contents has changed since it was last visited. If you don't want this, you may wish reverting the files you have visited in your buffers, or turning on the @code{auto-revert} mode in those buffers, before invoking this -command. @xref{Reverting}. +command. @xref{Reverting}. If you prefer that this command always revisit +the file, without having to revert the file or enable @code{auto-revert} +mode, you might want to set @code{dired-always-read-filesystem} to non-@code{nil}. @item C-/ @itemx C-x u diff --git a/etc/NEWS b/etc/NEWS index b3a044d..6683199 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -198,6 +198,9 @@ questions, with a handy way to display help texts. ** Dired +++ +*** New option 'dired-always-read-filesystem'. + ++++ *** In wdired, when editing files to contain slash characters, the resulting directories are automatically created. Whether to do this is controlled by the 'wdired-create-parent-directories' variable. diff --git a/lisp/dired.el b/lisp/dired.el index 38979b5..7eb6216 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -255,6 +255,15 @@ dired-hide-details-hide-information-lines :version "24.4" :group 'dired) +(defcustom dired-always-read-filesystem nil + "Non-nil means commands like `dired-mark-files-containing-regexp' which +may use a buffer visiting the file or read the file on disk, always +read the file system. Otherwise, if do exist a buffer visiting the file, +then use that buffer." + :type 'boolean + :version "25.2" + :group 'dired) + ;; Internal variables (defvar dired-marker-char ?* ; the answer is 42 @@ -3359,7 +3368,8 @@ dired-mark-files-containing-regexp A prefix argument means to unmark them instead. `.' and `..' are never marked. -Note that if a file is visited in an Emacs buffer, this command will +Note that if a file is visited in an Emacs buffer, and +`dired-always-read-filesystem' evaluates nil, this command will look in the buffer without revisiting the file, so the results might be inconsistent with the file on disk if its contents has changed since it was last visited." @@ -3379,7 +3389,7 @@ dired-mark-files-containing-regexp (message "Checking %s" fn) ;; For now we do it inside emacs ;; Grep might be better if there are a lot of files - (if prebuf + (if (and prebuf (not dired-always-read-filesystem)) (with-current-buffer prebuf (save-excursion (goto-char (point-min)) -- 2.8.1 In GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.20.6) Repository revision: 8419f0d166cf5107062ff74f120c591f3fce35d9 From unknown Tue Aug 19 05:11:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22694: 25.0.91; dired-mark-files-containing-regexp read file disk Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Jul 2016 11:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22694 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Tino Calancha Cc: 22694@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 22694-submit@debbugs.gnu.org id=B22694.146806250311333 (code B ref 22694); Sat, 09 Jul 2016 11:09:01 +0000 Received: (at 22694) by debbugs.gnu.org; 9 Jul 2016 11:08:23 +0000 Received: from localhost ([127.0.0.1]:43262 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLq7T-0002wj-Gw for submit@debbugs.gnu.org; Sat, 09 Jul 2016 07:08:23 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLq7R-0002wX-QK for 22694@debbugs.gnu.org; Sat, 09 Jul 2016 07:08:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLq7H-00028q-HV for 22694@debbugs.gnu.org; Sat, 09 Jul 2016 07:08:16 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38377) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLq7H-00028l-EO; Sat, 09 Jul 2016 07:08:11 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1529 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bLq7D-00031Z-Vw; Sat, 09 Jul 2016 07:08:08 -0400 Date: Sat, 09 Jul 2016 14:07:57 +0300 Message-Id: <83furjgjci.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Tino Calancha on Mon, 27 Jun 2016 00:32:18 +0900 (JST)) References: <83twiw72k4.fsf@gnu.org> <83lh487036.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) 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: -6.3 (------) > From: Tino Calancha > Date: Mon, 27 Jun 2016 00:32:18 +0900 (JST) > cc: Tino Calancha , 22694@debbugs.gnu.org > > >I guess we could have an option to switch to the behavior you would > >like to see, but such an option, if we introduce it, IMO should not be > >specific to this command, it should affect all the Dired commands > >which might produce different results when buffers are not > >auto-reverted. > > I have only found another Dired command which might require the new > option: > `dired-do-query-replace-regexp'. > But it seems unnecessary because this command already alert the user > if the file has being modified 'externally': > > ./emacs -Q -eval '(progn (with-temp-file "/tmp/foo" (insert "foobar")) (find-file "/tmp/foo") (dired "/tmp"))' > % g \`foobar$ RET > M-! echo foo > foo > M-x dired-do-query-replace-regexp RET \`foobar$ RET bar RET > ;; File foo changed on disk. Reread from disk? (yes or no) > > ;;; > So i propose a patch which: > 1) Adds a new option `dired-always-read-filesystem' (default value nil). > 2) Use it just in `dired-mark-files-containing-regexp'. Thanks, please push to master, after taking care of the following issues: > --- a/doc/emacs/dired.texi > +++ b/doc/emacs/dired.texi > @@ -550,13 +550,16 @@ Marks vs Flags > the regular expression @var{regexp} > (@code{dired-mark-files-containing-regexp}). This command is like > @kbd{% m}, except that it searches the file contents instead of the file > -name. Note that if a file is visited in an Emacs buffer, this command > +name. Note that if a file is visited in an Emacs buffer, > +and @code{dired-always-read-filesystem} evaluates @code{nil}, this Our usual style for what you want to say in the last sentence is like this: Note that if a file is visited in an Emacs buffer, and @code{dired-always-read-filesystem} is @code{nil} (the default), ... > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -198,6 +198,9 @@ questions, with a handy way to display help texts. > ** Dired > > +++ > +*** New option 'dired-always-read-filesystem'. Please tell in a sentence or 2 what does this option do. > +(defcustom dired-always-read-filesystem nil > + "Non-nil means commands like `dired-mark-files-containing-regexp' which > +may use a buffer visiting the file or read the file on disk, always > +read the file system. Otherwise, if do exist a buffer visiting the file, > +then use that buffer." The first line of the doc string must be a complete sentence. So I suggest the following alternative wording (which also clarifies the text in other places): "Non-nil means revert buffers visiting files before searching them. By default, commands like `dired-mark-files-containing-regexp' will search any buffers visiting the marked files without reverting them, even if they were changed on disk. When this option is non-nil, such buffers are always reverted before searching them." > +Note that if a file is visited in an Emacs buffer, and > +`dired-always-read-filesystem' evaluates nil, this command will ^^^^^^^^^^^^^ "is nil" Thanks. How about a test for this functionality? From unknown Tue Aug 19 05:11:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22694: 25.0.91; dired-mark-files-containing-regexp read file disk Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Jul 2016 05:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22694 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 22694@debbugs.gnu.org Received: via spool by 22694-submit@debbugs.gnu.org id=B22694.146821613321325 (code B ref 22694); Mon, 11 Jul 2016 05:49:02 +0000 Received: (at 22694) by debbugs.gnu.org; 11 Jul 2016 05:48:53 +0000 Received: from localhost ([127.0.0.1]:45879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMU5N-0005Xs-Kc for submit@debbugs.gnu.org; Mon, 11 Jul 2016 01:48:53 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:33840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMU5L-0005Xf-TO for 22694@debbugs.gnu.org; Mon, 11 Jul 2016 01:48:52 -0400 Received: by mail-pa0-f53.google.com with SMTP id fi15so18079510pac.1 for <22694@debbugs.gnu.org>; Sun, 10 Jul 2016 22:48:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=qRKNluQBzKe8+U9aAX7OH2Js95DkANxPcjea50lOYyw=; b=XRvXuAzSFe9/KY9lqNuaAFELjaGhwMsEb4lWAfU61OkoF6VB+TjBXt4rpqAM2gEAIQ ABOS4XDa002V5UPXYkUkOPG+ABif0kdDZlMW4QEFJsUG6CNwUMpeir4q5YbjC4it5Y3Q 8ZIU94p3tw7bGwDg9G98PQ+lS5d27BdI5f3WbZySUYjhaLFlr6aDsygUVbDGugEpzJwf TuspxBCuoSnVrWnWhRTCymUev5WJakMhpyFgNm8syeWhlNUW/WItYSZV3aH3CML3AFDU k355s1cPf3lVPWSLcCJroTgFOp8RFgZ/hLumidUKx/Xs0MFRwozPv9PtDpSdLyT+ZOGs uMWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=qRKNluQBzKe8+U9aAX7OH2Js95DkANxPcjea50lOYyw=; b=La0ILAhdUobZ5e1bloJhDUuQeBoyVjhKlJ3626Sz8hK9In0i3VxpREnqeiKMeCJMem CFShu9sjaPnOszDp4H/21Wa5HPKo5eB5UZnMJVzZM53w76pROPLKvpm8ogvKWkQrmmK7 GhZWDf19w9xEng3ifqsnFhdnlikAl+CkAD/DxQONs+SWlbw6l/WXcI9tNBeBaSwW9bHU i2uPmp6k0TSYnFg4JrB81cMz47wZB5Na5jn3/r92N6W2C+C7+KUYjJe5XmGRZr0VgIIA pQslO0bEK4hhilgKQXQBTnQIfNjtuhjK8Y0vpP9BDBs/Bbd297DgcGuoxCIbsx5yfByd LTtg== X-Gm-Message-State: ALyK8tJ9QigANLalSHEAmhcJBkX72iwXDY5BsDv6z5nib9PN+7837C+4n/oOQlrH1T2YuA== X-Received: by 10.66.242.201 with SMTP id ws9mr4403189pac.7.1468216125977; Sun, 10 Jul 2016 22:48:45 -0700 (PDT) Received: from calancha-pc ([240f:6e:c00e:1:6875:2e94:598b:96cb]) by smtp.gmail.com with ESMTPSA id p4sm1812574pac.46.2016.07.10.22.48.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Jul 2016 22:48:45 -0700 (PDT) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Mon, 11 Jul 2016 14:48:43 +0900 (JST) X-X-Sender: calancha@calancha-pc In-Reply-To: <83furjgjci.fsf@gnu.org> Message-ID: References: <83twiw72k4.fsf@gnu.org> <83lh487036.fsf@gnu.org> <83furjgjci.fsf@gnu.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Spam-Score: -0.7 (/) 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: -0.7 (/) On Sat, 9 Jul 2016, Eli Zaretskii wrote: > Thanks, please push to master, after taking care of the following > issues: Thank you very much for your help. Addressed all the issues and pushed to master. > How about a test for this functionality? Good idea. Added one test. From unknown Tue Aug 19 05:11:43 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Tino Calancha Subject: bug#22694: closed () Message-ID: References: X-Gnu-PR-Message: they-closed 22694 X-Gnu-PR-Package: emacs Reply-To: 22694@debbugs.gnu.org Date: Mon, 11 Jul 2016 05:50:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1468216201-21461-1" This is a multi-part message in MIME format... ------------=_1468216201-21461-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #22694: 25.0.91; dired-mark-files-containing-regexp read file disk which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 22694@debbugs.gnu.org. --=20 22694: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D22694 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1468216201-21461-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 22694-done) by debbugs.gnu.org; 11 Jul 2016 05:49:52 +0000 Received: from localhost ([127.0.0.1]:45883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMU6J-0005Zl-V0 for submit@debbugs.gnu.org; Mon, 11 Jul 2016 01:49:52 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:35149) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bMU6I-0005ZS-Lz for 22694-done@debbugs.gnu.org; Mon, 11 Jul 2016 01:49:50 -0400 Received: by mail-pf0-f176.google.com with SMTP id c2so32615788pfa.2 for <22694-done@debbugs.gnu.org>; Sun, 10 Jul 2016 22:49:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:message-id:user-agent:mime-version; bh=0LAHP5pq0B9mWUxJM5EbFwgMSPr4CBAg8kMknl9MaSI=; b=XzlCSTsg9uqVxWAkNlf1v2U4vCJv9K6sMEjS+jQke2q/ngDK225gJShOLAIXCsrIAm 2/f18rFcgNmPZNNv5T4c6780lWFj5TRpV9SQCQF5pQ0hDza1XRr8HZwbCJptfCWKMmUk 30M96TvxqMyKDfaHTcw2fNOH5q66zuwfmw5FaqHbZse2LeM3CIOPMZSf3xtZP1dS/qan +cElxJr1TRJiiqoLCJbLANupOoKyJCpOPAmWV1dYOLWzqQknYYfuCQk2b3/wK40IskZf 4YebduSDaA8aVedBouuzOvZ/vzbvWtEo1qNA1D8D4RSR8V7o6nD33FMR77x6ZJF+DVb4 2PVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:message-id:user-agent:mime-version; bh=0LAHP5pq0B9mWUxJM5EbFwgMSPr4CBAg8kMknl9MaSI=; b=ePIcR79jcc1wNdZGihTNTgkXBsEX7tiX9gFN8neemmSGmYci7N/zzwS3g7Z0u3XTYN ixpVo301l8jBstFDd4UMhII3Ehz9wu39JKGzOKAy3N6tREAcMuRHxkBN/s3DtXHXMDlM g1a7UugqOhcZIX8aHDZ0k5ZxaDsbrdJ4B5TyH1bq8+kg1KCtVamBy5DBFVfdDR0IDwvt XFiw+gN9qrcyAslR42F5j4Ih35rnwwK9xPC3JP6mZqzI4E+0TP8SekXuJWwaDtwOv9Ko 6Q5A1qOkWK1y8DAZVQk8TBwVft1Hxl0wC3Eph5AkS6ugBnYnHvWHQSfw0MPfZxHy63zX w17Q== X-Gm-Message-State: ALyK8tLZ6rKsaueXAFB7m3TOPh4DbT+i+sVWeoJ/YngbgAW+SR94Lv3awHt/RtDGfPQ1dg== X-Received: by 10.98.54.198 with SMTP id d189mr31869304pfa.39.1468216184866; Sun, 10 Jul 2016 22:49:44 -0700 (PDT) Received: from calancha-pc ([240f:6e:c00e:1:6875:2e94:598b:96cb]) by smtp.gmail.com with ESMTPSA id jh3sm1414791pac.14.2016.07.10.22.49.42 for <22694-done@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Jul 2016 22:49:43 -0700 (PDT) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Mon, 11 Jul 2016 14:49:41 +0900 (JST) X-X-Sender: calancha@calancha-pc To: 22694-done@debbugs.gnu.org Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.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 the administrator of that system for details. Content preview: Pushed to master branch [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f92capac[at]gmail.com) -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.176 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.192.176 listed in list.dnswl.org] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-Debbugs-Envelope-To: 22694-done 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.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.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 the administrator of that system for details. Content preview: Pushed to master branch [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.176 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.192.176 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f92capac[at]gmail.com) 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid Pushed to master branch ------------=_1468216201-21461-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 16 Feb 2016 12:44:29 +0000 Received: from localhost ([127.0.0.1]:40859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aVezU-0003LH-RL for submit@debbugs.gnu.org; Tue, 16 Feb 2016 07:44:29 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40188) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aVezT-0003L3-P9 for submit@debbugs.gnu.org; Tue, 16 Feb 2016 07:44:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVezN-0003xX-PF for submit@debbugs.gnu.org; Tue, 16 Feb 2016 07:44:22 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVezN-0003xT-M7 for submit@debbugs.gnu.org; Tue, 16 Feb 2016 07:44:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVezM-0007Pj-P5 for bug-gnu-emacs@gnu.org; Tue, 16 Feb 2016 07:44:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVezH-0003vj-Ou for bug-gnu-emacs@gnu.org; Tue, 16 Feb 2016 07:44:20 -0500 Received: from calancha-ilc.kek.jp ([130.87.234.234]:57021) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVezH-0003vV-FP for bug-gnu-emacs@gnu.org; Tue, 16 Feb 2016 07:44:15 -0500 Received: by calancha-ilc.kek.jp (Postfix, from userid 500) id 1816ADAB6; Tue, 16 Feb 2016 21:47:28 +0900 (JST) Received: from localhost (localhost [127.0.0.1]) by calancha-ilc.kek.jp (Postfix) with ESMTP id AA657DAB1 for ; Tue, 16 Feb 2016 21:47:28 +0900 (JST) Date: Tue, 16 Feb 2016 21:47:28 +0900 (JST) From: Tino Calancha X-X-Sender: calancha@calancha-ilc.kek.jp To: bug-gnu-emacs@gnu.org Subject: 25.0.91; dired-mark-files-containing-regexp read file disk Message-ID: User-Agent: Alpine 2.20 (LRH 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="1468197610-405949849-1455626848=:6276" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit 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: -4.0 (----) --1468197610-405949849-1455626848=:6276 Content-Type: text/plain; format=flowed; charset=US-ASCII When a buffer visiting the file on disk exists, the matching is performed on this buffer: if the buffer is out of sync with the file, the result may be wrong. emacs -Q /tmp/foo --eval='(progn (with-current-buffer "foo" (insert "baz")) (save-buffer))' C-x d RET M-! printf baz >> bar; for f in foo bar; do printf qux >> $f ; done RET g % g \`bazqux$ RET ;; Just match bar. It may signal an error if trying to read a non regular file. *) Files satisfying predicate `file-regular-p'. *) A buffer visiting the file on disk need to be updated before matching the input regexp. In GNU Emacs 25.0.91.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23) Repository revision: b1a3ebedba88689d26f44cf7db338104b849ae99 --1468197610-405949849-1455626848=:6276 Content-Type: text/plain; charset=US-ASCII; name=dired.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=dired.patch ZGlmZiAtLWdpdCBhL2xpc3AvZGlyZWQuZWwgYi9saXNwL2RpcmVkLmVsDQpp bmRleCAyNGIxMjhmLi5mNDIwNDBkIDEwMDY0NA0KLS0tIGEvbGlzcC9kaXJl ZC5lbA0KKysrIGIvbGlzcC9kaXJlZC5lbA0KQEAgLTMzNTUsOCArMzM1NSw4 IEBAIGRpcmVkLW1hcmstZmlsZXMtY29udGFpbmluZy1yZWdleHANCiAgICAg IChhbmQgKG5vdCAobG9va2luZy1hdC1wIGRpcmVkLXJlLWRvdCkpDQogCSAg KG5vdCAoZW9scCkpCQkJOyBlbXB0eSBsaW5lDQogCSAgKGxldCAoKGZuIChk aXJlZC1nZXQtZmlsZW5hbWUgbmlsIHQpKSkNCi0JICAgICh3aGVuIChhbmQg Zm4gKGZpbGUtcmVhZGFibGUtcCBmbikNCi0JCSAgICAgICAobm90IChmaWxl LWRpcmVjdG9yeS1wIGZuKSkpDQorCSAgICAod2hlbiAoYW5kIGZuIChmaWxl LXJlZ3VsYXItcCBmbikNCisJCSAgICAgICAoZmlsZS1yZWFkYWJsZS1wIGZu KSkNCiAJICAgICAgKGxldCAoKHByZWJ1ZiAoZ2V0LWZpbGUtYnVmZmVyIGZu KSkpDQogCQkobWVzc2FnZSAiQ2hlY2tpbmcgJXMiIGZuKQ0KIAkJOzsgRm9y IG5vdyB3ZSBkbyBpdCBpbnNpZGUgZW1hY3MNCkBAIC0zMzY0LDYgKzMzNjQs NyBAQCBkaXJlZC1tYXJrLWZpbGVzLWNvbnRhaW5pbmctcmVnZXhwDQogCQko aWYgcHJlYnVmDQogCQkgICAgKHdpdGgtY3VycmVudC1idWZmZXIgcHJlYnVm DQogCQkgICAgICAoc2F2ZS1leGN1cnNpb24NCisgICAgICAgICAgICAocmV2 ZXJ0LWJ1ZmZlciB0IHQgdCkNCiAJCQkoZ290by1jaGFyIChwb2ludC1taW4p KQ0KIAkJCShyZS1zZWFyY2gtZm9yd2FyZCByZWdleHAgbmlsIHQpKSkNCiAJ CSAgKHdpdGgtdGVtcC1idWZmZXINCg== --1468197610-405949849-1455626848=:6276-- ------------=_1468216201-21461-1--