[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/lisp/mail rmail.el
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] emacs/lisp/mail rmail.el |
Date: |
Sat, 08 Aug 2009 10:05:30 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Eli Zaretskii <eliz> 09/08/08 10:05:30
Modified files:
lisp/mail : rmail.el
Log message:
(rmail-add-mbox-headers, rmail-set-message-counters-counter): Search for
rmail-unix-mail-delimiter instead of just "From ". (Bug#4076)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/mail/rmail.el?cvsroot=emacs&r1=1.538&r2=1.539
Patches:
Index: rmail.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mail/rmail.el,v
retrieving revision 1.538
retrieving revision 1.539
diff -u -b -r1.538 -r1.539
--- rmail.el 21 Jul 2009 23:34:37 -0000 1.538
+++ rmail.el 8 Aug 2009 10:05:30 -0000 1.539
@@ -2072,14 +2072,16 @@
(start (point))
(value "------U-")
(case-fold-search nil)
- limit)
+ (delim (concat "\n\n" rmail-unix-mail-delimiter))
+ limit stop)
;; Detect an empty inbox file.
(unless (= start (point-max))
;; Scan the new messages to establish a count and to ensure that
;; an attribute header is present.
- (while (looking-at "From ")
- ;; Determine if a new attribute header needs to be added to
- ;; the message.
+ (if (looking-at rmail-unix-mail-delimiter)
+ (while (not stop)
+ ;; Determine if a new attribute header needs to be
+ ;; added to the message.
(if (search-forward "\n\n" nil t)
(progn
(setq count (1+ count))
@@ -2090,9 +2092,11 @@
(widen))
(rmail-error-bad-format))
;; Move to the next message.
- (if (search-forward "\n\nFrom " nil 'move)
- (forward-char -5))
- (setq start (point))))
+ (if (not (re-search-forward delim nil 'move))
+ (setq stop t)
+ (goto-char (match-beginning 0))
+ (forward-char 2))
+ (setq start (point)))))
count))))
(defun rmail-get-header-1 (name)
@@ -2480,18 +2484,19 @@
(let ((start (point)))
(while (search-backward "\n\nFrom " stop t)
(forward-char 2)
+ (when (looking-at rmail-unix-mail-delimiter)
(rmail-collect-deleted start)
(setq messages-head (cons (point-marker) messages-head)
total-messages (1+ total-messages)
start (point))
;; Show progress after every 20 messages or so.
(if (zerop (% total-messages 20))
- (message "Counting messages...%d" total-messages)))
+ (message "Counting messages...%d" total-messages))))
;; Handle the first message, maybe.
(if stop
(goto-char stop)
(goto-char (point-min)))
- (unless (not (looking-at "From "))
+ (unless (not (looking-at rmail-unix-mail-delimiter))
(rmail-collect-deleted start)
(setq messages-head (cons (point-marker) messages-head)
total-messages (1+ total-messages)))))
- [Emacs-diffs] emacs/lisp/mail rmail.el,
Eli Zaretskii <=