From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#57334: 28.1; Fix wdired with (dired '(dir f1 f2 ...)) Date: Tue, 23 Aug 2022 04:50:20 +0000 Message-ID: <87a67vsgtb.fsf@posteo.net> References: <878rng23aq.fsf@posteo.net> <877d30bmki.fsf@gnus.org> <875yik49ic.fsf@posteo.net> <877d3049c1.fsf@gnus.org> <87sflo2s52.fsf@posteo.net> <87k0702rwd.fsf@gnus.org> <87k0702jze.fsf@posteo.net> <87o7wc15cv.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38933"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57334@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 23 06:53:16 2022 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 1oQLue-0009vx-BS for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Aug 2022 06:53:16 +0200 Original-Received: from localhost ([::1]:43346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQLuc-00028T-PK for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Aug 2022 00:53:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQLuQ-000272-Hh for bug-gnu-emacs@gnu.org; Tue, 23 Aug 2022 00:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52488) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQLuQ-0004k7-8z for bug-gnu-emacs@gnu.org; Tue, 23 Aug 2022 00:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oQLuP-0001Xz-S0 for bug-gnu-emacs@gnu.org; Tue, 23 Aug 2022 00:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Aug 2022 04:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57334 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 57334-submit@debbugs.gnu.org id=B57334.16612303255884 (code B ref 57334); Tue, 23 Aug 2022 04:53:01 +0000 Original-Received: (at 57334) by debbugs.gnu.org; 23 Aug 2022 04:52:05 +0000 Original-Received: from localhost ([127.0.0.1]:42237 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQLtV-0001Wq-6e for submit@debbugs.gnu.org; Tue, 23 Aug 2022 00:52:05 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:41551) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQLtR-0001WJ-Qj for 57334@debbugs.gnu.org; Tue, 23 Aug 2022 00:52:04 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 62D42240103 for <57334@debbugs.gnu.org>; Tue, 23 Aug 2022 06:51:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1661230315; bh=jGqWkLSwARRFXcfXZV6A/TdxQm9MT7GaZPrU3lHfk24=; h=From:To:Cc:Subject:Date:Autocrypt:OpenPGP:From; b=aIwOQINUfGwyloOy4YhnYFmhJnnduzWD2H4mAON0jWuE+9yGIzUxteySen34h6/fG gpYwKl6LEnePVZaY5Vr2mA8NXSKovmffcWvHwA0IJ2+pGXJfQjKjYbiH6eedkHWEcb 2EQzm7RJtoUnf+xOp2KJMqWkRya1kVYzQsIShbeeByZ77r4s1natqcATlAUUHpaDTC iPbj3spE8YaD5eFEBjvxPVXaPUSXhcWxWzY7hhFiprCVmqMLXgKYp6br34emVX3bpP OgzFnfV37BG5RZPv/5msPygrdG1nASNep8Rep1ZX1vxmklmEPk8tJaClX3G6B/D25x 04i+pJyS2Ww7A== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MBcJl6k12z6tnm; Tue, 23 Aug 2022 06:51:49 +0200 (CEST) In-reply-to: <87o7wc15cv.fsf@gnus.org> Autocrypt: addr=thievol@posteo.net; prefer-encrypt=mutual; keydata= mQGNBF8ylcIBDADG+hy+zR6L4/vbdDDZuSaMmSrU3A5QZJpeBCvxTr7MpzzruZbhLPW1K3R6N2MA edi8Y+C8o27FVRIjpdbaKMGu9je7JV/TbUQYo3SOwCK1vM4LUn4V6ZLzSYkuiEt4eyMoiDdyvN0p kcK6P9x9DCetcEVszXzQg+yzCVrQ2hXWDXWT4M18EC3wtO7RHPouMqGiwBFhBAYErCqFWFxQHkfb tG/4yGyJ58rglb65O3qijjMWvYwcWZun9/7qm8Z4/4mHopmo2zgU+OrptnLSZfkZGz3Y7Uf452xQ GVq0Fv75NPvQru7y+DYVhuVXXyAmGxt+vf4rIiixMBbhKEPjcxEPAa2LTzex2IsTZR+QVG9uDnqC WcgaOEQ58fzXNvNhtwwF/Rgio2XWAJVdmFWS59/k9W58CIUSNKBMZh2XeGdEmtHvDtCxW3z6FJha 36RzOM3fMNNiAGdFZJA84gcdloJR+sHCDTTPT3784fjr+V8An7sI581NGFzkRQqPvEQCZbUAEQEA AbQSdGhpZXZvbEBwb3N0ZW8ubmV0iQHOBBMBCgA4AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheA FiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmL3HCoACgkQDsVtFB0W75OVEAv/f6XxmtIFz08fUb8h Bp/zJP6IC4/rhhh+0GMRIRzLN8DK0jV8JCzYdFHiRJOy2lNIOpmrrCmjRRxferc2G42+ePFIsslx hU46VSz1Z83NwIG3mpdYNV5WUTUdgzxExHTNTFCd7NKv0nlHKQa OpenPGP: url=https://posteo.de/keys/thievol@posteo.net.asc; preference=encrypt 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" Xref: news.gmane.io gmane.emacs.bugs:240496 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Lars Ingebrigtsen writes: > Thierry Volpiatto writes: > >>> 3 unexpected results: >>> FAILED wdired-test-bug32173-01 >>> FAILED wdired-test-bug32173-02 >>> FAILED wdired-test-bug34915 >> >> Sorry but I am not a big fan of ERT, I have no idea what these tests do. > > If you say "make wdired-tests" in the "test" directory, the output will > tell you what the problem is. (I didn't examine the output myself.) The tests succeed with following patch (avoid setting dired-directory to nil). diff --git a/lisp/wdired.el b/lisp/wdired.el index 106d57174d5..40008f186eb 100644 =2D-- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -537,15 +537,27 @@ non-nil means return old filename." (wdired-change-to-dired-mode) (if changes (progn =2D ;; If we are displaying a single file (rather than the =2D ;; contents of a directory), change dired-directory if that =2D ;; file was renamed. (This ought to be generalized to =2D ;; handle the multiple files case, but that's less trivial). =2D (when (and (stringp dired-directory) =2D (not (file-directory-p dired-directory)) =2D (null some-file-names-unchanged) =2D (=3D (length files-renamed) 1)) =2D (setq dired-directory (cdr (car files-renamed)))) + (cond (;; If we are displaying a single file (rather than the + ;; contents of a directory), change dired-directory if that + ;; file was renamed. + (and (stringp dired-directory) + (not (file-directory-p dired-directory)) + (null some-file-names-unchanged) + (=3D (length files-renamed) 1)) + (setq dired-directory (cdr (car files-renamed)))) + ;; Fix dired buffers created with + ;; (dired '(foo f1 f2 f3)). + ((and (consp dired-directory) + (cdr dired-directory) + files-renamed) + (setq dired-directory + (cons (car dired-directory) + ;; Replace in `dired-directory' files that ha= ve + ;; been modified with their new name keeping + ;; the ones that are unmodified at the same p= lace. + (cl-loop for f in (cdr dired-directory) + collect (or (assoc-default f files-r= enamed) + f)))))) ;; Re-sort the buffer. (revert-buffer) (let ((inhibit-read-only t)) =2D-=20 Thierry --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHHBAEBCgAxFiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmMEXOATHHRoaWV2b2xA cG9zdGVvLm5ldAAKCRAOxW0UHRbvk+tJC/wNxFKHEErephPSNMzIvbApj2F0UazE 92FO5J3wu3xWbWJ45qdLnAgrlWNR836kazBZeCbWhmYYEVmADmFsxIPFa7cpGY+o gTwU6iB9sS+b5vxMpFAJQ0Wujp0Y8Fu+ZKY2eiL+IXDXqVurbTHiziFWJLMhbgaS HgLApk9D1b6QvXuP0h72LerQ0NQSrlw/QmIhIrnTbwOPn2h4Vid3NWq2YjM7z+BF wbx7/u86b7xJH+7eJzMdHQbE2G0PirxBfR2jAFlRGMGyPBryry8bc6tS7yKK1yGK O9RfyGXR2r2RgZEg/HU3utkmOnkr7KtVCnjh4yKr8usoQO5j1b8lZ9j2/90Agmt/ Jy/0jiFJ1KGmdWKvJxDu91VV8Kd1dmYSUiVTgI2SdBqQbAfEM5k27PsEIa22qjSk NrzEZ1nHfyt1FaGpByK+oIn81a2y1csafa1n2SaMvd/azScTN1GDJbhRUi+hdGWe GSfFTqifK85g7Cke2Fcw/sWB35Hmr+P8Bi4= =2EIi -----END PGP SIGNATURE----- --=-=-=--