• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/gnus/

Lines Matching +refs:nnwarchive +refs:type

0 ;;; nnwarchive.el --- interfacing with web archives
48 (nnoo-declare nnwarchive)
50 (defvar nnwarchive-type-definition
55 nnwarchive-login nnwarchive-passwd)
58 (list-dissect . nnwarchive-egroups-list)
59 (list-groups . nnwarchive-egroups-list-groups)
65 (xover-dissect . nnwarchive-egroups-xover)
68 (article-dissect . nnwarchive-egroups-article)
71 (xover-files . nnwarchive-egroups-xover-files))
77 (list-dissect . nnwarchive-mail-archive-list)
78 (list-groups . nnwarchive-mail-archive-list-groups)
84 (xover-dissect . nnwarchive-mail-archive-xover)
87 (article-dissect . nnwarchive-mail-archive-article)
88 (xover-files . nnwarchive-mail-archive-xover-files)
92 (defvar nnwarchive-default-type 'egroups)
94 (defvoo nnwarchive-directory (nnheader-concat gnus-directory "warchive/")
95 "Where nnwarchive will save its files.")
97 (defvoo nnwarchive-type nil
98 "The type of nnwarchive.")
100 (defvoo nnwarchive-address ""
101 "The address of nnwarchive.")
103 (defvoo nnwarchive-login nil
106 (defvoo nnwarchive-passwd nil
109 (defvoo nnwarchive-groups nil)
111 (defvoo nnwarchive-headers-cache nil)
113 (defvoo nnwarchive-authentication nil)
115 (defvoo nnwarchive-nov-is-evil nil)
117 (defconst nnwarchive-version "nnwarchive 1.0")
121 (defvoo nnwarchive-open-url nil)
122 (defvoo nnwarchive-open-dissect nil)
124 (defvoo nnwarchive-list-url nil)
125 (defvoo nnwarchive-list-dissect nil)
126 (defvoo nnwarchive-list-groups nil)
128 (defvoo nnwarchive-xover-files nil)
129 (defvoo nnwarchive-xover-url nil)
130 (defvoo nnwarchive-xover-last-url nil)
131 (defvoo nnwarchive-xover-dissect nil)
132 (defvoo nnwarchive-xover-page-size nil)
134 (defvoo nnwarchive-article-url nil)
135 (defvoo nnwarchive-article-dissect nil)
136 (defvoo nnwarchive-xover-files nil)
137 (defvoo nnwarchive-article-offset 0)
139 (defvoo nnwarchive-buffer nil)
141 (defvoo nnwarchive-keep-backlog 300)
142 (defvar nnwarchive-backlog-articles nil)
143 (defvar nnwarchive-backlog-hashtb nil)
145 (defvoo nnwarchive-headers nil)
150 (nnoo-define-basics nnwarchive)
152 (defun nnwarchive-set-default (type)
153 (let ((defs (cdr (assq type nnwarchive-type-definition)))
156 (set (intern (concat "nnwarchive-" (symbol-name (car def))))
159 (defmacro nnwarchive-backlog (&rest form)
160 `(let ((gnus-keep-backlog nnwarchive-keep-backlog)
162 (format " *nnwarchive backlog %s*" nnwarchive-address))
163 (gnus-backlog-articles nnwarchive-backlog-articles)
164 (gnus-backlog-hashtb nnwarchive-backlog-hashtb))
167 (setq nnwarchive-backlog-articles gnus-backlog-articles
168 nnwarchive-backlog-hashtb gnus-backlog-hashtb))))
169 (put 'nnwarchive-backlog 'lisp-indent-function 0)
170 (put 'nnwarchive-backlog 'edebug-form-spec '(form body))
172 (defun nnwarchive-backlog-enter-article (group number buffer)
173 (nnwarchive-backlog
176 (defun nnwarchive-get-article (article &optional group server buffer)
178 (if (nnwarchive-backlog
184 (set-buffer nnwarchive-buffer)
186 (let ((article1 (- article nnwarchive-article-offset)))
187 (nnwarchive-url nnwarchive-article-url))
188 (setq contents (funcall nnwarchive-article-dissect group article)))
194 (nnwarchive-backlog-enter-article group article (current-buffer))
195 (nnheader-report 'nnwarchive "Fetched article %s" article)
199 (deffoo nnwarchive-retrieve-headers (articles &optional group server fetch-old)
200 (nnwarchive-possibly-change-server group server)
201 (if (or gnus-nov-is-evil nnwarchive-nov-is-evil)
207 (nnwarchive-get-article art group server buf)
218 (setq nnwarchive-headers (cdr (assoc group nnwarchive-headers-cache)))
220 (set-buffer nnwarchive-buffer)
222 (funcall nnwarchive-xover-files group articles))
228 (if (setq header (assq art nnwarchive-headers))
230 (let ((elem (assoc group nnwarchive-headers-cache)))
232 (setcdr elem nnwarchive-headers)
233 (push (cons group nnwarchive-headers) nnwarchive-headers-cache)))
236 (deffoo nnwarchive-request-group (group &optional server dont-check)
237 (nnwarchive-possibly-change-server nil server)
238 (when (and (not dont-check) nnwarchive-list-groups)
239 (funcall nnwarchive-list-groups (list group))
240 (nnwarchive-write-groups))
241 (let ((elem (assoc group nnwarchive-groups)))
244 (nnheader-report 'nnwarchive "Group does not exist"))
246 (nnheader-report 'nnwarchive "Opened group %s" group)
252 (deffoo nnwarchive-request-article (article &optional group server buffer)
253 (nnwarchive-possibly-change-server group server)
254 (nnwarchive-get-article article group server buffer))
256 (deffoo nnwarchive-close-server (&optional server)
257 (when (and (nnwarchive-server-opened server)
258 (gnus-buffer-live-p nnwarchive-buffer))
260 (set-buffer nnwarchive-buffer)
261 (kill-buffer nnwarchive-buffer)))
262 (nnwarchive-backlog
264 (nnoo-close-server 'nnwarchive server))
266 (deffoo nnwarchive-request-list (&optional server)
267 (nnwarchive-possibly-change-server nil server)
269 (set-buffer nnwarchive-buffer)
271 (if nnwarchive-list-url
272 (nnwarchive-url nnwarchive-list-url))
273 (if nnwarchive-list-dissect
274 (funcall nnwarchive-list-dissect))
275 (nnwarchive-write-groups)
276 (nnwarchive-generate-active))
279 (deffoo nnwarchive-open-server (server &optional defs connectionless)
280 (nnoo-change-server 'nnwarchive server defs)
281 (nnwarchive-init server)
282 (when nnwarchive-authentication
283 (setq nnwarchive-login
284 (or nnwarchive-login
288 (setq nnwarchive-passwd
289 (or nnwarchive-passwd
292 nnwarchive-login server)))))
293 (unless nnwarchive-groups
294 (nnwarchive-read-groups))
296 (set-buffer nnwarchive-buffer)
298 (if nnwarchive-open-url
299 (nnwarchive-url nnwarchive-open-url))
300 (if nnwarchive-open-dissect
301 (funcall nnwarchive-open-dissect)))
304 (nnoo-define-skeleton nnwarchive)
308 (defun nnwarchive-possibly-change-server (&optional group server)
309 (nnwarchive-init server)
311 (not (nnwarchive-server-opened server)))
312 (nnwarchive-open-server server)))
314 (defun nnwarchive-read-groups ()
315 (let ((file (expand-file-name (concat "groups-" nnwarchive-address)
316 nnwarchive-directory)))
321 (setq nnwarchive-groups (read (current-buffer)))))))
323 (defun nnwarchive-write-groups ()
324 (with-temp-file (expand-file-name (concat "groups-" nnwarchive-address)
325 nnwarchive-directory)
326 (prin1 nnwarchive-groups (current-buffer))))
328 (defun nnwarchive-init (server)
330 (let ((type (intern server)) (defs nnwarchive-type-definition) def)
333 (setq type nnwarchive-default-type))
334 ((assq type nnwarchive-type-definition) t)
336 (setq type nil)
340 (setq type (car def))))
341 (unless type
343 (setq nnwarchive-type type))
344 (unless (file-exists-p nnwarchive-directory)
345 (gnus-make-directory nnwarchive-directory))
346 (unless (gnus-buffer-live-p nnwarchive-buffer)
347 (setq nnwarchive-buffer
350 (format " *nnwarchive %s %s*" nnwarchive-type server)))))
351 (nnwarchive-set-default nnwarchive-type))
353 (defun nnwarchive-eval (expr)
356 (cons (nnwarchive-eval (car expr)) (nnwarchive-eval (cdr expr))))
362 (defun nnwarchive-url (xurl)
369 (mm-url-fetch-form (car xurl) (nnwarchive-eval (cdr xurl))))
371 (mm-url-insert (apply 'format (nnwarchive-eval xurl))))))))
373 (defun nnwarchive-generate-active ()
377 (dolist (elem nnwarchive-groups)
381 (defun nnwarchive-paged (articles)
385 (not (assq art nnwarchive-headers)))
387 (setq next (+ art nnwarchive-xover-page-size))))
392 (defun nnwarchive-egroups-list-groups (groups)
395 (set-buffer nnwarchive-buffer)
398 (nnwarchive-url nnwarchive-xover-last-url)
402 (let ((elem (assoc group nnwarchive-groups)))
405 (push (list group articles "") nnwarchive-groups)))
406 (setq nnwarchive-headers (cdr (assoc group nnwarchive-headers-cache)))
407 (nnwarchive-egroups-xover group)
408 (let ((elem (assoc group nnwarchive-headers-cache)))
410 (setcdr elem nnwarchive-headers)
411 (push (cons group nnwarchive-headers) nnwarchive-headers-cache)))))))
413 (defun nnwarchive-egroups-list ()
421 (if (setq elem (assoc group nnwarchive-groups))
423 (push (list group articles description) nnwarchive-groups))))
426 (defun nnwarchive-egroups-xover (group)
436 (unless (assq article nnwarchive-headers)
453 0 0 "")) nnwarchive-headers))))
454 nnwarchive-headers)
456 (defun nnwarchive-egroups-article (group articles)
469 (defun nnwarchive-egroups-xover-files (group articles)
471 (setq auxs (nnwarchive-paged (sort articles '<)))
474 (nnwarchive-url nnwarchive-xover-url))
475 (if nnwarchive-xover-dissect
476 (nnwarchive-egroups-xover group))))
480 (defun nnwarchive-mail-archive-list-groups (groups)
483 (set-buffer nnwarchive-buffer)
486 (nnwarchive-url nnwarchive-xover-last-url)
490 (let ((elem (assoc group nnwarchive-groups)))
493 (push (list group articles "") nnwarchive-groups)))
494 (setq nnwarchive-headers (cdr (assoc group nnwarchive-headers-cache)))
495 (nnwarchive-mail-archive-xover group)
496 (let ((elem (assoc group nnwarchive-headers-cache)))
498 (setcdr elem nnwarchive-headers)
499 (push (cons group nnwarchive-headers)
500 nnwarchive-headers-cache)))))))
502 (defun nnwarchive-mail-archive-list ()
511 (if (setq elem (assoc group nnwarchive-groups))
513 (push (list group articles description) nnwarchive-groups))))
516 (defun nnwarchive-mail-archive-xover (group)
525 (unless (assq article nnwarchive-headers)
540 0 0 "")) nnwarchive-headers))))
541 nnwarchive-headers)
543 (defun nnwarchive-mail-archive-xover-files (group articles)
544 (unless nnwarchive-headers
546 (nnwarchive-url nnwarchive-xover-last-url)
548 (nnwarchive-mail-archive-xover group))
550 (min (apply 'min (mapcar 'car nnwarchive-headers)))
554 (nnwarchive-url nnwarchive-xover-url)
555 (nnwarchive-mail-archive-xover group)
556 (setq min (apply 'min (mapcar 'car nnwarchive-headers))))))
558 (defvar nnwarchive-caesar-translation-table nil
561 (defun nnwarchive-make-caesar-translation-table ()
578 (defun nnwarchive-from-r13 (from-r13)
583 (or nnwarchive-caesar-translation-table
584 (setq nnwarchive-caesar-translation-table
585 (nnwarchive-make-caesar-translation-table)))))
589 (defun nnwarchive-mail-archive-article (group article)
608 (nnwarchive-from-r13
673 " type="
686 (insert "<#part type=\"text/html\" disposition=inline>")
726 (provide 'nnwarchive)
729 ;;; nnwarchive.el ends here