From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70593: 30.0.50; Dired: buffers of renamed dirs are broken Date: Thu, 09 May 2024 16:05:11 +0200 Message-ID: <871q6bgjxk.fsf@web.de> References: <87a5lguygb.fsf@web.de> <861q6syxzb.fsf@gnu.org> <87plu8xmb9.fsf@web.de> <87msozqes5.fsf@web.de> Reply-To: Michael Heerdegen 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="39844"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: eliz@gnu.org, drew.adams@oracle.com To: 70593@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 09 16:06:02 2024 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 1s54PK-000A95-QY for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 May 2024 16:06:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s54Ox-0007Lh-P7; Thu, 09 May 2024 10:05:39 -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 1s54Ov-0007If-NJ for bug-gnu-emacs@gnu.org; Thu, 09 May 2024 10:05:38 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s54Ov-00048Z-DV for bug-gnu-emacs@gnu.org; Thu, 09 May 2024 10:05:37 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s54PK-0003Fl-VU for bug-gnu-emacs@gnu.org; Thu, 09 May 2024 10:06: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: Thu, 09 May 2024 14:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70593 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Michael Heerdegen via "Bug reports for GNU Emacs, the Swiss army knife of text editors" X-Debbugs-Original-Cc: 70593@debbugs.gnu.org, Eli Zaretskii , Drew Adams Original-Received: via spool by 70593-submit@debbugs.gnu.org id=B70593.171526352412220 (code B ref 70593); Thu, 09 May 2024 14:06:02 +0000 Original-Received: (at 70593) by debbugs.gnu.org; 9 May 2024 14:05:24 +0000 Original-Received: from localhost ([127.0.0.1]:55444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s54Oi-0003B2-3K for submit@debbugs.gnu.org; Thu, 09 May 2024 10:05:24 -0400 Original-Received: from mout.web.de ([212.227.15.3]:51257) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s54Od-0003Ac-3k for 70593@debbugs.gnu.org; Thu, 09 May 2024 10:05:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1715263468; x=1715868268; i=michael_heerdegen@web.de; bh=ye0BiuxJob2qxNrHfvzqbiOTqpkPMfm9CpKXhJe63+Y=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=e7BMai1blpMrGpFOC4cqpUFnNP/N650ewshd0FknJ2l134TWRZX6UucWkrHbr0Q6 IBLEk27PkqXfY90Am24c7Yl//vRJ/711XKJkweZu4WLjB41dBUEcM035fDLXX1cyo wZMGpf7PmZGWdhYxlRrzhoJuqnthD64kdZe5MeHWmc5em3C911cYHSwZBAH1TedCh uuEvICHlJd26fMCVo/1PbZrzOVwSFchAAeLlR4t7x7myOEMaY/OusGD5kaBtejNVj 0Z4krNCU6X60OKzwnws8pqKteQkdWtStyM7GaMc7Lozdqs4W/CWhvlasgo5Gmn+82 evBvCvyNuyBQgNm/zw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from drachen.dragon ([84.57.248.23]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1Mmhjm-1sUo940iSk-00ZOdd; Thu, 09 May 2024 16:04:28 +0200 In-Reply-To: <87msozqes5.fsf@web.de> (Michael Heerdegen via's message of "Thu, 09 May 2024 15:46:18 +0200") X-Provags-ID: V03:K1:RBoJuJAmKCemLiaPoth5JdUnU1fWpxAOyII+PKhgy/CPLHJClEM BrKFrID6vl/wa1V9XlZilED8AtOuSwiN6Vgmur0OK6p2f3eY6up8QP7lanXlECQWF2AJwCy OKvGIOYIu5KzQJ/bG7hD1+fdy7YDnazLIAUbgq/hgTsGu3izdQM3hyqmSQJvG6b2GTrXxFZ w/7Djf+vstpugH6eK2KzA== UI-OutboundReport: notjunk:1;M01:P0:2todKgEwzDc=;YWYGtAhyT9f+shJV2W36vYZcrGF jmpOb1xudYheeEqNXgPETm+ZibLJMHEQ1ISglCKVb4+UU9MzWH2y4TIa7DaSFVhrN5fIv+4Q/ d1QJRTYx443tjUbzndPHKAK92IrS+C3MDr/sgdP+261vs/g2wdvy79vnsu7KBNFKMxJUVFgWT ikY/QUwJsW/giVjvZBw9wx37jBoQZBdirAErvyRLgmFJfIRi7gcPD7EhtMOsnTEasVO0UBRlJ MQLG+Co5gqVW13i845Q/oZhYcI6NCHmfCLHGzw0v/uLh1JFIwpZo+IMGvRZgKJ/Om0Ukev08D RTJUhSgDtp5aFMKhogrOkWlcEMKq38z/lXzZhfBnTyHh1X/q8sFazSVPitS06AzGmhudQeZbH 3KhVANupNhtIIqqNtrvlwx1QhWuEG3ZYssObqDnwyboa7s5ZGlX65DvTZTEAvDmjfC8j6+8vf 6PfVg9M2OeYFvjw/GrwfdBvvwpD4qe/ZP2yZbzCvYmxRJOWCk+fWS1TNGR9TM0P0uripS+eQU VF6clFCURufyD54GY84TCYxHIDlv1hlleL07G4V1Aj+SYRPkpjFFdtvGyE8DddC0WC237DVms zMeA7LVDI3ZLn1F/hnZ6+gswgMw8GqcVUXQwN2bEZvjQuxWhfuYCuxIkTOIGhhP24KRmsMb+F 51lbricxMYSsAiL2YCyuppvibEzzCodeIpS6J/OKoD0n+k4oCrATevFEQuXAQ8LNvgC31WIzx lEtAdCQ78zxwmQOxgTGTZhZkvwYHTNO7FGHh3ybe7P81LGVAJhZX+Tn8n36UGp+ViXpDGBiC 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:284757 Archived-At: --=-=-= Content-Type: text/plain Michael Heerdegen via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > > (1) What do we need to do we do when `dired-directory' is a cons > > (i.e. dir along with a file list)? Here is an update of the former patch doing the minimum in that case: update only the car of a consp `dired-directory' when the car is affected by the renaming, and leave the rest untouched: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-WIP-Try-to-fix-70593.patch Content-Transfer-Encoding: quoted-printable =46rom 30d1546d30a75f5ff52a7aad10063c49a5e76789 Mon Sep 17 00:00:00 2001 From: Michael Heerdegen Date: Mon, 29 Apr 2024 16:10:29 +0200 Subject: [PATCH] WIP: Try to fix #70593 =2D-- lisp/dired-aux.el | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index e340f98a551..9c7cd8aa1f4 100644 =2D-- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -2331,18 +2331,25 @@ dired-rename-subdir-1 (if (dired-in-this-tree-p (car elt) expanded-dir) ;; ELT's subdir is affected by the rename (dired-rename-subdir-2 elt dir to))) - (if (equal dir default-directory) + (if (string=3D dir (expand-file-name default-directory)) ;; if top level directory was renamed, lots of things have to be ;; updated: (progn (dired-unadvertise dir) ; we no longer dired DIR... - (setq default-directory to - dired-directory (expand-file-name;; this is correct - ;; with and without wildcards - (file-name-nondirectory (if (stringp dired-directory) - dired-direct= ory - (car dired-dir= ectory))) - to)) + (let* ((dired-dir (if (stringp dired-directory) + dired-directory + (car dired-directory))) + (dired-dir-new + (abbreviate-file-name + (file-name-as-directory + (expand-file-name ;; this is correct + ;; with and without wildcards + (file-name-nondirectory dired-dir) + to))))) + (if (stringp dired-directory) + (setq dired-directory dired-dir-new) + (setcar dired-directory dired-dir-new)) + (setq default-directory dired-dir-new)) (let ((new-name (file-name-nondirectory (directory-file-name (if (stringp dired-directory) dired-directory =2D- 2.39.2 --=-=-= Content-Type: text/plain Michael. --=-=-=--