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.bugs Subject: bug#46325: 27.1; C-d in an rmail summary does not work on the first message Date: Fri, 05 Feb 2021 15:17:44 +0200 Message-ID: <83ft2apsav.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37932"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46325@debbugs.gnu.org To: Francesco =?UTF-8?Q?Potort=C3=AC?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 05 14:18:23 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 1l810B-0009ka-0d for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Feb 2021 14:18:23 +0100 Original-Received: from localhost ([::1]:43128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8109-0007gC-N3 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Feb 2021 08:18:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l80zq-0007fU-Ru for bug-gnu-emacs@gnu.org; Fri, 05 Feb 2021 08:18:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59818) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l80zq-00064s-JO for bug-gnu-emacs@gnu.org; Fri, 05 Feb 2021 08:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l80zq-0001QE-Eh for bug-gnu-emacs@gnu.org; Fri, 05 Feb 2021 08:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Feb 2021 13:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46325 X-GNU-PR-Package: emacs Original-Received: via spool by 46325-submit@debbugs.gnu.org id=B46325.16125310715449 (code B ref 46325); Fri, 05 Feb 2021 13:18:02 +0000 Original-Received: (at 46325) by debbugs.gnu.org; 5 Feb 2021 13:17:51 +0000 Original-Received: from localhost ([127.0.0.1]:43131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l80ze-0001Pp-R2 for submit@debbugs.gnu.org; Fri, 05 Feb 2021 08:17:51 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l80zb-0001Pb-Ox for 46325@debbugs.gnu.org; Fri, 05 Feb 2021 08:17:49 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43878) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l80zW-0005wn-JT; Fri, 05 Feb 2021 08:17:42 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1124 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l80zV-000495-Pg; Fri, 05 Feb 2021 08:17:42 -0500 In-Reply-To: (message from Francesco =?UTF-8?Q?Potort=C3=AC?= on Fri, 05 Feb 2021 13:00:17 +0100) 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:199371 Archived-At: > From: Francesco Potortì > Date: Fri, 05 Feb 2021 13:00:17 +0100 > > C-u M-x rmail RET some-mbox-format-mail-file # load a file in rmail > < # go to the first message > h # create a directory > C-d # delete the current message > > Since this is the first message, C-d should delete it, display a message > saying that there are no previous messages and stay on the deleted > message. Instead, it does (apparently) nothing and stays on the > (undeleted) message. Thanks. Rmail summary commands never display a message about no next/previous undeleted message, only Rmail commands do. But the main problem -- that C-d doesn't delete the current message -- is indeed a bug, which was introduced while trying to optimize deletion of many messages. Does the patch below fix the bug with deletion? diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index 7f99ecd..f53e6e7 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -930,10 +930,11 @@ rmail-summary-delete-forward (unless (numberp count) (setq count 1)) (let (del-msg (backward (< count 0))) - (while (and (/= count 0) - ;; Don't waste time if we are at the beginning - ;; and trying to go backward. - (not (and backward (bobp)))) + (while (/= count 0) + ;; Don't waste time counting down without doing anything if we + ;; are at the beginning and trying to go backward. + (if (and backward (bobp)) + (setq count -1)) (rmail-summary-goto-msg) (with-current-buffer rmail-buffer (setq del-msg rmail-current-message)