emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/gnus/nnwarchive.el


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/lisp/gnus/nnwarchive.el
Date: Tue, 04 Feb 2003 08:06:43 -0500

Index: emacs/lisp/gnus/nnwarchive.el
diff -c emacs/lisp/gnus/nnwarchive.el:1.2 emacs/lisp/gnus/nnwarchive.el:1.3
*** emacs/lisp/gnus/nnwarchive.el:1.2   Mon Apr  1 12:25:39 2002
--- emacs/lisp/gnus/nnwarchive.el       Tue Feb  4 08:06:38 2003
***************
*** 26,32 ****
  ;; Note: You need to have `url' (w3 0.46) or greater version
  ;; installed for this backend to work.
  
! ;; Todo: 
  ;; 1. To support more web archives.
  ;; 2. Generalize webmail to other MHonArc archive.
  
--- 26,32 ----
  ;; Note: You need to have `url' (w3 0.46) or greater version
  ;; installed for this backend to work.
  
! ;; Todo:
  ;; 1. To support more web archives.
  ;; 2. Generalize webmail to other MHonArc archive.
  
***************
*** 60,79 ****
  (defvar nnwarchive-type-definition
    '((egroups
       (address . "www.egroups.com")
!      (open-url 
!       "http://www.egroups.com/login.cgi?&login_email=%s&login_password=%s"; 
        nnwarchive-login nnwarchive-passwd)
!      (list-url 
        "http://www.egroups.com/mygroups";)
       (list-dissect . nnwarchive-egroups-list)
       (list-groups . nnwarchive-egroups-list-groups)
!      (xover-url 
        "http://www.egroups.com/messages/%s/%d"; group aux)
!      (xover-last-url 
        "http://www.egroups.com/messages/%s/"; group)
       (xover-page-size . 13)
       (xover-dissect . nnwarchive-egroups-xover)
!      (article-url 
        "http://www.egroups.com/message/%s/%d?source=1"; group article)
       (article-dissect . nnwarchive-egroups-article)
       (authentication . t)
--- 60,79 ----
  (defvar nnwarchive-type-definition
    '((egroups
       (address . "www.egroups.com")
!      (open-url
!       "http://www.egroups.com/login.cgi?&login_email=%s&login_password=%s";
        nnwarchive-login nnwarchive-passwd)
!      (list-url
        "http://www.egroups.com/mygroups";)
       (list-dissect . nnwarchive-egroups-list)
       (list-groups . nnwarchive-egroups-list-groups)
!      (xover-url
        "http://www.egroups.com/messages/%s/%d"; group aux)
!      (xover-last-url
        "http://www.egroups.com/messages/%s/"; group)
       (xover-page-size . 13)
       (xover-dissect . nnwarchive-egroups-xover)
!      (article-url
        "http://www.egroups.com/message/%s/%d?source=1"; group article)
       (article-dissect . nnwarchive-egroups-article)
       (authentication . t)
***************
*** 82,98 ****
      (mail-archive
       (address . "www.mail-archive.com")
       (open-url)
!      (list-url 
        "http://www.mail-archive.com/lists.html";)
       (list-dissect . nnwarchive-mail-archive-list)
       (list-groups . nnwarchive-mail-archive-list-groups)
!      (xover-url 
        "http://www.mail-archive.com/%s/mail%d.html"; group aux)
!      (xover-last-url 
        "http://www.mail-archive.com/%s/maillist.html"; group)
       (xover-page-size)
       (xover-dissect . nnwarchive-mail-archive-xover)
!      (article-url 
        "http://www.mail-archive.com/%s/msg%05d.html"; group article1)
       (article-dissect . nnwarchive-mail-archive-article)
       (xover-files . nnwarchive-mail-archive-xover-files)
--- 82,98 ----
      (mail-archive
       (address . "www.mail-archive.com")
       (open-url)
!      (list-url
        "http://www.mail-archive.com/lists.html";)
       (list-dissect . nnwarchive-mail-archive-list)
       (list-groups . nnwarchive-mail-archive-list-groups)
!      (xover-url
        "http://www.mail-archive.com/%s/mail%d.html"; group aux)
!      (xover-last-url
        "http://www.mail-archive.com/%s/maillist.html"; group)
       (xover-page-size)
       (xover-dissect . nnwarchive-mail-archive-xover)
!      (article-url
        "http://www.mail-archive.com/%s/msg%05d.html"; group article1)
       (article-dissect . nnwarchive-mail-archive-article)
       (xover-files . nnwarchive-mail-archive-xover-files)
***************
*** 163,174 ****
    (let ((defs (cdr (assq type nnwarchive-type-definition)))
        def)
      (dolist (def defs)
!       (set (intern (concat "nnwarchive-" (symbol-name (car def)))) 
           (cdr def)))))
  
  (defmacro nnwarchive-backlog (&rest form)
    `(let ((gnus-keep-backlog nnwarchive-keep-backlog)
!        (gnus-backlog-buffer 
          (format " *nnwarchive backlog %s*" nnwarchive-address))
         (gnus-backlog-articles nnwarchive-backlog-articles)
         (gnus-backlog-hashtb nnwarchive-backlog-hashtb))
--- 163,174 ----
    (let ((defs (cdr (assq type nnwarchive-type-definition)))
        def)
      (dolist (def defs)
!       (set (intern (concat "nnwarchive-" (symbol-name (car def))))
           (cdr def)))))
  
  (defmacro nnwarchive-backlog (&rest form)
    `(let ((gnus-keep-backlog nnwarchive-keep-backlog)
!        (gnus-backlog-buffer
          (format " *nnwarchive backlog %s*" nnwarchive-address))
         (gnus-backlog-articles nnwarchive-backlog-articles)
         (gnus-backlog-hashtb nnwarchive-backlog-hashtb))
***************
*** 183,192 ****
    (nnwarchive-backlog
      (gnus-backlog-enter-article group number buffer)))
  
! (defun nnwarchive-get-article (article &optional group server buffer) 
    (if (numberp article)
        (if (nnwarchive-backlog
!           (gnus-backlog-request-article group article 
                                          (or buffer nntp-server-buffer)))
          (cons group article)
        (let (contents)
--- 183,192 ----
    (nnwarchive-backlog
      (gnus-backlog-enter-article group number buffer)))
  
! (defun nnwarchive-get-article (article &optional group server buffer)
    (if (numberp article)
        (if (nnwarchive-backlog
!           (gnus-backlog-request-article group article
                                          (or buffer nntp-server-buffer)))
          (cons group article)
        (let (contents)
***************
*** 298,304 ****
      (setq nnwarchive-passwd
          (or nnwarchive-passwd
              (mail-source-read-passwd
!              (format "Password for %s at %s: " 
                       nnwarchive-login server)))))
    (unless nnwarchive-groups
      (nnwarchive-read-groups))
--- 298,304 ----
      (setq nnwarchive-passwd
          (or nnwarchive-passwd
              (mail-source-read-passwd
!              (format "Password for %s at %s: "
                       nnwarchive-login server)))))
    (unless nnwarchive-groups
      (nnwarchive-read-groups))
***************
*** 322,328 ****
      (nnwarchive-open-server server)))
  
  (defun nnwarchive-read-groups ()
!   (let ((file (expand-file-name (concat "groups-" nnwarchive-address) 
                                nnwarchive-directory)))
      (when (file-exists-p file)
        (with-temp-buffer
--- 322,328 ----
      (nnwarchive-open-server server)))
  
  (defun nnwarchive-read-groups ()
!   (let ((file (expand-file-name (concat "groups-" nnwarchive-address)
                                nnwarchive-directory)))
      (when (file-exists-p file)
        (with-temp-buffer
***************
*** 331,344 ****
        (setq nnwarchive-groups (read (current-buffer)))))))
  
  (defun nnwarchive-write-groups ()
!   (with-temp-file (expand-file-name (concat "groups-" nnwarchive-address) 
                                    nnwarchive-directory)
      (prin1 nnwarchive-groups (current-buffer))))
  
  (defun nnwarchive-init (server)
    "Initialize buffers and such."
    (let ((type (intern server)) (defs nnwarchive-type-definition) def)
!     (cond 
       ((equal server "")
        (setq type nnwarchive-default-type))
       ((assq type nnwarchive-type-definition) t)
--- 331,344 ----
        (setq nnwarchive-groups (read (current-buffer)))))))
  
  (defun nnwarchive-write-groups ()
!   (with-temp-file (expand-file-name (concat "groups-" nnwarchive-address)
                                    nnwarchive-directory)
      (prin1 nnwarchive-groups (current-buffer))))
  
  (defun nnwarchive-init (server)
    "Initialize buffers and such."
    (let ((type (intern server)) (defs nnwarchive-type-definition) def)
!     (cond
       ((equal server "")
        (setq type nnwarchive-default-type))
       ((assq type nnwarchive-type-definition) t)
***************
*** 390,402 ****
    (mm-with-unibyte-current-buffer
      (let ((url-confirmation-func 'identity)
          (url-cookie-multiple-line nil))
!       (cond 
         ((eq (car xurl) 'post)
        (pop xurl)
        (nnwarchive-fetch-form (car xurl) (nnwarchive-eval (cdr xurl))))
         (t
        (nnweb-insert (apply 'format (nnwarchive-eval xurl))))))))
!   
  (defun nnwarchive-generate-active ()
    (save-excursion
      (set-buffer nntp-server-buffer)
--- 390,402 ----
    (mm-with-unibyte-current-buffer
      (let ((url-confirmation-func 'identity)
          (url-cookie-multiple-line nil))
!       (cond
         ((eq (car xurl) 'post)
        (pop xurl)
        (nnwarchive-fetch-form (car xurl) (nnwarchive-eval (cdr xurl))))
         (t
        (nnweb-insert (apply 'format (nnwarchive-eval xurl))))))))
! 
  (defun nnwarchive-generate-active ()
    (save-excursion
      (set-buffer nntp-server-buffer)
***************
*** 420,431 ****
    (save-excursion
      (let (articles)
        (set-buffer nnwarchive-buffer)
!       (dolist (group groups) 
        (erase-buffer)
        (nnwarchive-url nnwarchive-xover-last-url)
        (goto-char (point-min))
        (when (re-search-forward "of \\([0-9]+\\)[ \t\n\r]*</title>" nil t)
!         (setq articles (string-to-number (match-string 1)))) 
        (let ((elem (assoc group nnwarchive-groups)))
          (if elem
              (setcar (cdr elem) articles)
--- 420,431 ----
    (save-excursion
      (let (articles)
        (set-buffer nnwarchive-buffer)
!       (dolist (group groups)
        (erase-buffer)
        (nnwarchive-url nnwarchive-xover-last-url)
        (goto-char (point-min))
        (when (re-search-forward "of \\([0-9]+\\)[ \t\n\r]*</title>" nil t)
!         (setq articles (string-to-number (match-string 1))))
        (let ((elem (assoc group nnwarchive-groups)))
          (if elem
              (setcar (cdr elem) articles)
***************
*** 441,447 ****
    (let ((case-fold-search t)
        group description elem articles)
      (goto-char (point-min))
!     (while 
        (re-search-forward "href=\"/group/\\([^/\"\> ]+\\)" nil t)
        (setq group (match-string 1)
            description (match-string 2))
--- 441,447 ----
    (let ((case-fold-search t)
        group description elem articles)
      (goto-char (point-min))
!     (while
        (re-search-forward "href=\"/group/\\([^/\"\> ]+\\)" nil t)
        (setq group (match-string 1)
            description (match-string 2))
***************
*** 469,480 ****
        (push (cons
               article
               (make-full-mail-header
!               article 
                (nnweb-decode-entities-string subject)
                (nnweb-decode-entities-string from)
                date
                (concat "<" group "%"
!                       (number-to-string article) 
                        "@egroup.com>")
                ""
                0 0 "")) nnwarchive-headers))))
--- 469,480 ----
        (push (cons
               article
               (make-full-mail-header
!               article
                (nnweb-decode-entities-string subject)
                (nnweb-decode-entities-string from)
                date
                (concat "<" group "%"
!                       (number-to-string article)
                        "@egroup.com>")
                ""
                0 0 "")) nnwarchive-headers))))
***************
*** 523,529 ****
        (let ((elem (assoc group nnwarchive-headers-cache)))
          (if elem
              (setcdr elem nnwarchive-headers)
!           (push (cons group nnwarchive-headers) 
                  nnwarchive-headers-cache)))))))
  
  (defun nnwarchive-mail-archive-list ()
--- 523,529 ----
        (let ((elem (assoc group nnwarchive-headers-cache)))
          (if elem
              (setcdr elem nnwarchive-headers)
!           (push (cons group nnwarchive-headers)
                  nnwarchive-headers-cache)))))))
  
  (defun nnwarchive-mail-archive-list ()
***************
*** 558,564 ****
        (push (cons
               article
               (make-full-mail-header
!               article 
                (nnweb-decode-entities-string subject)
                (nnweb-decode-entities-string from)
                date
--- 558,564 ----
        (push (cons
               article
               (make-full-mail-header
!               article
                (nnweb-decode-entities-string subject)
                (nnweb-decode-entities-string from)
                date
***************
*** 608,621 ****
        (insert from-r13)
        (let ((message-caesar-translation-table
             (or nnwarchive-caesar-translation-table
!                (setq nnwarchive-caesar-translation-table 
                       (nnwarchive-make-caesar-translation-table)))))
        (message-caesar-region (point-min) (point-max))
        (buffer-string)))))
  
  (defun nnwarchive-mail-archive-article (group article)
!   (let (p refs url mime e 
!         from subject date id 
          done
          (case-fold-search t))
      (save-restriction
--- 608,621 ----
        (insert from-r13)
        (let ((message-caesar-translation-table
             (or nnwarchive-caesar-translation-table
!                (setq nnwarchive-caesar-translation-table
                       (nnwarchive-make-caesar-translation-table)))))
        (message-caesar-region (point-min) (point-max))
        (buffer-string)))))
  
  (defun nnwarchive-mail-archive-article (group article)
!   (let (p refs url mime e
!         from subject date id
          done
          (case-fold-search t))
      (save-restriction
***************
*** 630,638 ****
        (goto-char (point-min))
        (while (search-forward " -->" nil t)
          (replace-match ""))
!       (setq from 
              (or (mail-fetch-field "from")
!                 (nnwarchive-from-r13 
                   (mail-fetch-field "from-r13"))))
        (setq date (mail-fetch-field "date"))
        (setq id (mail-fetch-field "message-id"))
--- 630,638 ----
        (goto-char (point-min))
        (while (search-forward " -->" nil t)
          (replace-match ""))
!       (setq from
              (or (mail-fetch-field "from")
!                 (nnwarchive-from-r13
                   (mail-fetch-field "from-r13"))))
        (setq date (mail-fetch-field "date"))
        (setq id (mail-fetch-field "message-id"))
***************
*** 667,673 ****
        (goto-char (point-max))
        (widen)
        (insert "\n"))
!       (setq p (point)) 
        (when (search-forward "X-Body-of-Message" nil t)
        (forward-line)
        (delete-region p (point))
--- 667,673 ----
        (goto-char (point-max))
        (widen)
        (insert "\n"))
!       (setq p (point))
        (when (search-forward "X-Body-of-Message" nil t)
        (forward-line)
        (delete-region p (point))
***************
*** 679,686 ****
          (if (> (skip-chars-forward "\040\n\r\t") 0)
              (delete-region (point-min) (point)))
          (while (not (eobp))
!           (cond 
!            ((looking-at "<PRE>\r?\n?") 
              (delete-region (match-beginning 0) (match-end 0))
              (setq p (point))
              (when (search-forward "</PRE>" nil t)
--- 679,686 ----
          (if (> (skip-chars-forward "\040\n\r\t") 0)
              (delete-region (point-min) (point)))
          (while (not (eobp))
!           (cond
!            ((looking-at "<PRE>\r?\n?")
              (delete-region (match-beginning 0) (match-end 0))
              (setq p (point))
              (when (search-forward "</PRE>" nil t)
***************
*** 692,706 ****
                  (goto-char (point-max)))))
             ((looking-at "<P><A HREF=\"\\([^\"]+\\)")
              (setq url (match-string 1))
!             (delete-region (match-beginning 0) 
                             (progn (forward-line) (point)))
!             ;; I hate to download the url encode it, then immediately 
              ;; decode it.
              ;; FixMe: Find a better solution to attach the URL.
              ;; Maybe do some hack in external part of mml-generate-mim-1.
              (insert "<#part>"
                      "\n--\nExternal: \n"
!                     (format "<URL:http://www.mail-archive.com/%s/%s>" 
                              group url)
                      "\n--\n"
                      "<#/part>")
--- 692,706 ----
                  (goto-char (point-max)))))
             ((looking-at "<P><A HREF=\"\\([^\"]+\\)")
              (setq url (match-string 1))
!             (delete-region (match-beginning 0)
                             (progn (forward-line) (point)))
!             ;; I hate to download the url encode it, then immediately
              ;; decode it.
              ;; FixMe: Find a better solution to attach the URL.
              ;; Maybe do some hack in external part of mml-generate-mim-1.
              (insert "<#part>"
                      "\n--\nExternal: \n"
!                     (format "<URL:http://www.mail-archive.com/%s/%s>"
                              group url)
                      "\n--\n"
                      "<#/part>")
***************
*** 709,716 ****
              (setq p (point))
              (insert "<#part type=\"text/html\" disposition=inline>")
              (goto-char
!              (if (re-search-forward 
!                   "[\040\n\r\t]*<PRE>\\|[\040\n\r\t]*<P><A HREF=\"" 
                    nil t)
                   (match-beginning 0)
                 (point-max)))
--- 709,716 ----
              (setq p (point))
              (insert "<#part type=\"text/html\" disposition=inline>")
              (goto-char
!              (if (re-search-forward
!                   "[\040\n\r\t]*<PRE>\\|[\040\n\r\t]*<P><A HREF=\""
                    nil t)
                   (match-beginning 0)
                 (point-max)))
***************
*** 736,742 ****
          (insert " " (pop refs)))
        (insert "\n"))
        (when mime
!       (unless (looking-at "$") 
          (search-forward "\n\n" nil t)
          (forward-line -1))
        (narrow-to-region (point) (point-max))
--- 736,742 ----
          (insert " " (pop refs)))
        (insert "\n"))
        (when mime
!       (unless (looking-at "$")
          (search-forward "\n\n" nil t)
          (forward-line -1))
        (narrow-to-region (point) (point-max))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]