[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#46325: 27.1; C-d in an rmail summary does not work on the first mess
From: |
Eli Zaretskii |
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 |
> From: Francesco Potortì <pot@gnu.org>
> 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)