GNU bug report logs - #78658
30.1; [PATCH] Dired feature suggestion: dired-on-marked-files-in-all-buffers

Previous Next

Package: emacs;

Reported by: Phil Sainty <psainty <at> orcon.net.nz>

Date: Sun, 1 Jun 2025 03:20:06 UTC

Severity: normal

Tags: patch

Found in version 30.1

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Phil Sainty <psainty <at> orcon.net.nz>
Cc: 78658 <at> debbugs.gnu.org
Subject: bug#78658: 30.1; [PATCH] Dired feature suggestion: dired-on-marked-files-in-all-buffers
Date: Sun, 01 Jun 2025 09:10:45 +0300
> Date: Sun, 01 Jun 2025 15:19:02 +1200
> From: Phil Sainty <psainty <at> orcon.net.nz>
> 
> A user in the matrix.org Emacs chat room was asking why they couldn't
> open multiple directories in multiple dired buffers, mark various files
> in each of those buffers, and then perform some action on ALL of those
> marked files at once.

If those other directories are subdirectories of some common parent,
we already have 'i'.

> My first thought was that this would be chaotic due to the possibility
> of dired buffers with marked files which the user wasn't aware of at
> the time; but then I remembered that you can pass `dired' a file list
> in order to create a new dired buffer with only those files, and I
> thought *that* sounded like a nice feature which addressed the
> requirement in a safe manner (as the user then gets to review the file
> list in the new dired buffer before acting on them).
> 
> I've attached a patch with a first pass implementation.
> 
> Thoughts?

I guess we could add that, although it's a rare use case, and the
display is not very nice, since all the file names are absolute, and
thus long.  Perhaps use abbreviate-file-name?

> +(defun dired-on-marked-files-in-all-buffers ()
> +  "Invoke `dired' on the marked files in all dired buffers."
> +  (interactive)
> +  (if-let ((files (dired-get-marked-files-in-all-buffers)))
> +      (dired (cons "/" files))

Why "/"?  It sounds arbitrary.  Also non-portable; use

  (expand-file-name "/")

instead.




This bug report was last modified 5 days ago.

Previous Next


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