]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix 'C-d' on the first line in Rmail summary buffer
authorEli Zaretskii <eliz@gnu.org>
Fri, 5 Feb 2021 14:27:51 +0000 (16:27 +0200)
committerEli Zaretskii <eliz@gnu.org>
Fri, 5 Feb 2021 14:27:51 +0000 (16:27 +0200)
* lisp/mail/rmailsum.el (rmail-summary-delete-forward): Fix
deleting backward past the beginning of the summary buffer.
(Bug#46325)

lisp/mail/rmailsum.el

index 7f99ecdcf2c60220c5f20730fd6efe432e9c29ef..f53e6e768f8199af7ae8619d58f9d0ac0afa9bb6 100644 (file)
@@ -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)