From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#65143: dired-aux-tests and kmacro-tests failures on master Date: Tue, 08 Aug 2023 17:42:53 +0800 Message-ID: <87leelzx7m.fsf@yahoo.com> References: <34C2C701-56AF-4132-A005-BEFDAB30F041@gmail.com> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16231"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 65143@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 08 11:44:15 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 1qTJG9-0003zk-6b for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Aug 2023 11:44:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qTJG1-0005MO-5D; Tue, 08 Aug 2023 05:44:05 -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 1qTJFy-0005Lq-QK for bug-gnu-emacs@gnu.org; Tue, 08 Aug 2023 05:44:02 -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 1qTJFy-000250-IC for bug-gnu-emacs@gnu.org; Tue, 08 Aug 2023 05:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qTJFy-0005Ol-DE for bug-gnu-emacs@gnu.org; Tue, 08 Aug 2023 05:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Aug 2023 09:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65143 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: Emacs Bug Report Original-Received: via spool by submit@debbugs.gnu.org id=B.169148780020695 (code B ref -1); Tue, 08 Aug 2023 09:44:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Aug 2023 09:43:20 +0000 Original-Received: from localhost ([127.0.0.1]:35222 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTJFH-0005Ni-Sg for submit@debbugs.gnu.org; Tue, 08 Aug 2023 05:43:20 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:44006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTJFF-0005NQ-Cb for submit@debbugs.gnu.org; Tue, 08 Aug 2023 05:43:18 -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 1qTJF5-00056T-W8 for bug-gnu-emacs@gnu.org; Tue, 08 Aug 2023 05:43:08 -0400 Original-Received: from sonic302-21.consmr.mail.ne1.yahoo.com ([66.163.186.147]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qTJF3-0001tx-Lo for bug-gnu-emacs@gnu.org; Tue, 08 Aug 2023 05:43:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1691487783; bh=RdV2OYjSZM2zXrVKXroMWbcqCGlhCQZWG62rwqCjjZ4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=M9VORGAIlEKCl3c4CEH6gqeAQU1n7/L3yvXfa3XrsggvjuKm/xHM8gGE8eEZiFqH9Zx7TVkSX5XYz3aa5u2hXSMkAvatOXklYpq6WAHIAGScsXANkGpOVBMVlwBB7jxNZhRCcTsGDVY51qwZi0Wij2H5OuPB3bRmdqDT0acaEB13BmL59rXSQPw4i9XzzEHnFiYMSphUozv7cBsyqcEmqvfi7x1b3soQMJiquQARwP+KbJ8IuFpoA1/CxJ9XJDfh0CbBeBWVvfv7DB8EJ8y2VieyDxWQgMpM2LVQBz6l39wgAbeMLHomi7m1b9hzBu47uEhNRIYRKvrKmXhsiBSfpA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1691487783; bh=7EsAPdH6bZKx58JXKVFrhgyPiTmSgi/7uOW1WUDO83l=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=OpLbcLECk6pFekg91iYvwX83k+PYD9Jogic2yCBI9+kcp4bZGlTWYiJfO2zAlxk/OfvX3oEVS5vJhdBwMvsut6jmSvL8LSvsiEIe5peEBuELk/9OX7IVGeyZs/xL0JFzHsqQLAchquJPsMSagDyF1QDQ8a4WEt/FUPWqR5JOruY9MzOa/NcFerrwlv0wtcMh5pXbmCNvR3eW2Q6RRhzQgZOfqFpA5JZNKKm8eKfWZc8Hua7yXSfXEfN4wABCI/pgMcHoUtUUclwKv57/oLQytzNosVNE4ufCZ1geew/5i55U9JZv2Wr69N0FenrMog0LBEHgAcPNBeRHrUnoVuIPlw== X-YMail-OSG: C1NnDRgVM1mvq9Cogd4eCDZMUVIZ_nn.RdwlL.tbo4x4b2kIL5CQOI.ehjdusIr ABpF8kCBmcD_5USr7TX7JzYk_RhtaNbPFe0E9XoIgY5Qshc3HklxwStnKJtGL6VetBPolOFwdYbn RDF1XM.f.noTF2nNmWaZXmS2FP74g1jeghPHbvGHq28QM3Z9PKkHlnO7pcpRqNnGqvcRU3aCfOEU mUylflaBn3xo5snAplnje7vWt53jM3ClZVT5U9pG42MtfC1LklCKS7NMLQyrvxpYOdSMeGl7O4Vq VS2QPXGMf_JfxLW.9ExTsQu0VbcYzs.imiGRdHllZDjrDfU6.uYuFQztCrFsW_VcNEMPtuJcr2zt fCMAYQVGZfwIM9Cf8vlp2XOPXoQxDrmo4QvFszIsNTlFu0BqlCBocwjMi1HefBYistaxrZxyzp9f EsmTJFZpdOjH79L5Sal.FX0o6hGsqE6_LIDY5TyI.FlqLQ5haMNcI48MJDvmA4jbFQoW9H4UlAtZ trW4nq9L5GhiToYnv3j1B1Hogx5AXScMDoUaK4NUgUbsdXjUBA35_Dun4WMf3p0oRnLefSPmhPdE 4tNaq.lmkMHqGmzI_lkmruVwZ2cvQC4zG_XulWWoQZ1pZCHjGkbuCqpnMs4RqKAowBMp52MgCZcW jGXVJSchaxnLT7.sbXnUWGHG4Gq4Wucn_O67GNHnEm6TGYo6XDHgYS5Ly_PTn2uX7d8m853sDdDM fvw5EW9jF3sqqS9YhstX5aBI3PpthFhe_YnasO0B6WG0nMbNEq03Tv8GInO5q.Xi0WNtOiY_kKw3 u5Yr6ft5tBvP26GQhsCBYpKM1dF0eFU8P5jX11X3Qx X-Sonic-MF: X-Sonic-ID: 9389fd29-41f4-4aa8-82e5-ca4d9e251013 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.ne1.yahoo.com with HTTP; Tue, 8 Aug 2023 09:43:03 +0000 Original-Received: by hermes--production-sg3-69654d8bd-52vxq (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID d61adc52be21ebd16f031fb88a3db40d; Tue, 08 Aug 2023 09:43:00 +0000 (UTC) In-Reply-To: <34C2C701-56AF-4132-A005-BEFDAB30F041@gmail.com> ("Mattias =?UTF-8?Q?Engdeg=C3=A5rd?="'s message of "Tue, 8 Aug 2023 11:26:38 +0200") X-Mailer: WebService/1.1.21695 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.186.147; envelope-from=luangruo@yahoo.com; helo=sonic302-21.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:266929 Archived-At: Mattias Engdeg=C3=A5rd writes: > Currently (eeda9eff1a) on master: > > FAILED dired-test-bug30624 > FAILED kmacro-tests-step-edit-append > FAILED kmacro-tests-step-edit-replace > > from dired-aux-tests and macro-tests respectively. > > Most likely suspects are the recent Android merge and the unprompted dele= te-file changes, but I really have no idea. Does this change fix the Dired test? I suspect the test itself is wrong; the doc string of dired-do-create-files mentions nothing about its return value, which the test asserts against: (dired-mark-files-regexp "bug30624_file") (should (dired-do-create-files 'copy 'dired-copy-file "Copy" ni= l))) <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (delete-directory target-dir 'recursive) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 3e8b4c3c8fc..825e25c09ed 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -2480,87 +2480,88 @@ dired-do-create-files =20 For any other return value, TARGET is treated as a directory." (or op1 (setq op1 operation)) - (let* ((fn-list (dired-get-marked-files nil arg nil nil t)) - (rfn-list (mapcar #'dired-make-relative fn-list)) - (dired-one-file ; fluid variable inside dired-create-files - (and (consp fn-list) (null (cdr fn-list)) (car fn-list))) - (target-dir (dired-dwim-target-directory)) - (default (and dired-one-file - (not dired-dwim-target) ; Bug#25609 - (expand-file-name (file-name-nondirectory (car fn-list)) - target-dir))) - (defaults (dired-dwim-target-defaults fn-list target-dir)) - (target (expand-file-name ; fluid variable inside dired-create-files - (minibuffer-with-setup-hook - (lambda () - (setq-local minibuffer-default-add-function nil) - (setq minibuffer-default defaults)) - (dired-mark-read-file-name - (format "%s %%s %s: " - (if dired-one-file op1 operation) - (if (memq op-symbol '(symlink hardlink)) - ;; Linking operations create links - ;; from the prompted file name; the - ;; other operations copy (etc) to the - ;; prompted file name. - "from" "to")) - target-dir op-symbol arg rfn-list default)))) - (into-dir - (progn - (when - (or - (not dired-one-file) - (and dired-create-destination-dirs-on-trailing-dirsep - (directory-name-p target))) - (dired-maybe-create-dirs target)) - (cond ((null how-to) - ;; Allow users to change the letter case of - ;; a directory on a case-insensitive - ;; filesystem. If we don't test these - ;; conditions up front, file-directory-p - ;; below will return t on a case-insensitive - ;; filesystem, and Emacs will try to move - ;; foo -> foo/foo, which fails. - (if (and (file-name-case-insensitive-p (car fn-list)) - (eq op-symbol 'move) - dired-one-file - (string=3D (downcase - (expand-file-name (car fn-list))) - (downcase - (expand-file-name target))) - (not (string=3D - (file-name-nondirectory (car fn-list)) - (file-name-nondirectory target)))) - nil - (file-directory-p target))) - ((eq how-to t) nil) - (t (funcall how-to target)))))) - (if (and (consp into-dir) (functionp (car into-dir))) - (apply (car into-dir) operation rfn-list fn-list target (cdr into-dir)) - (if (not (or dired-one-file into-dir)) - (error "Marked %s: target must be a directory: %s" operation target)) - (if (and (not (file-directory-p (car fn-list))) - (not (file-directory-p target)) - (directory-name-p target)) - (error "%s: Target directory does not exist: %s" operation targe= t)) - ;; rename-file bombs when moving directories unless we do this: - (or into-dir (setq target (directory-file-name target))) - (prog1 - (dired-create-files - file-creator operation fn-list - (if into-dir ; target is a directory - ;; This function uses fluid variable target when called - ;; inside dired-create-files: - (lambda (from) - (expand-file-name (file-name-nondirectory from) target)) - (lambda (_from) target)) - marker-char) - (when (or (eq dired-do-revert-buffer t) - (and (functionp dired-do-revert-buffer) - (funcall dired-do-revert-buffer target))) - (dired-fun-in-all-buffers (file-name-directory target) nil - #'revert-buffer))))) - (dired-post-do-command)) + (prog1 + (let* ((fn-list (dired-get-marked-files nil arg nil nil t)) + (rfn-list (mapcar #'dired-make-relative fn-list)) + (dired-one-file ; fluid variable inside dired-create-files + (and (consp fn-list) (null (cdr fn-list)) (car fn-list))) + (target-dir (dired-dwim-target-directory)) + (default (and dired-one-file + (not dired-dwim-target) ; Bug#25609 + (expand-file-name (file-name-nondirectory (car fn-list)) + target-dir))) + (defaults (dired-dwim-target-defaults fn-list target-dir)) + (target (expand-file-name ; fluid variable inside dired-create-files + (minibuffer-with-setup-hook + (lambda () + (setq-local minibuffer-default-add-function ni= l) + (setq minibuffer-default defaults)) + (dired-mark-read-file-name + (format "%s %%s %s: " + (if dired-one-file op1 operation) + (if (memq op-symbol '(symlink hardlink)) + ;; Linking operations create links + ;; from the prompted file name; the + ;; other operations copy (etc) to the + ;; prompted file name. + "from" "to")) + target-dir op-symbol arg rfn-list default)))) + (into-dir + (progn + (when + (or + (not dired-one-file) + (and dired-create-destination-dirs-on-trailing-dirsep + (directory-name-p target))) + (dired-maybe-create-dirs target)) + (cond ((null how-to) + ;; Allow users to change the letter case of + ;; a directory on a case-insensitive + ;; filesystem. If we don't test these + ;; conditions up front, file-directory-p + ;; below will return t on a case-insensitive + ;; filesystem, and Emacs will try to move + ;; foo -> foo/foo, which fails. + (if (and (file-name-case-insensitive-p (car fn-list)) + (eq op-symbol 'move) + dired-one-file + (string=3D (downcase + (expand-file-name (car fn-list))) + (downcase + (expand-file-name target))) + (not (string=3D + (file-name-nondirectory (car fn-list)) + (file-name-nondirectory target)))) + nil + (file-directory-p target))) + ((eq how-to t) nil) + (t (funcall how-to target)))))) + (if (and (consp into-dir) (functionp (car into-dir))) + (apply (car into-dir) operation rfn-list fn-list target (cdr into-dir= )) + (if (not (or dired-one-file into-dir)) + (error "Marked %s: target must be a directory: %s" operation target= )) + (if (and (not (file-directory-p (car fn-list))) + (not (file-directory-p target)) + (directory-name-p target)) + (error "%s: Target directory does not exist: %s" operation t= arget)) + ;; rename-file bombs when moving directories unless we do this: + (or into-dir (setq target (directory-file-name target))) + (prog1 + (dired-create-files + file-creator operation fn-list + (if into-dir ; target is a directory + ;; This function uses fluid variable target when called + ;; inside dired-create-files: + (lambda (from) + (expand-file-name (file-name-nondirectory from) target)) + (lambda (_from) target)) + marker-char) + (when (or (eq dired-do-revert-buffer t) + (and (functionp dired-do-revert-buffer) + (funcall dired-do-revert-buffer target))) + (dired-fun-in-all-buffers (file-name-directory target) nil + #'revert-buffer))))) + (dired-post-do-command))) =20 ;; Read arguments for a marked-files command that wants a file name, ;; perhaps popping up the list of marked files.