summaryrefslogtreecommitdiff
path: root/lisp/mail/rmailsum.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2021-02-05 16:27:51 +0200
committerEli Zaretskii <eliz@gnu.org>2021-02-05 16:27:51 +0200
commit0484879d3b0f81222bacbc3c9655d1cfcdb5d321 (patch)
treeba90c0f1f1261dc94252582652ed3c6f36462bcb /lisp/mail/rmailsum.el
parentd5b1deb62e7fe56ccd88348e885a589ff8098106 (diff)
downloademacs-0484879d3b0f81222bacbc3c9655d1cfcdb5d321.tar.gz
emacs-0484879d3b0f81222bacbc3c9655d1cfcdb5d321.tar.bz2
emacs-0484879d3b0f81222bacbc3c9655d1cfcdb5d321.zip
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)
Diffstat (limited to 'lisp/mail/rmailsum.el')
-rw-r--r--lisp/mail/rmailsum.el9
1 files 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)