emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp/mail rmail.el


From: Glenn Morris
Subject: [Emacs-diffs] emacs/lisp/mail rmail.el
Date: Tue, 03 Feb 2009 04:07:25 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       09/02/03 04:07:25

Modified files:
        lisp/mail      : rmail.el 

Log message:
        (rmail-convert-babyl-to-mbox): Disable undo while
        inserting the converted mailbox.
        (rmail-get-new-mail): Restore the loop over inboxes when two or more
        have the same basename.  (Bug#2164)
        Set the return value according to whether any mail was found,
        not just in the last inbox.  Only show a message and run the hook after
        checking all inboxes.
        (rmail-get-new-mail-1): Move message display and running the hook to
        rmail-get-new-mail.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/mail/rmail.el?cvsroot=emacs&r1=1.490&r2=1.491

Patches:
Index: rmail.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/mail/rmail.el,v
retrieving revision 1.490
retrieving revision 1.491
diff -u -b -r1.490 -r1.491
--- rmail.el    2 Feb 2009 07:55:06 -0000       1.490
+++ rmail.el    3 Feb 2009 04:07:25 -0000       1.491
@@ -919,7 +919,8 @@
          (unrmail old-file new-file)
          (message "Replacing BABYL format with mbox format...")
          (let ((inhibit-read-only t)
-               (coding-system-for-read 'raw-text))
+               (coding-system-for-read 'raw-text)
+               (buffer-undo-list t))
            (erase-buffer)
            (insert-file-contents new-file)
            ;; Rmail buffers need to be saved with Unix EOLs, or else
@@ -1575,7 +1576,10 @@
        (rmail-enable-multibyte (default-value 'enable-multibyte-characters))
        found)
     (unwind-protect
-       (when all-files
+        (progn
+          ;; This loops if any members of the inbox list have the same
+          ;; basename (see "name conflict" below).
+          (while all-files
          (let ((opoint (point))
                ;; If buffer has not changed yet, and has not been
                ;; saved yet, don't replace the old backup file now.
@@ -1587,6 +1591,7 @@
            ;; Pull files off all-files onto files as long as there is
            ;; no name conflict.  A conflict happens when two inbox
            ;; file names have the same last component.
+             ;; FIXME why does this "conflict" need kid gloves?
            (while (and all-files
                        (not (member (file-name-nondirectory (car all-files))
                                     file-last-names)))
@@ -1599,10 +1604,16 @@
            (goto-char (point-max))
            (skip-chars-backward " \t\n") ; just in case of brain damage
            (delete-region (point) (point-max)) ; caused by 
require-final-newline
-           (setq found (rmail-get-new-mail-1 file-name files delete-files))))
+              (setq found (or
+                           (rmail-get-new-mail-1 file-name files delete-files)
+                          found))))
+          ;; Move to the first new message unless we have other unseen
+          ;; messages before it.
+         (if found (rmail-show-message-maybe (rmail-first-unseen-message)))
+         (run-hooks 'rmail-after-get-new-mail-hook)
       found)
     ;; Don't leave the buffer screwed up if we get a disk-full error.
-    (or found (rmail-show-message-maybe))))
+      (rmail-show-message-maybe))))
 
 (defun rmail-get-new-mail-1 (file-name files delete-files)
   "Return t if new messages are detected without error, nil otherwise."
@@ -1673,12 +1684,8 @@
          (if rsf-beep (beep t))
          (sleep-for rsf-sleep-after-message))
 
-       ;; Establish the return value and move to the first new
-       ;; message unless we have other unseen messages before it.
+       ;; Establish the return value.
        (setq result (> new-messages 0))
-       (when result
-         (rmail-show-message-maybe (rmail-first-unseen-message)))
-       (run-hooks 'rmail-after-get-new-mail-hook)
        result))))
 
 (defun rmail-get-new-mail-filter-spam (new-message-count)




reply via email to

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