bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#11795: 24.1.50; wdired: C-c C-c loses marks and positions of renamed


From: Michael Heerdegen
Subject: bug#11795: 24.1.50; wdired: C-c C-c loses marks and positions of renamed files
Date: Sat, 19 Jan 2013 07:32:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.92 (gnu/linux)

Hello Juri,

sorry, again, for the long delay.

> > 1.  When I prepend a letter z to the first file in a buffer, so that it
> > will be under the last files after reverting, and I hit C-c C-c, then
> > point is at another file afterwards.  This was an issue of the original
> > report.
>
> This is not a regression, so it could be fixed in the trunk
> in the same way as for `wdired-old-marks', i.e. to store the original
> value returned from `dired-save-positions', changing original filenames
> to renamed filenames in the returned value, and calling
> `dired-restore-positions' with the new value after `revert-buffer'.
> A simple patch below does this.

Ok, that seems reasonable to me.

> > 2.  If renamed files are also visible in another dired buffer, they
> > just disappear there.  That makes no sense.
>
> The problem where other Dired buffers are not updated
> in `wdired-finish-edit' is not a regression too.
> WDired worked this way from its first version.
>
> Instead of this, much simpler would be to keep the current design
> of WDired that uses `revert-buffer' to maintain consistency with renames.
> Then a simpler fix would be to call `revert-buffer' in all other
> Dired buffers that display renamed files by using
>
>   (dired-fun-in-all-buffers dired-directory nil (function revert-buffer))
>
> This patch for the trunk demonstrates how these problems could be fixed.
> Do you see more problems with this approach?

I must say that I'm a bit reluctant to force a revert in other buffers.
Because some aspects of the these buffers may be lost that maybe were
important for the user - like killed files (they reappear when
reverting) or any marks (e.g. belonging to positions stored in a
register).  That's why I tried to avoid reverting.

WRT to the marks in other buffers (see your followup
<87sj7yavw7.fsf@mail.jurta.org>) - I agree we should restore (keep) the
marks in those other buffers when renaming files, and not export the
marks form the buffer where wdired was used.


Thanks,

Michael.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]