1 |
;;; nnsoup.el --- SOUP access for Gnus |
;;; nnsoup.el --- SOUP access for Gnus |
2 |
|
|
3 |
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 |
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002 |
4 |
;; Free Software Foundation, Inc. |
;; Free Software Foundation, Inc. |
5 |
|
|
6 |
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
114 |
;; articles in SEQUENCE come from. |
;; articles in SEQUENCE come from. |
115 |
(while (and areas sequence) |
(while (and areas sequence) |
116 |
;; Peel off areas that are below sequence. |
;; Peel off areas that are below sequence. |
117 |
(while (and areas (< (cdaar areas) (car sequence))) |
(while (and areas (< (cdar (car areas)) (car sequence))) |
118 |
(setq areas (cdr areas))) |
(setq areas (cdr areas))) |
119 |
(when areas |
(when areas |
120 |
;; This is a useful area. |
;; This is a useful area. |
130 |
(setq use-nov nil)) |
(setq use-nov nil)) |
131 |
;; We assign the portion of `sequence' that is relevant to |
;; We assign the portion of `sequence' that is relevant to |
132 |
;; this MSG packet to this packet. |
;; this MSG packet to this packet. |
133 |
(while (and sequence (<= (car sequence) (cdaar areas))) |
(while (and sequence (<= (car sequence) (cdar (car areas)))) |
134 |
(push (car sequence) this-area-seq) |
(push (car sequence) this-area-seq) |
135 |
(setq sequence (cdr sequence))) |
(setq sequence (cdr sequence))) |
136 |
(setcar useful-areas (cons (nreverse this-area-seq) |
(setcar useful-areas (cons (nreverse this-area-seq) |
158 |
(when index-buffer |
(when index-buffer |
159 |
(insert-buffer-substring index-buffer) |
(insert-buffer-substring index-buffer) |
160 |
(goto-char b) |
(goto-char b) |
161 |
;; We have to remove the index number entires and |
;; We have to remove the index number entries and |
162 |
;; insert article numbers instead. |
;; insert article numbers instead. |
163 |
(while (looking-at "[0-9]+") |
(while (looking-at "[0-9]+") |
164 |
(replace-match (int-to-string number) t t) |
(replace-match (int-to-string number) t t) |
249 |
;; Try to guess the type based on the first article in the group. |
;; Try to guess the type based on the first article in the group. |
250 |
(when (not article) |
(when (not article) |
251 |
(setq article |
(setq article |
252 |
(cdaar (cddr (assoc group nnsoup-group-alist))))) |
(cdar (car (cddr (assoc group nnsoup-group-alist)))))) |
253 |
(if (not article) |
(if (not article) |
254 |
'unknown |
'unknown |
255 |
(let ((kind (gnus-soup-encoding-kind |
(let ((kind (gnus-soup-encoding-kind |
257 |
(nth 1 (nnsoup-article-to-area |
(nth 1 (nnsoup-article-to-area |
258 |
article nnsoup-current-group)))))) |
article nnsoup-current-group)))))) |
259 |
(cond ((= kind ?m) 'mail) |
(cond ((= kind ?m) 'mail) |
260 |
((= kind ?n) 'news) |
((= kind ?n) 'news) |
261 |
(t 'unknown))))) |
(t 'unknown))))) |
262 |
|
|
263 |
(deffoo nnsoup-close-group (group &optional server) |
(deffoo nnsoup-close-group (group &optional server) |
371 |
(setq min (caaar e)) |
(setq min (caaar e)) |
372 |
(while (cdr e) |
(while (cdr e) |
373 |
(setq e (cdr e))) |
(setq e (cdr e))) |
374 |
(setq max (cdaar e)) |
(setq max (cdar (car e))) |
375 |
(setcdr entry (cons (cons min max) (cdr entry))))) |
(setcdr entry (cons (cons min max) (cdr entry))))) |
376 |
(setq nnsoup-group-alist-touched t)) |
(setq nnsoup-group-alist-touched t)) |
377 |
nnsoup-group-alist)) |
nnsoup-group-alist)) |
399 |
prefix)) |
prefix)) |
400 |
|
|
401 |
(defun nnsoup-file-name (dir file) |
(defun nnsoup-file-name (dir file) |
402 |
"Return the full path of FILE (in any case) in DIR." |
"Return the full name of FILE (in any case) in DIR." |
403 |
(let* ((case-fold-search t) |
(let* ((case-fold-search t) |
404 |
(files (directory-files dir t)) |
(files (directory-files dir t)) |
405 |
(regexp (concat (regexp-quote file) "$"))) |
(regexp (concat (regexp-quote file) "$"))) |
651 |
(defun nnsoup-article-to-area (article group) |
(defun nnsoup-article-to-area (article group) |
652 |
"Return the area that ARTICLE in GROUP is located in." |
"Return the area that ARTICLE in GROUP is located in." |
653 |
(let ((areas (cddr (assoc group nnsoup-group-alist)))) |
(let ((areas (cddr (assoc group nnsoup-group-alist)))) |
654 |
(while (and areas (< (cdaar areas) article)) |
(while (and areas (< (cdar (car areas)) article)) |
655 |
(setq areas (cdr areas))) |
(setq areas (cdr areas))) |
656 |
(and areas (car areas)))) |
(and areas (car areas)))) |
657 |
|
|