unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#58256: Possible mistake in recent `dired-do-flagged-delete' change
@ 2022-10-02 18:42 Stefan Kangas
  2022-10-02 19:17 ` Stefan Kangas
  2022-10-02 20:46 ` Stephen Berman
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Kangas @ 2022-10-02 18:42 UTC (permalink / raw)
  To: 58256; +Cc: Stephen Berman

It seems like there might be a mistake in the `dired-do-flagged-delete'
of this commit:

    commit 194d54a929a83fede75d618b104acd1b544feb10
    Author: Stephen Berman <stephen.berman@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)")))))





^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-02 22:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-02 18:42 bug#58256: Possible mistake in recent `dired-do-flagged-delete' change Stefan Kangas
2022-10-02 19:17 ` Stefan Kangas
2022-10-02 20:46 ` Stephen Berman
2022-10-02 22:30   ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).