Mercurial > emacs
comparison lisp/gnus/mail-source.el @ 43421:a949c187ce13
* mail-source.el (mail-source-fetch-directory): Run scripts.
author | ShengHuo ZHU <zsh@cs.rochester.edu> |
---|---|
date | Tue, 19 Feb 2002 14:03:24 +0000 |
parents | a26d9b55abb6 |
children | fa370bd262ee |
comparison
equal
deleted
inserted
replaced
43420:33c54ecf6602 | 43421:a949c187ce13 |
---|---|
1 ;;; mail-source.el --- functions for fetching mail | 1 ;;; mail-source.el --- functions for fetching mail |
2 ;; Copyright (C) 1999, 2000 Free Software Foundation, Inc. | 2 ;; Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. |
3 | 3 |
4 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> | 4 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
5 ;; Keywords: news, mail | 5 ;; Keywords: news, mail |
6 | 6 |
7 ;; This file is part of GNU Emacs. | 7 ;; This file is part of GNU Emacs. |
289 (:program) | 289 (:program) |
290 (:function) | 290 (:function) |
291 (:password) | 291 (:password) |
292 (:authentication password)) | 292 (:authentication password)) |
293 (maildir | 293 (maildir |
294 (:prescript) | |
295 (:prescript-delay) | |
296 (:postscript) | |
294 (:path (or (getenv "MAILDIR") "~/Maildir/")) | 297 (:path (or (getenv "MAILDIR") "~/Maildir/")) |
295 (:subdirs ("new" "cur")) | 298 (:subdirs ("new" "cur")) |
296 (:function)) | 299 (:function)) |
297 (imap | 300 (imap |
298 (:server (getenv "MAILHOST")) | 301 (:server (getenv "MAILHOST")) |
607 0)))) | 610 0)))) |
608 | 611 |
609 (defun mail-source-fetch-directory (source callback) | 612 (defun mail-source-fetch-directory (source callback) |
610 "Fetcher for directory sources." | 613 "Fetcher for directory sources." |
611 (mail-source-bind (directory source) | 614 (mail-source-bind (directory source) |
615 (mail-source-run-script | |
616 prescript (format-spec-make ?t path) | |
617 prescript-delay) | |
612 (let ((found 0) | 618 (let ((found 0) |
613 (mail-source-string (format "directory:%s" path))) | 619 (mail-source-string (format "directory:%s" path))) |
614 (dolist (file (directory-files | 620 (dolist (file (directory-files |
615 path t (concat (regexp-quote suffix) "$"))) | 621 path t (concat (regexp-quote suffix) "$"))) |
616 (when (and (file-regular-p file) | 622 (when (and (file-regular-p file) |
617 (funcall predicate file) | 623 (funcall predicate file) |
618 (mail-source-movemail file mail-source-crash-box)) | 624 (mail-source-movemail file mail-source-crash-box)) |
619 (incf found (mail-source-callback callback file)))) | 625 (incf found (mail-source-callback callback file)))) |
626 (mail-source-run-script | |
627 postscript (format-spec-make ?t path)) | |
620 found))) | 628 found))) |
621 | 629 |
622 (defun mail-source-fetch-pop (source callback) | 630 (defun mail-source-fetch-pop (source callback) |
623 "Fetcher for single-file sources." | 631 "Fetcher for single-file sources." |
624 (mail-source-bind (pop source) | 632 (mail-source-bind (pop source) |