comparison lisp/gnus/nndraft.el @ 30:ec9a17fef872 r19-15b98

Import from CVS: tag r19-15b98
author cvs
date Mon, 13 Aug 2007 08:52:29 +0200
parents 0293115a14e9
children 131b0175ea99
comparison
equal deleted inserted replaced
29:7976500f47f9 30:ec9a17fef872
61 ;; We don't support fetching by Message-ID. 61 ;; We don't support fetching by Message-ID.
62 (if (stringp (car articles)) 62 (if (stringp (car articles))
63 'headers 63 'headers
64 (while articles 64 (while articles
65 (set-buffer buf) 65 (set-buffer buf)
66 (when (nndraft-request-article 66 (when (nndraft-request-article
67 (setq article (pop articles)) group server (current-buffer)) 67 (setq article (pop articles)) group server (current-buffer))
68 (goto-char (point-min)) 68 (goto-char (point-min))
69 (if (search-forward "\n\n" nil t) 69 (if (search-forward "\n\n" nil t)
70 (forward-line -1) 70 (forward-line -1)
71 (goto-char (point-max))) 71 (goto-char (point-max)))
81 81
82 (deffoo nndraft-open-server (server &optional defs) 82 (deffoo nndraft-open-server (server &optional defs)
83 (nnoo-change-server 'nndraft server defs) 83 (nnoo-change-server 'nndraft server defs)
84 (unless (assq 'nndraft-directory defs) 84 (unless (assq 'nndraft-directory defs)
85 (setq nndraft-directory server)) 85 (setq nndraft-directory server))
86 (cond 86 (cond
87 ((not (file-exists-p nndraft-directory)) 87 ((not (file-exists-p nndraft-directory))
88 (nndraft-close-server) 88 (nndraft-close-server)
89 (nnheader-report 'nndraft "No such file or directory: %s" 89 (nnheader-report 'nndraft "No such file or directory: %s"
90 nndraft-directory)) 90 nndraft-directory))
91 ((not (file-directory-p (file-truename nndraft-directory))) 91 ((not (file-directory-p (file-truename nndraft-directory)))
96 server nndraft-directory) 96 server nndraft-directory)
97 t))) 97 t)))
98 98
99 (deffoo nndraft-request-article (id &optional group server buffer) 99 (deffoo nndraft-request-article (id &optional group server buffer)
100 (when (numberp id) 100 (when (numberp id)
101 ;; We get the newest file of the auto-saved file and the 101 ;; We get the newest file of the auto-saved file and the
102 ;; "real" file. 102 ;; "real" file.
103 (let* ((file (nndraft-article-filename id)) 103 (let* ((file (nndraft-article-filename id))
104 (auto (nndraft-auto-save-file-name file)) 104 (auto (nndraft-auto-save-file-name file))
105 (newest (if (file-newer-than-file-p file auto) file auto)) 105 (newest (if (file-newer-than-file-p file auto) file auto))
106 (nntp-server-buffer (or buffer nntp-server-buffer))) 106 (nntp-server-buffer (or buffer nntp-server-buffer)))
107 (when (and (file-exists-p newest) 107 (when (and (file-exists-p newest)
108 (nnmail-find-file newest)) 108 (nnmail-find-file newest))
109 (save-excursion 109 (save-excursion
110 (set-buffer nntp-server-buffer) 110 (set-buffer nntp-server-buffer)
111 (goto-char (point-min)) 111 (goto-char (point-min))
112 ;; If there's a mail header separator in this file, 112 ;; If there's a mail header separator in this file,
113 ;; we remove it. 113 ;; we remove it.
114 (when (re-search-forward 114 (when (re-search-forward
115 (concat "^" mail-header-separator "$") nil t) 115 (concat "^" mail-header-separator "$") nil t)
116 (replace-match "" t t))) 116 (replace-match "" t t)))
117 t)))) 117 t))))
161 161
162 (deffoo nndraft-request-newgroups (date &optional server) 162 (deffoo nndraft-request-newgroups (date &optional server)
163 (nndraft-execute-nnmh-command 163 (nndraft-execute-nnmh-command
164 `(nnmh-request-newgroups ,date ,server))) 164 `(nnmh-request-newgroups ,date ,server)))
165 165
166 (deffoo nndraft-request-expire-articles 166 (deffoo nndraft-request-expire-articles
167 (articles group &optional server force) 167 (articles group &optional server force)
168 (let ((res (nndraft-execute-nnmh-command 168 (let ((res (nndraft-execute-nnmh-command
169 `(nnmh-request-expire-articles 169 `(nnmh-request-expire-articles
170 ',articles group ,server ,force))) 170 ',articles group ,server ,force)))
171 article) 171 article)