all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: 58256@debbugs.gnu.org
Cc: Stephen Berman <stephen.berman@gmx.net>
Subject: bug#58256: Possible mistake in recent `dired-do-flagged-delete' change
Date: Sun, 2 Oct 2022 20:42:17 +0200	[thread overview]
Message-ID: <CADwFkmmmY2ffrr2rkm6njCxb6cjSB2vE_oC4cWBnuKnJA3LeCg@mail.gmail.com> (raw)

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)")))))





             reply	other threads:[~2022-10-02 18:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-02 18:42 Stefan Kangas [this message]
2022-10-02 19:17 ` bug#58256: Possible mistake in recent `dired-do-flagged-delete' change Stefan Kangas
2022-10-02 20:46 ` Stephen Berman
2022-10-02 22:30   ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADwFkmmmY2ffrr2rkm6njCxb6cjSB2vE_oC4cWBnuKnJA3LeCg@mail.gmail.com \
    --to=stefankangas@gmail.com \
    --cc=58256@debbugs.gnu.org \
    --cc=stephen.berman@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.