From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#63676: cancelling editable dired causes UI problems with dired Date: Sat, 27 May 2023 02:55:56 +0200 Message-ID: <87jzwupp7n.fsf@web.de> 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="32811"; 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 Sat May 27 02:57:40 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 1q2iFY-0008LW-4e for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 May 2023 02:57:40 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2iF8-0006hY-5f; Fri, 26 May 2023 20:57:14 -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 1q2iF6-0006hM-Gy for bug-gnu-emacs@gnu.org; Fri, 26 May 2023 20:57:13 -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 1q2iEw-0002bZ-6v for bug-gnu-emacs@gnu.org; Fri, 26 May 2023 20:57:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q2iEw-0003z7-3r for bug-gnu-emacs@gnu.org; Fri, 26 May 2023 20:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 May 2023 00:57: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.168514896915162 (code B ref 63676); Sat, 27 May 2023 00:57:02 +0000 Original-Received: (at 63676) by debbugs.gnu.org; 27 May 2023 00:56:09 +0000 Original-Received: from localhost ([127.0.0.1]:51073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2iE4-0003wQ-NQ for submit@debbugs.gnu.org; Fri, 26 May 2023 20:56:09 -0400 Original-Received: from mout.web.de ([217.72.192.78]:41363) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2iE0-0003un-OI for 63676@debbugs.gnu.org; Fri, 26 May 2023 20:56:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1685148957; i=michael_heerdegen@web.de; bh=0wFjr8zPPqXd8YAEKfbAKtxO9VxypN7jNIku0SkAwZY=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=eh5DBTtbL9LNC9XOoXybH5gV2yqYoOYDs2lzOM7lSEUDsrh34b1freYE4TbfK4/qn DHpks49kBMUc8tg0ofRoXtE7T20bKLZ2EXr+DvqROJt7K9JsazOAqo7sJNt7IsScNR NKh7qInEs/3cDW4/9kJGh3whyRR0d6m8eAs6pvOrjnry2wl96XamsiLuImBSSAak4N B+L+Hlj8VKXFLBHpm9GC9benuwULSF3Byt0MKNPlh6hCWg4+FZ2GayZLKvntghAYxN 6PPZtswHG3KRq26aOZV7/wjINkWE4Di0yqDAbUS8kL4rg8729++T+q9SD6AJ2qPl4O VhnuZiLrTR0WA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from drachen.dragon ([178.14.74.62]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MPKFD-1pjejI2bef-00Peqn; Sat, 27 May 2023 02:55:57 +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:F+A20dK6R3t8ua+a6bz9BqXS/7oOFrbvbT3fZGiBL9GXpIxgow6 HhSq8/mkqtSdCE3hIrakZV5/hOMvF+hRs1mwOXRMK4+HzTD96NMeyWktxe7TSQ6Uv4mnxPd Le2Uvwsw4mB1CdMvCnXEUP0AjGRUfS3Zv7f9YljD58jVTrfeeFNKl5D/zoj/DY/sYOovKIJ 3EgkLsx/xSy1bp2v5zCKQ== UI-OutboundReport: notjunk:1;M01:P0:u1ibUitWbsk=;VFGuMkJcLcxpqmO6sZxGguGiyiz 9GAlinbAjkahnkdLFleVgjB0VmvfMdqyvpVgKYxzx6fpiUO8iR+ynPhRC+Bsdcgrrt0g4KDuD tKRChCgfrbPTqQ77Livsm9tgloAvtZpfxeIoCT/ktUcxTTKaUCVwdbOtkFpvlYhDJ894zNSTb ixAt8fHVR00d/5ODCZBfZAjDUdUk1QEdZ/z+q7feTLByp/nlkP4WiCnU8fmkH+svrLoD2Hqct gRcFfdwWt1TH9ZX/fry9YStgTR+ESGFzrR9/+YwYqy07kV6EgNGdf0h3NwJKXCcG5rP4lL2YC V6Du9NaOBIybtOWLrKHQOackZkYfFvXf0WxcpR6BaH/zw+t6BmVMw8qmrE3G0QAvGFdQ3HrD0 jfpmOAnPmlYvQkw7HakWypsYXR0O+Z645eCUWPDZscQF10q4fvLH4bP1d6p5DxJr0m88PHItL Q+HJJWU0UJaFdLQzVFbwu6/oor1R3fdjKSxJlN4fB8WBcWofj4w7fpxm5o7rOXEyqKa0m73ba kVppJXHUnkCL1zmNqNHZvEMSlj6A2cqk9ZxXcypN3tfNINLLw9EPH5p7ChWjxXaEYHq0j4G7Z T+wZOOO4R4KnYwixnH93PM+2taV409M/JY+3Lz6UrIkFdOxSzIEoodPjF81f7q2vlhsf4g5V7 AS68mY0ihd5AYfUZhgVtcCXJIS60SufyLKWFGfSDvohJx5A3dE/3hhFNvnlNJmoEQRy3tQb1A 9+fZ1Ddg+NWb7iOLy90bCK+Jt1VOZ8Uxso/KGAyp43kO/Rpl6x8uwqIxclPNQAFqtYYqMWze 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:262454 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > 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 think this should be appropriate: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-Fix-cancellation-of-Wdired.patch Content-Transfer-Encoding: quoted-printable =46rom 59a7929f5e7653be1baa72208e2b89ef452962ea Mon Sep 17 00:00:00 2001 From: Michael Heerdegen Date: Sat, 27 May 2023 02:26:09 +0200 Subject: [PATCH] Fix "Fix cancellation of Wdired" * lisp/wdired.el (wdired-abort-changes): Call `dired-build-subdir-alist' instead of `dired-revert'. =2D-- lisp/wdired.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lisp/wdired.el b/lisp/wdired.el index 70e908b3a38..e6a7ca1841d 100644 =2D-- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -473,9 +473,8 @@ wdired-abort-changes (insert wdired--old-content) (goto-char wdired--old-point)) (wdired-change-to-dired-mode) - ;; Make sure the display is in synch, and all the variables are set - ;; correctly. - (dired-revert) + ;; Update markers in `dired-subdir-alist' + (dired-build-subdir-alist) (set-buffer-modified-p nil) (setq buffer-undo-list nil) (message "Changes aborted")) =2D- 2.30.2 --=-=-= Content-Type: text/plain 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. 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. Michael. --=-=-=--