From: Stephen Berman <stephen.berman@gmx.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Peter Mao <peter.mao@gmail.com>, 63676@debbugs.gnu.org
Subject: bug#63676: cancelling editable dired causes UI problems with dired
Date: Wed, 24 May 2023 14:09:18 +0200 [thread overview]
Message-ID: <87o7ma3p8x.fsf@gmx.net> (raw)
In-Reply-To: <83ilcing54.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 24 May 2023 14:05:43 +0300")
[-- Attachment #1: Type: text/plain, Size: 1937 bytes --]
On Wed, 24 May 2023 14:05:43 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Peter Mao <peter.mao@gmail.com>
>> Date: Tue, 23 May 2023 21:51:01 -0700
>>
>> I'm testing: GNU Emacs 29.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version
>> 3.24.33, cairo
>> version 1.16.0) of 2023-05-15
>>
>> Dired behavior has multiple problems if subdirectories are present in the
>> buffer and writable mode is
>> entered and then cancelled
>>
>> To reproduce the problem
>> 1. Open a directory in dired
>> 2. Insert a subdirectory with "i"
>> 3. Enter writable mode "C-x C-q"
>> 4. Cancel writable mode "C-c ESC"
>>
>> Now the subdirectory is in the buffer, but it can't be folded or removed
>> with "C-u k" and the top dir files
>> can no longer be accessed.
>
> I seem to be unable to reproduce this. But your recipe lack some
> details, so I'm unsure. Would you please describe exactly what to
> type after "C-c ESC" to demonstrate that some commands don't work, and
> what did you expect those command to do?
I can reproduce the problem: After step 4 above, with point within the
subdirectory, typing `$' should hide just the subdirectory, but it hides
the entire directory structure, i.e. the topmost directory and all
subdirectories. After typing `$' to show the directory, which also
shows the previously inserted subdirectory, with point on the first line
of the subdirectory (i.e. the line containing the name of the
subdirectory), typing `C-u k' should remove the display of the
subdirectory, but it does not and instead errors with the message "Can
only kill file lines".
The OP noted that typing `g' after step 4 makes subsequently typing `$'
and `C-u k' in the subdirectory work as expected. In fact, `g' in dired
does not call revert-buffer but dired-revert, which properly restores
subdirectories. And indeed, with the patch below I don't see the
problems any more.
Steve Berman
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: wdired-abort-changes patch --]
[-- Type: text/x-patch, Size: 381 bytes --]
diff --git a/lisp/wdired.el b/lisp/wdired.el
index 5572dcb32f3..ac3735d636f 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -470,6 +470,7 @@ wdired-abort-changes
(insert wdired--old-content)
(goto-char wdired--old-point))
(wdired-change-to-dired-mode)
+ (dired-revert)
(set-buffer-modified-p nil)
(setq buffer-undo-list nil)
(message "Changes aborted"))
next prev parent reply other threads:[~2023-05-24 12:09 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 [this message]
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
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=87o7ma3p8x.fsf@gmx.net \
--to=stephen.berman@gmx.net \
--cc=63676@debbugs.gnu.org \
--cc=eliz@gnu.org \
--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).