From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: dired cons bug? Date: Thu, 11 Aug 2022 16:30:56 +0300 Message-ID: <83mtcaq54f.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39137"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 11 15:32:15 2022 Return-path: Envelope-to: geh-help-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 1oM8II-000A0h-LF for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 11 Aug 2022 15:32:14 +0200 Original-Received: from localhost ([::1]:54802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM8IH-0008VR-KR for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 11 Aug 2022 09:32:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM8HA-0008Sj-ID for help-gnu-emacs@gnu.org; Thu, 11 Aug 2022 09:31:07 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52180) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM8H8-00069Q-Jp for help-gnu-emacs@gnu.org; Thu, 11 Aug 2022 09:31:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=kDvTRuW6WaPfRMmQ+UuyvSF5gN3HbIgHs2eKq0kIewg=; b=qxOdd6c16Gln WWAtgvSGl4AsXU2frbB+MVSolyma5IL4qcpfNSDp+xPhHKWWNek7t43Y9k1eTzO3fJKkzO0j67Knh Atk1BlUh5QVkA5zDhVGOJ+uETESIM3j3yy1sbbVoRh20VNh5YsLYVnh1kjoZpPZntBF94IDuXfo0B A72M2z2DzuQxLySiFDA84EAreBNvyzeH4aRth0yAAeI/CzCReIT14lXvVSYdIks77Aknbw69UNL/D Zs+aQkMlCxGJyALYxakWiOUaGtPSf5lLZafW19v5tLlqddmXN4WNWSZA7fkpm28RmYpaXzS57xu/O FYbXydfbGi21ezhqky+v8w==; Original-Received: from [87.69.77.57] (port=4061 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM8H7-0004e2-G3 for help-gnu-emacs@gnu.org; Thu, 11 Aug 2022 09:31:02 -0400 In-Reply-To: (message from Harald Judt on Wed, 10 Aug 2022 13:26:25 +0200) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:138800 Archived-At: > Date: Wed, 10 Aug 2022 13:26:25 +0200 > From: Harald Judt > > I have a question regarding using dired programmatically in Emacs 28.1. Say I > do the following call to open a dired buffer and insert the files: > > (dired (cons "/home/user" '("/home/user/tmp/test/a/a" > "/home/user/tmp/test/b/b" "/home/user/tmp/test/c/c"))) > > It works fine, I get a nice listing and can move around like expected, mark > files and try to delete them. Now it gets interesting: Usually after hitting > "x" to execute, then confirming the deletion, the buffer will refresh. But not > in this case, not when I open dired using the cons above. I can revert the > buffer using "g". > > Note that when I simply do (dired "/home/user/tmp/test"), then insert the > subdir to show the files and delete them, this is not reproducible. The buffer > will be refreshed immediately after the delete operation completes. > > Why? Am I missing something? Is this a (known) bug or expected behaviour? I've > tried with emacs -Q, so it seems to be no configuration problem. I think it's a bug. Please see if the patch below gives good results. diff --git a/lisp/dired.el b/lisp/dired.el index f261f9f..f7651c6 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3674,7 +3674,10 @@ dired-internal-do-deletions (progress-reporter-update progress-reporter succ) (dired-fun-in-all-buffers (file-name-directory fn) (file-name-nondirectory fn) - #'dired-delete-entry fn)) + #'dired-delete-entry fn) + ;; For when FN's directory name is different + ;; from the current buffer's dired-directory. + (dired-delete-entry fn)) (quit (throw '--delete-cancel (message "OK, canceled"))) (error ;; catch errors from failed deletions (dired-log "%s: %s\n" (car err) (error-message-string err))