From 9ecbdeeaa845a75c63210057a8a554eedc9387bf Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Wed, 9 Aug 2017 14:37:21 +0900 Subject: [PATCH] Ask files for deletion in buffer order: top first, botton later * lisp/dired.el (dired-do-flagged-delete, dired-do-delete): Call `nreverse' t invert the output of `dired-map-over-marks'. --- lisp/dired.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lisp/dired.el b/lisp/dired.el index 54bc6217031..2e5b847f9b2 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3057,9 +3057,10 @@ non-empty directories is allowed." (if (save-excursion (goto-char (point-min)) (re-search-forward regexp nil t)) (dired-internal-do-deletions - ;; this can't move point since ARG is nil - (dired-map-over-marks (cons (dired-get-filename) (point)) - nil) + (nreverse + ;; this can't move point since ARG is nil + (dired-map-over-marks (cons (dired-get-filename) (point)) + nil)) nil t) (or nomessage (message "(No deletions requested)"))))) @@ -3072,9 +3073,10 @@ non-empty directories is allowed." ;; dired-do-flagged-delete. (interactive "P") (dired-internal-do-deletions - ;; this may move point if ARG is an integer - (dired-map-over-marks (cons (dired-get-filename) (point)) - arg) + (nreverse + ;; this may move point if ARG is an integer + (dired-map-over-marks (cons (dired-get-filename) (point)) + arg)) arg t)) (defvar dired-deletion-confirmer 'yes-or-no-p) ; or y-or-n-p? -- 2.39.2