From 0484879d3b0f81222bacbc3c9655d1cfcdb5d321 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 5 Feb 2021 16:27:51 +0200 Subject: [PATCH] Fix 'C-d' on the first line in Rmail summary buffer * lisp/mail/rmailsum.el (rmail-summary-delete-forward): Fix deleting backward past the beginning of the summary buffer. (Bug#46325) --- lisp/mail/rmailsum.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index 7f99ecdcf2c..f53e6e768f8 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -930,10 +930,11 @@ a negative argument means to delete and move backward." (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) -- 2.39.2