From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71264: 30.0.50; Dired deletion moves point under auto-revert Date: Mon, 17 Jun 2024 11:29:01 +0200 Message-ID: <875xu7hq8y.fsf@ledu-giraud.fr> References: <87zfs8waqx.fsf@epfl.ch> <87mso61g92.fsf@ledu-giraud.fr> <87ikyu1fo5.fsf@ledu-giraud.fr> <87sexygp0t.fsf@epfl.ch> <874jactwbz.fsf@ledu-giraud.fr> <86h6eco86x.fsf@gnu.org> <87h6eb75lg.fsf@epfl.ch> <86ed9fmkqm.fsf@gnu.org> <87sexv5lcw.fsf@epfl.ch> <877cf5x3gl.fsf@ledu-giraud.fr> <868qzlluj5.fsf@gnu.org> <87wmn5vlsg.fsf@ledu-giraud.fr> <867cf4lr6d.fsf@gnu.org> <878qzko5af.fsf@ledu-giraud.fr> <87r0d9m5af.fsf@ledu-giraud.fr> <87h6e3wh12.fsf@ledu-giraud.fr> <86h6duvb8q.fsf@gnu.org> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21146"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: basil@contovou.net, 71264@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 17 11:30:34 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sJ8h6-0005IO-Se for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Jun 2024 11:30:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJ8ge-0002xU-Ce; Mon, 17 Jun 2024 05:30:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sJ8gc-0002x9-1O for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2024 05:30:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJ8gb-0007tw-Fb for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2024 05:30:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sJ8gd-0004Pn-04 for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2024 05:30:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Jun 2024 09:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71264 X-GNU-PR-Package: emacs Original-Received: via spool by 71264-submit@debbugs.gnu.org id=B71264.171861655016879 (code B ref 71264); Mon, 17 Jun 2024 09:30:02 +0000 Original-Received: (at 71264) by debbugs.gnu.org; 17 Jun 2024 09:29:10 +0000 Original-Received: from localhost ([127.0.0.1]:59558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJ8fl-0004OB-L0 for submit@debbugs.gnu.org; Mon, 17 Jun 2024 05:29:10 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]:25281) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJ8fi-0004Nz-RA for 71264@debbugs.gnu.org; Mon, 17 Jun 2024 05:29:08 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=Lo66Gfr3 /awVZphkZ5/9wVpIn/5PM/C7gmmcpTnFWFc=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=1AbeYaVJDFST8CTHAjgITEaJW8aqsx jlGMlK7ujqfSatwK6fK7Y97aWZa+5iQSxQ0A+RpU7hlS16go03s4oKDQ== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=Lo66Gfr3/awVZphk Z5/9wVpIn/5PM/C7gmmcpTnFWFc=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=RYlGpsFCS9Rxa71FCGU6P+Myh8yxUkBvLwl0Rz GJU/8/biWFCYS4Gg/nxTwy5FpdvqaWTbqDPrBv4wgNpCy1HDzSTz15vmaU6a0ytpaXQXXk 5dn4YrvWEYATlx1QbTTyBaAqL+Sd8kiMNT699mwj+PA0NoB3I7v5vdur7hlJubp7cT56kj 8H2bTxq/cGOi1/CT87dJjaqu3S+ihedyduPnoaeBWkhOR989thx+le0OzOIGH43X0a98j6 3Vf5AxpCylp6mVXsGs7lO0gZ+GosxmWvNKfWy9z6WWIyZZGMcjv0ih1WoTFAfqqAVKHpRG jaLN8IEFHcvqJ8ow/A3DVecQ== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id a824b22f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 17 Jun 2024 11:29:02 +0200 (CEST) In-Reply-To: <86h6duvb8q.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 15 Jun 2024 11:52:37 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:287374 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > I think we should install this, but byte-compiling it produces a > warning: > > In dired-internal-do-deletions: > dired.el:4021:28: Warning: Unused lexical variable `auto-revert-mode' > > Can you fix this and resubmit? Thanks Eli. Here is an updated version of this patch. I also removed the setting of `dired-auto-revert-buffer' that has nothing to do with this bug and added a reference to the bug number in the comments. > Also, I presume all the Dired tests in the test suite still pass after > the change? I have attached the following logs: dir-tests.log, dired-aux-tests.log and dired-x-tests.log. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Prevent-auto-revert-when-deleting-entry-bug-71264.patch >From b4b3e32a7f1375ff228bc25311a56062d64aa049 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Mon, 17 Jun 2024 11:06:28 +0200 Subject: [PATCH] Prevent auto-revert when deleting entry(bug#71264) * lisp/dired.el (require): Require "autorevert" for `auto-revert-mode' usage. (dired-internal-do-deletions): Temporarily prevent auto-revert. --- lisp/dired.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/dired.el b/lisp/dired.el index c51e5e42c29..0adf06f471e 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -36,6 +36,7 @@ (eval-when-compile (require 'subr-x)) (eval-when-compile (require 'cl-lib)) +(eval-when-compile (require 'autorevert)) ;; When bootstrapping dired-loaddefs has not been generated. (require 'dired-loaddefs nil t) (require 'dnd) @@ -4015,7 +4016,11 @@ dired-internal-do-deletions (dired-move-to-filename) (let ((inhibit-read-only t)) (condition-case err - (let ((fn (car (car l)))) + (let ((fn (car (car l))) + ;; Temporarily prevent auto-revert while + ;; deleting entry in the dired buffer + ;; (bug#71264). + (auto-revert-mode nil)) (dired-delete-file fn dired-recursive-deletes trash) ;; if we get here, removing worked (setq succ (1+ succ)) -- 2.45.2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename=dired-tests.log Content-Transfer-Encoding: quoted-printable Running 16 tests (2024-06-17 11:19:04+0200, selector =E2=80=98(not (or (tag= :expensive-test) (tag :unstable) (tag :nativecomp)))=E2=80=99) passed 1/16 dired-autoload (0.000141 sec) Marking matching files... Checking /home/manuel/emacs-repo/test/bug22694/test 1 matching file marked passed 2/16 dired-test-bug22694 (0.085776 sec) Copy: 1 of 1 Copy: 1 file done Copy: 1 of 1 Copy: 1 file done passed 3/16 dired-test-bug25609 (0.034042 sec) Saved pos: ((# nil 4) nil nil) Saved pos: ((# "/tmp/emacs-test-tp9Za3-dire= d/test-subdir" 4) ((# "/tmp/emacs-test= -tp9Za3-dired/test-subdir" 4)) nil) Saved pos: ((# "/tmp/emacs-test-tp9Za3-dire= d/test-subdir" 4) ((# "/tmp/emacs-test= -tp9Za3-dired/test-subdir" 4)) nil) Saved pos: ((# "/tmp/emacs-test-tp9Za3-dire= d/test-subdir" 4) ((# "/tmp/emacs-test= -tp9Za3-dired/test-subdir" 4)) nil) Saved pos: ((# "/tmp/emacs-test-tp9Za3-dire= d/test-subdir" 4) ((# "/tmp/emacs-test= -tp9Za3-dired/test-subdir" 4)) nil) passed 4/16 dired-test-bug27243-01 (0.042852 sec) passed 5/16 dired-test-bug27243-02 (0.041971 sec) passed 6/16 dired-test-bug27243-03 (0.094497 sec) passed 7/16 dired-test-bug27631 (0.013950 sec) passed 8/16 dired-test-bug27940 (0.086650 sec) passed 9/16 dired-test-bug27968 (0.021243 sec) passed 10/16 dired-test-bug59047 (0.037082 sec) passed 11/16 dired-test-bug7131 (0.088727 sec) passed 12/16 dired-test-directory-files (0.003667 sec) passed 13/16 dired-test-directory-files-and-attributes (0.002743 sec) passed 14/16 files-tests-bug-50630 (0.010067 sec) passed 15/16 files-tests-insert-directory-shows-files (0.009958 sec) passed 16/16 files-tests-insert-directory-shows-free (0.010036 sec) Ran 16 tests, 16 results as expected, 0 unexpected (2024-06-17 11:19:05+020= 0, 0.585970 sec) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename=dired-aux-tests.log Content-Transfer-Encoding: quoted-printable Running 5 tests (2024-06-17 11:19:04+0200, selector =E2=80=98(not (or (tag = :expensive-test) (tag :unstable) (tag :nativecomp)))=E2=80=99) passed 1/5 dired-guess-default (0.000328 sec) /tmp/emacs-test-6LIEqx-dired-aux /tmp/emacs-test-6LIEqx-dired-aux /tmp/emacs-test-6LIEqx-dired-aux /tmp/emacs-test-6LIEqx-dired-aux ls: .//tmp/emacs-test-6LIEqx-dired-aux: No such file or directory /tmp/emacs-test-6LIEqx-dired-aux passed 2/5 dired-test-bug27496 (0.046338 sec) passed 3/5 dired-test-bug28834 (0.003451 sec) passed 4/5 dired-test-bug30624 (0.023089 sec) passed 5/5 dired-test-highlight-metachar (0.000178 sec) Ran 5 tests, 5 results as expected, 0 unexpected (2024-06-17 11:19:04+0200,= 0.074519 sec) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename=dired-x-tests.log Content-Transfer-Encoding: quoted-printable Running 2 tests (2024-06-17 11:19:05+0200, selector =E2=80=98(not (or (tag = :expensive-test) (tag :unstable) (tag :nativecomp)))=E2=80=99) Marking matching files... 2 matching files marked 2 marks removed Marking matching files... 6 matching files marked passed 1/2 dired-test-bug25942 (0.025861 sec) passed 2/2 dired-x--string-to-number (0.000086 sec) Ran 2 tests, 2 results as expected, 0 unexpected (2024-06-17 11:19:05+0200,= 0.026748 sec) --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=--