unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: peter.mao@gmail.com, 63676@debbugs.gnu.org
Subject: bug#63676: cancelling editable dired causes UI problems with dired
Date: Sat, 27 May 2023 09:24:26 +0300	[thread overview]
Message-ID: <83edn2jnqd.fsf@gnu.org> (raw)
In-Reply-To: <87jzwupp7n.fsf@web.de> (message from Michael Heerdegen on Sat, 27 May 2023 02:55:56 +0200)

> From: Michael Heerdegen <michael_heerdegen@web.de>
> Cc: Peter Mao <peter.mao@gmail.com>,  63676@debbugs.gnu.org
> Date: Sat, 27 May 2023 02:55:56 +0200
> 
> I think this should be appropriate:

Thanks, but why removal of the comment? is the comment incorrect or
inaccurate?  I think having comments that explain why we do
non-trivial things is an advantage.

> Background: Aborting wdired (`wdired-abort-changes') erases the
> buffer and insert the original buffer contents, then re-enters
> dired-mode.  Positions in `dired-subdir-alist' (that are necessary for
> $) are represented as markers.  These just have to be updated.

Are we sure this is the _only_ thing that needs to be updated?
dired-revert does much more, so we should audit what it does carefully
to determine which parts may need re-doing here.  If you did that,
would you please present the analysis and the conclusions?  In
particular, wdired-abort-changes could be called after more commands
than the original recipe shows, and that could affect other aspects of
the Dired buffer, not just dired-subdir-alist.

> A less invasive way of aborting wdired could just undo any user changes.
> I think this should be doable using change groups.  Then we would not
> loose any kind of marker positions.  `wdired-finish-edit' does not
> suffer from these kind of problems because it only touches buffer parts
> that correspond to changed file lines.  Currently aborting is more
> invasive than actually making changes.

This change was installed in the emacs-29 branch.  Any alternative
change, if we want it in Emacs 29, should be both safe (in the sense
that its code doesn't risk breaking other things) and reliable (in the
sense that it solves the original problem in its entirety).  If we can
come up with such an alternative, fine; otherwise what you propose
might be good for experimenting on the master branch, but not for the
release branch.

And having said all that, I don't really understand why we should
worry so much about the downsides of the solution: is
wdired-abort-changes something that is used a lot?  At least its speed
sounds not important at all, and if the information it loses is indeed
important enough, the way to avoid that is to restore that information
after reverting, perhaps the way wdired-finish-edit does (which, btw,
does call revert).





  parent reply	other threads:[~2023-05-27  6:24 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-24  4:51 bug#63676: cancelling editable dired causes UI problems with dired Peter Mao
2023-05-24 11:05 ` Eli Zaretskii
2023-05-24 12:09   ` Stephen Berman
2023-05-25  1:14   ` Peter Mao
2023-05-26  9:25     ` Eli Zaretskii
2023-05-26 23:51   ` Michael Heerdegen
2023-05-27  0:55   ` Michael Heerdegen
2023-05-27  2:39     ` Michael Heerdegen
2023-05-27  6:26       ` Eli Zaretskii
2023-05-27  6:24     ` Eli Zaretskii [this message]
2023-05-28  1:36       ` Michael Heerdegen
2023-05-28  4:09         ` Thierry Volpiatto
2023-05-28  5:01           ` Michael Heerdegen
2023-05-28  5:08             ` Thierry Volpiatto
2023-05-28 16:04             ` Drew Adams
2023-05-28 16:21               ` Thierry Volpiatto
2023-05-28 19:17                 ` Drew Adams
2023-05-29  3:43                   ` Thierry Volpiatto
2023-05-29  5:16                     ` Drew Adams
2023-05-29  9:43                       ` Thierry Volpiatto
2023-05-29 17:11                         ` Drew Adams
2023-05-28 16:05           ` Drew Adams
2023-05-28  3:39       ` Michael Heerdegen
2023-05-28  6:43         ` Eli Zaretskii
2023-05-29  1:35           ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83edn2jnqd.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=63676@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=peter.mao@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).