GNU bug report logs - #58256
Possible mistake in recent `dired-do-flagged-delete' change

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefankangas <at> gmail.com>

Date: Sun, 2 Oct 2022 18:43:01 UTC

Severity: normal

Tags: patch

Fixed in version 29.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Kangas <stefankangas <at> gmail.com>
To: 58256 <at> debbugs.gnu.org
Cc: Stephen Berman <stephen.berman <at> gmx.net>
Subject: bug#58256: Possible mistake in recent `dired-do-flagged-delete' change
Date: Sun, 2 Oct 2022 20:42:17 +0200
It seems like there might be a mistake in the `dired-do-flagged-delete'
of this commit:

    commit 194d54a929a83fede75d618b104acd1b544feb10
    Author: Stephen Berman <stephen.berman <at> gmx.net>
    Date:   Fri Jun 4 12:01:41 2021 +0200

        Fix placement of point in Dired deletion operations

It seems like there is a `dolist' that will always run on the empty
list.  Was perhaps the below the intended change?

If so, I wonder how this code would have worked without that `dolist' so
far, and if that line could just be removed instead?

diff --git a/lisp/dired.el b/lisp/dired.el
index b9e89292e2..358e815c88 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3664,16 +3664,17 @@ dired-do-flagged-delete
 	 case-fold-search markers)
     (if (save-excursion (goto-char (point-min))
 			(re-search-forward regexp nil t))
-	(dired-internal-do-deletions
-         (nreverse
-	  ;; this can't move point since ARG is nil
-	  (dired-map-over-marks (cons (dired-get-filename)
-                                      (let ((m (point-marker)))
-                                        (push m markers)
-                                        m))
-			        nil))
-	 nil t)
-      (dolist (m markers) (set-marker m nil))
+        (progn
+          (dired-internal-do-deletions
+           (nreverse
+            ;; this can't move point since ARG is nil
+            (dired-map-over-marks (cons (dired-get-filename)
+                                   (let ((m (point-marker)))
+                                     (push m markers)
+                                     m))
+                             nil))
+           nil t)
+          (dolist (m markers) (set-marker m nil)))
       (or nomessage
 	  (message "(No deletions requested)")))))




This bug report was last modified 2 years and 310 days ago.

Previous Next


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