From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel =?UTF-8?Q?Mart=C3=ADn?= via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#49554: 28.0.50; [PATCH] dired-number-of-marked-files doesn't work correctly when there are no marked files Date: Tue, 13 Jul 2021 22:30:00 +0200 Message-ID: References: Reply-To: Daniel =?UTF-8?Q?Mart=C3=ADn?= 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="34048"; mail-complaints-to="usenet@ciao.gmane.io" To: 49554@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 13 22:31:10 2021 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 1m3P3e-0008ef-IB for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Jul 2021 22:31:10 +0200 Original-Received: from localhost ([::1]:50374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3P3c-0003Ec-M8 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Jul 2021 16:31:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3P3W-0003EQ-41 for bug-gnu-emacs@gnu.org; Tue, 13 Jul 2021 16:31:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58824) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3P3V-0007AS-Sd for bug-gnu-emacs@gnu.org; Tue, 13 Jul 2021 16:31:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m3P3V-00046d-Pd for bug-gnu-emacs@gnu.org; Tue, 13 Jul 2021 16:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Jul 2021 20:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49554 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.162620821615726 (code B ref -1); Tue, 13 Jul 2021 20:31:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Jul 2021 20:30:16 +0000 Original-Received: from localhost ([127.0.0.1]:42137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3P2m-00045a-Fa for submit@debbugs.gnu.org; Tue, 13 Jul 2021 16:30:16 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:37864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3P2k-00045S-K3 for submit@debbugs.gnu.org; Tue, 13 Jul 2021 16:30:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3P2j-00036h-Mn for bug-gnu-emacs@gnu.org; Tue, 13 Jul 2021 16:30:14 -0400 Original-Received: from sonic307-2.consmr.mail.bf2.yahoo.com ([74.6.134.41]:39414) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3P2g-0006MN-E2 for bug-gnu-emacs@gnu.org; Tue, 13 Jul 2021 16:30:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1626208208; bh=zSaRsWphP01y/HuAM5ySQavbTLl7mUyVN7xdFVFXIMY=; h=From:To:Subject:Date:References:From:Subject:Reply-To; b=Ylqxpjf9lGTYpsF8hQ294FhVm6IMUGYPIT/AI797lkoPZ+0QLRsHXgonisfP16fRYMOEYsyHHRnmFrswgnjZ4vTrQ69CclYzfk9vFo8ID+vg0iplo451iZ69pQ2JHXQTMw58D4L8m0exEsj8igVy17qWLZOdq5x+LXInW1L6kSFimOWVjM4bvcLFSsknc3fGjCoPxOXAdd1AMHWmcyAGU3/uhE6BKKSYzJ+L5OAVm0N8r9AClPlOhgvFNhJgceQ1MbO4XQ2tTf4iVjH2TIuZaFpkua2tylVZV7ufWESnAwSEPUjeh0XczSv7quNewLoZHj/3/RBHWfxOwdoqrNgwDw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1626208208; bh=3hmQzXwqqXtsgqL9SwJWWEkF8ETyddyFWM2WzgcmWBk=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=KQUeNalMWM1iSRpR5hJ3WNlhHj/rSCUkUy7BDUthM0o+aaq6EcGYmFI/6be29fkd8KYPMsTEsAk0D5AtoyMNUP8cycC5HNrtwO7X5vj0EVBcET8w2JOLL76GAljWCxgWSIGm0TC/jBHrDv+mbH4doME3KPUmEOek6DiW9axHLNoWLjIBfeMLNBYoXdHVXb0R0LQeYF7O4UXFnTNXiWlCT4ykHn463fKqbHv9L0izwNuGasBvo6S6H3BziHJSDol9e3o+VM1yq9NI3yt01ZwnPKw9oXSVWG1Vn3ZxCTQnL0aLeWsyD0s4/yEEze7ywNPvzL5iy/e6xWFQLvwUrlcTEA== X-YMail-OSG: l7B5z94VM1nkCjuG_3j7F2kiGuhK3zgEfAwj_I7.6K57kG7UoehhGW15ZQUuX_X ZHdcbX3tFAPl7IihNcWAVnmPIMoTsdGTdOZ7d31Tvaqf2A4b3yrvw5B6pjoBDVjqINl.6HXr2jxS S.tamUnMXC.TRKynyWx8oK5LHItI1aFj_DC4MaFQ5fIw8Tn5ncfXY0QWrNkj0yevoWqOSnhqrMOe mofo2NfA3ANvVjnv_dXc.AB45i.044_s4.QgwFuirZOFiU5jwlO12losrKAz6TOCcuUNmL3IKavz ncXjSPdFqmFNGOV4KXAv4NZcAPQpeFii32O2H8KJJCvgjSMxV4G7p4Tj_GLAfwKRurFXjwrGOydI ezb96X3JcJP5A0CBq0xz_8V1i73tBRsNlVG0x9W9rpiR5PAJrmQDy5sbZQeO2bvCT_FPyHkJIxM2 PSRugrU_JJKODllO67NPivjQ0B0Ru6lJKkrU8_pfLbH1lXV5QhQ_gZ9fqpn9dARSbFSP5_29bbk7 uGfrRJ7E5uwBsgKH8zaiWyAbOZo08zGG6ItSM4R2SZIfthzIR2GWIau9sNnYQFoYr8b2CAZ1L0Hz j2u_2VKhl9ttrLNIV1ssLLe5NEt4e7FkUU4BvhJuxntlUDIS4BV0mnckZaB_n_eB_qXOKcC_u6WA Eri4D7X4Lso4sBj0uxsQEzPPH8Tlh9y1vUOeT24b.egnpHCUrwLCW932N6Bdo9cSQOLe77NtpZo7 FX6yPwB23I_Mjhr1CP_k4gSsG9H.GM8LloyUG.8421sS8an68c5Q_kCLAnVoViZljY.1pC0qtHeO ShZhPzA65PXLXVZYdb32XMMRehnbugOByce_qJF41n X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.bf2.yahoo.com with HTTP; Tue, 13 Jul 2021 20:30:08 +0000 Original-Received: by kubenode525.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 969ca312a512adb55a94fcd7e4d337ff; Tue, 13 Jul 2021 20:30:02 +0000 (UTC) X-Mailer: WebService/1.1.18469 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=74.6.134.41; envelope-from=mardani29@yahoo.es; helo=sonic307-2.consmr.mail.bf2.yahoo.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, 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" Xref: news.gmane.io gmane.emacs.bugs:209877 Archived-At: --=-=-= Content-Type: text/plain Steps to reproduce the problem: emacs -Q Open a directory with files in Dired. * N Actual results: The echo area shows "0 files marked (total size XX)". After reading the source code, I think it should only show "No marked files", but there's a syntax mistake in an if expression. I've attached a patch to correct the problem. Thanks. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-dired-number-of-marked-files-when-there-are-no-m.patch >From f31d307582c4a1350dc0572b651ee3faeb2d66c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= Date: Tue, 13 Jul 2021 22:09:43 +0200 Subject: [PATCH] Fix dired-number-of-marked-files when there are no marked files * lisp/dired.el (dired-number-of-marked-files): Fix if expression so that the else part is evaluated correctly. --- lisp/dired.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lisp/dired.el b/lisp/dired.el index fb353a92e4..7f24f752f7 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3836,13 +3836,13 @@ dired-number-of-marked-files when (stringp file) sum (file-attribute-size (file-attributes file))))) (if (zerop nmarked) - (message "No marked files")) - (message "%d marked file%s (%s total size)" - nmarked - (if (= nmarked 1) - "" - "s") - (funcall byte-count-to-string-function size)))) + (message "No marked files") + (message "%d marked file%s (%s total size)" + nmarked + (if (= nmarked 1) + "" + "s") + (funcall byte-count-to-string-function size))))) (defun dired-mark-files-containing-regexp (regexp &optional marker-char) "Mark all files with contents containing REGEXP for use in later commands. -- 2.31.0 --=-=-=--