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: Phil Sainty <psainty <at> orcon.net.nz>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 78658 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: bug#78658: 30.1; [PATCH] Dired feature suggestion: dired-on-marked-files-in-all-buffers
Date: Thu, 05 Jun 2025 20:30:14 +1200
On 2025-06-05 06:26, Drew Adams wrote:
> I'm afraid I may have led you (and myself) astray, by suggesting to
> use variable `dired-buffers' instead of testing all buffers.
> (I see you adopted that in your latest code.)
> 
> It works fine, and it's much faster by not bothering with non-Dired
> buffers.  The problem is that it doesn't work with commands
> `find-dired' and  `find-lisp-find-dired*'.  They produce legitimate
> Dired buffers, and they work fine with the feature we're discussing,
> but they're excluded from `dired-buffers'.  They have this binding:
> 
>   (let ((dired-buffers dired-buffers))...)

Ah, yes :/  Along with their derivative commands.


> _Should_ they be excluded from `dired-buffers'?  Maybe so, maybe not.
> They support most Dired features, and their mode is `dired-mode', but
> there are perhaps a few Dired features they don't support (dunno what,
> offhand - they support WDired and everything else that occurs to me
> offhand).  (I wish their code included a comment as to _why_ they have
> that binding.)

The following seems to be the best there is, which doesn't help
beyond confirming that it's intentional (which was already clear
from the binding itself).

commit 0322a154b764f8358ba8913dc6fc724ba9f4294d
Author: Richard M. Stallman <rms <at> gnu.org>
Date:   Sat Jun 27 21:59:11 1998 +0000

    (find-dired): Bind dired-buffers so it can't change.  Use 
abbreviate-file-name.


The symbol doesn't crop up in too many places:

./find-lisp.el:47:(defvar dired-buffers)
./find-lisp.el:217:  (let ((dired-buffers  dired-buffers)
./find-dired.el:226:  (let ((dired-buffers dired-buffers))
./bs.el:187:    ;; Dired-Buffers
./dired.el:1093:                   dired-buffers)))))
./dired.el:1488:(defvar dired-buffers nil
./dired.el:1520:      (let (found (blist dired-buffers))    ; was 
(buffer-list)
./dired.el:3592:`dired-buffers'."
./dired.el:3595:    (dolist (elt dired-buffers)
./dired.el:3600:	(setq dired-buffers (delq elt dired-buffers)))
./dired.el:3619:`dired-buffers'."
./dired.el:3622:    (dolist (elt dired-buffers)
./dired.el:3627:	(setq dired-buffers (delq elt dired-buffers)))
./dired.el:3667:  ;;"Advertise in variable `dired-buffers' that we dired 
`default-directory'."
./dired.el:3672:      (setq dired-buffers
./dired.el:3674:		  dired-buffers)))))
./dired.el:3677:  ;; Remove DIR from the buffer alist in variable 
dired-buffers.
./dired.el:3681:  (setq dired-buffers
./dired.el:3682:	(delq (assoc (expand-file-name dir) dired-buffers) 
dired-buffers)))
./org/org-capture.el:76:(defvar dired-buffers)
./org/org-capture.el:705:							     dired-buffers))))


So auditing the associated behaviours might be an option,
to see if some reason for it becomes apparent.

Offhand it seems odd to me.


-Phil





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.