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: Wed, 03 Sep 2008 15:33:39 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Paul Michael Reilly <pmr>       08/09/03 15:33:38

Index: pmail.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mail/pmail.el,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- pmail.el    1 Sep 2008 10:56:37 -0000       1.6
+++ pmail.el    3 Sep 2008 15:33:38 -0000       1.7
@@ -186,6 +186,11 @@
 
 (defvar pmail-encoded-remote-password nil)
 
+(defvar pmail-expunge-counter 0
+  "A counter used to keep track of the number of expunged
+messages with a lower message number than the current message
+index.")
+
 (defcustom pmail-preserve-inbox nil
   "*Non-nil means leave incoming mail in the user's inbox--don't delete it."
   :type 'boolean
@@ -1908,7 +1913,7 @@
       (let ((attr-index (pmail-desc-get-attr-index attr)))
        (set-buffer pmail-buffer)
        (or msgnum (setq msgnum pmail-current-message))
-       (pmail-desc-set-attribute attr-index state msgnum)
+       (pmail-desc-set-attribute msgnum attr-index state)
         ;; Deal with the summary buffer.
         (when pmail-summary-buffer
          (pmail-summary-update msgnum))))))
@@ -2143,7 +2148,7 @@
         ;; Clear the "unseen" attribute when we show a message, unless
        ;; it is already cleared.
        (when (pmail-desc-attr-p pmail-desc-unseen-index n)
-         (pmail-desc-set-attribute pmail-desc-unseen-index nil n))
+         (pmail-desc-set-attribute n pmail-desc-unseen-index nil))
        (pmail-display-labels)
        ;; Deal with MIME
        (if (eq pmail-enable-mime t)
@@ -2554,7 +2559,7 @@
 (defun pmail-delete-message ()
   "Delete this message and stay on it."
   (interactive)
-  (pmail-desc-set-attribute pmail-desc-deleted-index t pmail-current-message)
+  (pmail-desc-set-attribute pmail-current-message pmail-desc-deleted-index t)
   (run-hooks 'pmail-delete-message-hook)
   (pmail-show-message pmail-current-message))
 
@@ -2568,7 +2573,7 @@
       (setq msg (1- msg)))
     (if (= msg 0)
        (error "No previous deleted message")
-      (pmail-desc-set-attribute pmail-desc-deleted-index nil msg)
+      (pmail-desc-set-attribute msg pmail-desc-deleted-index nil)
       (pmail-show-message msg)
       (if (pmail-summary-exists)
          (save-excursion
@@ -2584,7 +2589,7 @@
 
 Returns t if a new message is displayed after the delete, or nil otherwise."
   (interactive "P")
-  (pmail-desc-set-attribute pmail-desc-deleted-index t pmail-current-message)
+  (pmail-desc-set-attribute pmail-current-message pmail-desc-deleted-index t)
   (run-hooks 'pmail-delete-message-hook)
   (let ((del-msg pmail-current-message))
     (if (pmail-summary-exists)
@@ -2621,7 +2626,9 @@
   (or (eq buffer-undo-list t) (setq buffer-undo-list nil))
   ;; Remove the messages from the buffer and from the Pmail message
   ;; descriptor vector.
+  (setq pmail-expunge-counter 0)
   (pmail-desc-prune-deleted-messages 'pmail-expunge-callback)
+  (setq pmail-current-message (- pmail-current-message pmail-expunge-counter))
   ;; Deal with the summary buffer and update
   ;; the User status.
   (let* ((omax (- (buffer-size) (point-max)))
@@ -2650,13 +2657,9 @@
   message counter."
   ;; 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))))
+  (setq pmail-total-messages (1- pmail-total-messages))
+  (if (>= pmail-current-message n)
+      (setq pmail-expunge-counter (1+ pmail-expunge-counter))))
 
 ;;; mbox: ready
 (defun pmail-expunge ()
@@ -2793,7 +2796,7 @@
     (let ((n (car msgnum-list)))
       (set-buffer pmail-buffer)
       (pmail-narrow-to-message n)
-      (pmail-desc-set-attribute attr-index t n))))
+      (pmail-desc-set-attribute n attr-index t))))
 
 (defun pmail-narrow-to-message (n)
   "Narrow the current (pmail) buffer to bracket message N."




reply via email to

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