From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#63676: cancelling editable dired causes UI problems with dired Date: Wed, 24 May 2023 14:09:18 +0200 Message-ID: <87o7ma3p8x.fsf@gmx.net> References: <83ilcing54.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38884"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Peter Mao , 63676@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 24 14:10:19 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q1nJr-0009xy-Ji for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 May 2023 14:10:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1nJc-00079f-My; Wed, 24 May 2023 08:10:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1nJa-000793-QG for bug-gnu-emacs@gnu.org; Wed, 24 May 2023 08:10:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1nJa-0005en-HI for bug-gnu-emacs@gnu.org; Wed, 24 May 2023 08:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q1nJa-0002hN-B0 for bug-gnu-emacs@gnu.org; Wed, 24 May 2023 08:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 May 2023 12:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63676 X-GNU-PR-Package: emacs Original-Received: via spool by 63676-submit@debbugs.gnu.org id=B63676.168493018010337 (code B ref 63676); Wed, 24 May 2023 12:10:02 +0000 Original-Received: (at 63676) by debbugs.gnu.org; 24 May 2023 12:09:40 +0000 Original-Received: from localhost ([127.0.0.1]:42433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1nJE-0002gf-Fl for submit@debbugs.gnu.org; Wed, 24 May 2023 08:09:40 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:60235) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1nJB-0002gO-Ck for 63676@debbugs.gnu.org; Wed, 24 May 2023 08:09:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1684930171; i=stephen.berman@gmx.net; bh=YkZ7O6sSLJVZkQu5KCT5f8/ilhIbs0rLPkFufQmcWLY=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=Kk5/kYCEZLPRO6Tv6ETvE1hD6zUAtbKHeXOWYw4KDbwDUhNFTmi3s9L4Ysf9iEeHD Oq4FjwWATvSrZ1w5CFu34dlHu+ZZeEtiyVhcf6IT4iu7G1DnY0LHS3ZKeZrrTRO3M5 3I0pbreyM5KPCKKR4RrujUMzoW/7EBrc3CFYYQzcSseG6trPmmhqVrKCGjH2nzAfUx QzSTlZkUCcftqmdhd996oB/cKIxy/DoUjzbVIhiWTuWSuiWPp5UC0EvtUxMDgkSryj alzN3ZanFvzc4lrd6LAtY/eygsUpV6wKStJsF7mSUnEQkzDl0m5QA0rZjaVUb9lblP 9fOVe5JB5r3ow== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfssd ([89.246.36.62]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MXp5a-1pcMWF0E16-00YA0X; Wed, 24 May 2023 14:09:31 +0200 In-Reply-To: <83ilcing54.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 24 May 2023 14:05:43 +0300") X-Provags-ID: V03:K1:kNKvQayWxZrhEnhhtLtBPfmMZW/DU9I2BGk2E1gi1uuwGleqsgj fxiIjG33f8HoCmxAfOSxaIe4pxWAr/hSKfnmkHSgOfKRcZNu9kwNaW7meoLJpvyqvssbLGa Rc84duH07o48sUwbn84ti5GeluC8tdSDcYM/qg1cT43jDanaeO1Nrmhhdp7d3g59KvdhzUH pRE8X4MC3eb5JW8JNvE/A== UI-OutboundReport: notjunk:1;M01:P0:mOehWfb7G5Y=;AXJL5Pje3lNlx4k4nyLlEhLZakg 2BRBSLzdonsVFQlMdg/Jsa9Bee4pP8VTqgzKdoEXLGD7Q55nYvAIiqspC1Qc0D9lLxzGZwopl sN9Y9+7HKbMxlSsXIJJtEASvUO1AYucbojYPLu7WOg9zZbbEZyZ5mX2YYgqNAMv/BN22QTt2u 0OUy0Io2TPAi22rdJkUrxiIYl3LejspLzWSmYOsxuKFgCeaUrevsAks0lx0btu+issBRpErGm 5oZustJtd1FcRqSKLvPwX6UqDeIyByEHMpTod6EZ22jXXRa386k2cA3em41uese+escAGwzhA +s5Cuw4b5ZDdLZF/W3t+9+fKKc7ElnBXXmIj5KCFxsQ1KdVflDOiIy7UQSZJH8v0aZ4J3l9Oz LuOkkNquL+VwnS5flEc9nARQdNbLw3Bv1PDDoZTg3jdt2ctQ56ExtgzAnk/RBneK7tZ4Rc/aF SXc9EVThOLtre++rEKCe7bSLqN3Tb4NvWs1Qu6pk9PlU8nlLVEXDowD22W9T3PoqWaTvhPCIS FQ4LSFFy9p7wFfY1YX2QJPblpr9wbQylYHz2Oztl88Y7jIz8KzuPN4J1vJMtlr4Snqu1lhL3U i9Ya56HzPSTr0IWtYKrcFX2MNi0ULVWaN/XF2SMAIPetwQo7SO0G2BoTYDPQH0VfjxrvfnKG+ 0HBsZESZ3yxTUe5yiD8RvrkoNW2J4JQThxJ2rYLLuG96jSNqSTcZcYD1s61cA8Ije0TXQcE7p z/8fl2g7bfuasSOKXaZ1MjePjocJOVywUo5VheE9glZRQaYyQc6dknYAXGLBGPqJDFBiTlry X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262292 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 24 May 2023 14:05:43 +0300 Eli Zaretskii wrote: >> From: Peter Mao >> 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+ Vers= ion >> 3.24.33, cairo >> version 1.16.0) of 2023-05-15 >> >> Dired behavior has multiple problems if subdirectories are present in t= he >> 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 remove= d >> 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 --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-Description: wdired-abort-changes patch 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")) --=-=-=--