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: Thu, 19 Feb 2009 03:30:44 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       09/02/19 03:30:44

Modified files:
        lisp/mail      : rmail.el 

Log message:
        (rsf-beep, rsf-sleep-after-message, rmail-spam-filter): Don't declare.
        (rmail-get-new-mail-filter-spam): Declare.  Move definition to
        rmail-spam-filter.el.
        (rmail-get-new-mail-1): Move the beep and sleep to
        rmail-get-new-mail-filter-spam.

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

Patches:
Index: rmail.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/mail/rmail.el,v
retrieving revision 1.509
retrieving revision 1.510
diff -u -b -r1.509 -r1.510
--- rmail.el    18 Feb 2009 08:02:58 -0000      1.509
+++ rmail.el    19 Feb 2009 03:30:41 -0000      1.510
@@ -89,9 +89,6 @@
 (defvar mail-abbrev-syntax-table)
 (defvar mail-abbrevs)
 (defvar messages-head)
-(defvar rmail-use-spam-filter)
-(defvar rsf-beep)
-(defvar rsf-sleep-after-message)
 (defvar total-messages)
 (defvar tool-bar-map)
 
@@ -1555,7 +1552,6 @@
 
 ;;;; *** Rmail input ***
 
-(declare-function rmail-spam-filter "rmail-spam-filter" (msg))
 (declare-function rmail-summary-goto-msg "rmailsum" (&optional n nowarn 
skip-rmail))
 (declare-function rmail-summary-mark-undeleted "rmailsum" (n))
 (declare-function rmail-summary-mark-deleted "rmailsum" (&optional n undel))
@@ -1643,6 +1639,9 @@
       ;; Don't leave the buffer screwed up if we get a disk-full error.
       (rmail-show-message))))
 
+(defvar rmail-use-spam-filter)
+(declare-function rmail-get-new-mail-filter-spam "rmail-spam-filter" (nnew))
+
 (defun rmail-get-new-mail-1 (file-name files delete-files)
   "Return t if new messages are detected without error, nil otherwise."
   (save-excursion
@@ -1700,47 +1699,16 @@
        (if (zerop new-messages)
            (when (or file-name rmail-inbox-list)
              (message "(No new mail has arrived)"))
-         ;; Generate the spam message.
-         (setq blurb (if spam-filter-p
-                         (rmail-get-new-mail-filter-spam new-messages)
-                       "")))
+         (if spam-filter-p
+             (setq blurb (rmail-get-new-mail-filter-spam new-messages))))
        (if (rmail-summary-exists)
            (rmail-select-summary (rmail-update-summary)))
        (setq suffix (if (= 1 new-messages) "" "s"))
        (message "%d new message%s read%s" new-messages suffix blurb)
-       (unless (string-equal blurb "") ; there was spam
-         (if rsf-beep (beep t))
-         ;; The use of rmail-show-message in rmail-get-new-mail-filter-spam
-         ;; also prevents the raw mbox buffer from showing at this point.
-         (sleep-for rsf-sleep-after-message))
        ;; Establish the return value.
        (setq result (> new-messages 0))
        result))))
 
-(defun rmail-get-new-mail-filter-spam (nnew)
-  "Check the most NNEW recent messages for spam."
-  (let* ((nold (- rmail-total-messages nnew))
-        (nspam 0)
-        (nscan (1+ nold)))
-    (while (<= nscan rmail-total-messages)
-      (or (rmail-spam-filter nscan)
-         (setq nspam (1+ nspam)))
-      (setq nscan (1+ nscan)))
-    (when (> nspam 0)
-      ;; Otherwise the expunge prompt leaves the raw mbox buffer showing.
-      (rmail-show-message (rmail-first-unseen-message) 1)
-      (if (rmail-expunge-confirmed) (rmail-only-expunge t))
-      ;; Swap back, else get-new-mail-1 gets confused.
-      (rmail-swap-buffers-maybe)
-      (widen))
-    ;; Return a message based on the number of spam messages found.
-    (cond
-     ((zerop nspam) "")
-     ((= 1 nnew) ", and it appears to be spam")
-     ((= nspam nnew) ", and all appear to be spam")
-     (t (format ", and %d appear%s to be spam" nspam
-               (if (= 1 nspam) "s" ""))))))
-
 (defun rmail-parse-url (file)
   "Parse the supplied URL. Return (list MAILBOX-NAME REMOTE PASSWORD 
GOT-PASSWORD)
 WHERE MAILBOX-NAME is the name of the mailbox suitable as argument to the




reply via email to

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