emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/mail/pmail.el,v


From: Paul Michael Reilly
Subject: [Emacs-diffs] Changes to emacs/lisp/mail/pmail.el,v
Date: Mon, 01 Sep 2008 08:35:25 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Paul Michael Reilly <pmr>       08/09/01 08:35:24

Index: pmail.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mail/pmail.el,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- pmail.el    29 Aug 2008 04:27:46 -0000      1.4
+++ pmail.el    1 Sep 2008 08:35:24 -0000       1.5
@@ -2622,10 +2622,8 @@
   ;; Remove the messages from the buffer and from the Pmail message
   ;; descriptor vector.
   (pmail-desc-prune-deleted-messages 'pmail-expunge-callback)
-  ;; Update the Pmail message counter, deal with the summary buffer,
-  ;; show the current message and update the User status.
-  (setq pmail-total-messages (pmail-desc-get-count))
-  (pmail-show-message pmail-current-message t)
+  ;; Deal with the summary buffer and update
+  ;; the User status.
   (let* ((omax (- (buffer-size) (point-max)))
         (omin (- (buffer-size) (point-min)))
         (opoint (if (and (> pmail-current-message 0)
@@ -2650,8 +2648,15 @@
 (defun pmail-expunge-callback (n)
   "Called after message N has been pruned to update the current Pmail
   message counter."
-  (if (< n pmail-current-message)
-      (setq pmail-current-message (1- pmail-current-message))))
+  ;; Process the various possible states to set the current message
+  ;; counter.
+  (setq pmail-total-messages (1- pmail-total-messages)
+       pmail-current-message
+       (cond
+        ((= 0 pmail-total-messages) 0)
+        ((> pmail-current-message n) (pmail-desc-get-previous 
pmail-desc-deleted-index n))
+        ((> pmail-current-message n) 0)
+        (t pmail-current-message))))
 
 ;;; mbox: ready
 (defun pmail-expunge ()




reply via email to

[Prev in Thread] Current Thread [Next in Thread]