comparison lisp/vm/vm-folder.el @ 30:ec9a17fef872 r19-15b98

Import from CVS: tag r19-15b98
author cvs
date Mon, 13 Aug 2007 08:52:29 +0200
parents 441bb1e64a06
children c53a95d3c46d
comparison
equal deleted inserted replaced
29:7976500f47f9 30:ec9a17fef872
1033 folder-buffer 1033 folder-buffer
1034 (vm-headers-of message) 1034 (vm-headers-of message)
1035 (vm-text-of message)) 1035 (vm-text-of message))
1036 (goto-char (point-min)))) 1036 (goto-char (point-min))))
1037 (setq old-header-start (point)) 1037 (setq old-header-start (point))
1038 (while (and (not (= (following-char) ?\n)) 1038 ;; as we loop through the headers, skip >From
1039 (vm-match-header)) 1039 ;; lines. these can occur anywhere in the
1040 ;; header section if the message has been
1041 ;; manhandled by some dumb delivery agents
1042 ;; (SCO and Solaris are the usual suspects.)
1043 ;; it's a tough ol' world.
1044 (while (progn (while (looking-at ">From ")
1045 (forward-line))
1046 (and (not (= (following-char) ?\n))
1047 (vm-match-header)))
1040 (setq end-of-header (vm-matched-header-end) 1048 (setq end-of-header (vm-matched-header-end)
1041 list (vm-match-ordered-header header-alist)) 1049 list (vm-match-ordered-header header-alist))
1042 ;; don't display/keep this header if 1050 ;; don't display/keep this header if
1043 ;; keep-list not matched 1051 ;; keep-list not matched
1044 ;; and discard-regexp is nil 1052 ;; and discard-regexp is nil
2194 (setq inhibit-quit nil) 2202 (setq inhibit-quit nil)
2195 (if (integerp vm-mail-check-interval) 2203 (if (integerp vm-mail-check-interval)
2196 (if timer 2204 (if timer
2197 (timer-set-time timer (current-time) vm-mail-check-interval) 2205 (timer-set-time timer (current-time) vm-mail-check-interval)
2198 (set-itimer-restart current-itimer vm-mail-check-interval)) 2206 (set-itimer-restart current-itimer vm-mail-check-interval))
2199 ;; user has changed the variable value to a something that 2207 ;; user has changed the variable value to something that
2200 ;; isn't a number, make the timer go away. 2208 ;; isn't a number, make the timer go away.
2201 (if timer 2209 (if timer
2202 (cancel-timer timer) 2210 (cancel-timer timer)
2203 (set-itimer-restart current-itimer nil))) 2211 (set-itimer-restart current-itimer nil)))
2204 (let ((b-list (buffer-list)) 2212 (let ((b-list (buffer-list))
2207 (while (and (not (input-pending-p)) b-list) 2215 (while (and (not (input-pending-p)) b-list)
2208 (save-excursion 2216 (save-excursion
2209 (set-buffer (car b-list)) 2217 (set-buffer (car b-list))
2210 (if (and (eq major-mode 'vm-mode) 2218 (if (and (eq major-mode 'vm-mode)
2211 (setq found-one t) 2219 (setq found-one t)
2212 (not vm-block-new-mail)) 2220 ;; to avoid reentrance into the pop code
2221 (not vm-block-new-mail)
2222 ;; Don't bother checking if we already know from
2223 ;; a previous check that there's mail waiting
2224 ;; and the user hasn't retrieved it yet. Not
2225 ;; completely accurate, but saves network
2226 ;; connection build and tear down which is slow
2227 ;; for some users.
2228 (not vm-spooled-mail-waiting))
2213 (progn 2229 (progn
2214 (setq oldval vm-spooled-mail-waiting) 2230 (setq oldval vm-spooled-mail-waiting)
2215 (vm-check-for-spooled-mail nil) 2231 (vm-check-for-spooled-mail nil)
2216 (if (not (eq oldval vm-spooled-mail-waiting)) 2232 (if (not (eq oldval vm-spooled-mail-waiting))
2217 (progn 2233 (progn
2233 (setq inhibit-quit nil) 2249 (setq inhibit-quit nil)
2234 (if (integerp vm-auto-get-new-mail) 2250 (if (integerp vm-auto-get-new-mail)
2235 (if timer 2251 (if timer
2236 (timer-set-time timer (current-time) vm-auto-get-new-mail) 2252 (timer-set-time timer (current-time) vm-auto-get-new-mail)
2237 (set-itimer-restart current-itimer vm-auto-get-new-mail)) 2253 (set-itimer-restart current-itimer vm-auto-get-new-mail))
2238 ;; user has changed the variable value to a something that 2254 ;; user has changed the variable value to something that
2239 ;; isn't a number, make the timer go away. 2255 ;; isn't a number, make the timer go away.
2240 (if timer 2256 (if timer
2241 (cancel-timer timer) 2257 (cancel-timer timer)
2242 (set-itimer-restart current-itimer nil))) 2258 (set-itimer-restart current-itimer nil)))
2243 (let ((b-list (buffer-list)) 2259 (let ((b-list (buffer-list))
2596 (vm-increment vm-modification-counter) 2612 (vm-increment vm-modification-counter)
2597 (set-buffer-modified-p old-buffer-modified-p) 2613 (set-buffer-modified-p old-buffer-modified-p)
2598 (kill-buffer crash-buf) 2614 (kill-buffer crash-buf)
2599 (if (not (stringp vm-keep-crash-boxes)) 2615 (if (not (stringp vm-keep-crash-boxes))
2600 (vm-error-free-call 'delete-file crash-box) 2616 (vm-error-free-call 'delete-file crash-box)
2601 (let (name) 2617 (let ((time (decode-time (current-time)))
2602 (setq name (expand-file-name (format "Z%d" (vm-abs (random))) 2618 name)
2603 vm-keep-crash-boxes)) 2619 (setq name
2620 (expand-file-name (format "Z-%02d-%02d-%05d"
2621 (nth 4 time)
2622 (nth 3 time)
2623 (% (vm-abs (random)) 100000))
2624 vm-keep-crash-boxes))
2604 (while (file-exists-p name) 2625 (while (file-exists-p name)
2605 (setq name (expand-file-name (format "Z%d" (vm-abs (random))) 2626 (setq name
2606 vm-keep-crash-boxes))) 2627 (expand-file-name (format "Z-%02d-%02d-%05d"
2628 (nth 4 time)
2629 (nth 3 time)
2630 (% (vm-abs (random)) 100000))
2631 vm-keep-crash-boxes)))
2607 (rename-file crash-box name)))) 2632 (rename-file crash-box name))))
2608 got-mail )))) 2633 got-mail ))))
2609 2634
2610 (defun vm-compute-spool-files () 2635 (defun vm-compute-spool-files ()
2611 (let ((fallback-triples nil) 2636 (let ((fallback-triples nil)
2752 (if popdrop 2777 (if popdrop
2753 'vm-pop-move-mail 2778 'vm-pop-move-mail
2754 'vm-spool-move-mail) 2779 'vm-spool-move-mail)
2755 error-data) 2780 error-data)
2756 (sleep-for 2) 2781 (sleep-for 2)
2782 ;; we don't know if mail was
2783 ;; put into the crash box or
2784 ;; not, so return t just to be
2785 ;; safe.
2786 t )
2787 (quit (message "quitting from %s..."
2788 (if popdrop
2789 'vm-pop-move-mail
2790 'vm-spool-move-mail))
2791 (sleep-for 1)
2757 ;; we don't know if mail was 2792 ;; we don't know if mail was
2758 ;; put into the crash box or 2793 ;; put into the crash box or
2759 ;; not, so return t just to be 2794 ;; not, so return t just to be
2760 ;; safe. 2795 ;; safe.
2761 t )) 2796 t ))