Subject: Re: bug#57334: 28.1; Fix wdired with (dired '(dir f1 f2 ...))

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 22 Aug 2022 16:54:54 +0200

Thierry Volpiatto <[email-masked]> writes:

>>> +                 (setcdr dired-directory

[...]

> Of course it have to be changed, it has been modified by wdired at this point,
> so if you want to redisplay a dired buffer reflecting your changes you
> have to modify it no ?

I don't understand what you mean.

>> which we shouldn't do.
>
> You already do it when DIRNAME is a string isn't it?

Strings can't be modified.

>> (It may even be a constant.)
>
> Can you elaborate?

If the list is in purespace, for instance, it can't be modified.

In case there's any misunderstanding here, I'm talking about the
destructive alteration of the list pointed to by dired-directory by that
`setcdr' -- not the altering of the dired-directory variable.  So the
safe change here would be something like

  (setq dired-directory (cons (car dired-directory) (mapcar ...)))