[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/gnus/webmail.el [emacs-unicode-2]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/gnus/webmail.el [emacs-unicode-2] |
Date: |
Thu, 09 Sep 2004 07:55:44 -0400 |
Index: emacs/lisp/gnus/webmail.el
diff -c emacs/lisp/gnus/webmail.el:1.3.22.1 emacs/lisp/gnus/webmail.el:1.3.22.2
*** emacs/lisp/gnus/webmail.el:1.3.22.1 Fri Mar 12 00:03:12 2004
--- emacs/lisp/gnus/webmail.el Thu Sep 9 09:36:26 2004
***************
*** 1,5 ****
;;; webmail.el --- interface of web mail
! ;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
;; Author: Shenghuo Zhu <address@hidden>
;; Keywords: hotmail netaddress my-deja netscape
--- 1,5 ----
;;; webmail.el --- interface of web mail
! ;; Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
;; Author: Shenghuo Zhu <address@hidden>
;; Keywords: hotmail netaddress my-deja netscape
***************
*** 48,68 ****
(require 'gnus)
(require 'nnmail)
(require 'mm-util)
(require 'mml)
(eval-when-compile
(ignore-errors
- (require 'w3)
(require 'url)
! (require 'url-cookie)
! (require 'w3-forms)
! (require 'nnweb)))
;; Report failure to find w3 at load time if appropriate.
(eval '(progn
- (require 'w3)
(require 'url)
! (require 'url-cookie)
! (require 'w3-forms)
! (require 'nnweb)))
;;;
--- 48,63 ----
(require 'gnus)
(require 'nnmail)
(require 'mm-util)
+ (require 'mm-url)
(require 'mml)
(eval-when-compile
(ignore-errors
(require 'url)
! (require 'url-cookie)))
;; Report failure to find w3 at load time if appropriate.
(eval '(progn
(require 'url)
! (require 'url-cookie)))
;;;
***************
*** 144,157 ****
(my-deja
(paranoid cookie post)
(address . "www.my-deja.com")
! (open-url "http://www.deja.com/my/pr.xp")
! (open-snarf . webmail-my-deja-open)
(login-url
content
! ("%s" webmail-aux)
! "member_name=%s&pw=%s&go=&priv_opt_MyDeja99="
user password)
- (list-url "http://www.deja.com/rg_gotomail.xp")
(list-snarf . webmail-my-deja-list)
(article-snarf . webmail-my-deja-article)
(trash-url webmail-aux id))))
--- 139,150 ----
(my-deja
(paranoid cookie post)
(address . "www.my-deja.com")
! ;;(open-snarf . webmail-my-deja-open)
(login-url
content
! ("http://mydeja.google.com/cgi-bin/deja/maillogin.py")
! "userid=%s&password=%s"
user password)
(list-snarf . webmail-my-deja-list)
(article-snarf . webmail-my-deja-article)
(trash-url webmail-aux id))))
***************
*** 203,209 ****
(insert "\n---------------- A bug at " str " ------------------\n")
(mapcar #'(lambda (sym)
(if (boundp sym)
! (pp `(setq ,sym ',(eval sym)) (current-buffer))))
'(webmail-type user))
(insert "---------------- webmail buffer ------------------\n\n")
(insert-buffer-substring webmail-buffer)
--- 196,202 ----
(insert "\n---------------- A bug at " str " ------------------\n")
(mapcar #'(lambda (sym)
(if (boundp sym)
! (gnus-pp `(setq ,sym ',(eval sym)))))
'(webmail-type user))
(insert "---------------- webmail buffer ------------------\n\n")
(insert-buffer-substring webmail-buffer)
***************
*** 228,258 ****
(set (intern (concat "webmail-" (symbol-name var))) (cdr pair))
(set (intern (concat "webmail-" (symbol-name var))) nil)))))
- (defun webmail-encode-www-form-urlencoded (pairs)
- "Return PAIRS encoded for forms."
- (mapconcat
- (function
- (lambda (data)
- (concat (w3-form-encode-xwfu (car data)) "="
- (w3-form-encode-xwfu (cdr data)))))
- pairs "&"))
-
- (defun webmail-fetch-simple (url content)
- (let ((url-request-data content)
- (url-request-method "POST")
- (url-request-extra-headers
- '(("Content-type" . "application/x-www-form-urlencoded"))))
- (nnweb-insert url))
- t)
-
- (defun webmail-fetch-form (url pairs)
- (let ((url-request-data (webmail-encode-www-form-urlencoded pairs))
- (url-request-method "POST")
- (url-request-extra-headers
- '(("Content-type" . "application/x-www-form-urlencoded"))))
- (nnweb-insert url))
- t)
-
(defun webmail-eval (expr)
(cond
((consp expr)
--- 221,226 ----
***************
*** 267,281 ****
(cond
((eq (car xurl) 'content)
(pop xurl)
! (webmail-fetch-simple (if (stringp (car xurl))
(car xurl)
(apply 'format (webmail-eval (car xurl))))
(apply 'format (webmail-eval (cdr xurl)))))
((eq (car xurl) 'post)
(pop xurl)
! (webmail-fetch-form (car xurl) (webmail-eval (cdr xurl))))
(t
! (nnweb-insert (apply 'format (webmail-eval xurl)))))))
(defun webmail-init ()
"Initialize buffers and such."
--- 235,249 ----
(cond
((eq (car xurl) 'content)
(pop xurl)
! (mm-url-fetch-simple (if (stringp (car xurl))
(car xurl)
(apply 'format (webmail-eval (car xurl))))
(apply 'format (webmail-eval (cdr xurl)))))
((eq (car xurl) 'post)
(pop xurl)
! (mm-url-fetch-form (car xurl) (webmail-eval (cdr xurl))))
(t
! (mm-url-insert (apply 'format (webmail-eval xurl)))))))
(defun webmail-init ()
"Initialize buffers and such."
***************
*** 317,323 ****
(let ((url (match-string 1)))
(erase-buffer)
(mm-with-unibyte-current-buffer
! (nnweb-insert url)))
(goto-char (point-min))))
(defun webmail-fetch (file subtype user password)
--- 285,291 ----
(let ((url (match-string 1)))
(erase-buffer)
(mm-with-unibyte-current-buffer
! (mm-url-insert url)))
(goto-char (point-min))))
(defun webmail-fetch (file subtype user password)
***************
*** 359,365 ****
(message "Fetching mail #%d..." (setq n (1+ n)))
(erase-buffer)
(mm-with-unibyte-current-buffer
! (nnweb-insert (cdr item)))
(setq id (car item))
(if webmail-article-snarf
(funcall webmail-article-snarf file id))
--- 327,333 ----
(message "Fetching mail #%d..." (setq n (1+ n)))
(erase-buffer)
(mm-with-unibyte-current-buffer
! (mm-url-insert (cdr item)))
(setq id (car item))
(if webmail-article-snarf
(funcall webmail-article-snarf file id))
***************
*** 461,469 ****
(if (not (search-forward "</pre>" nil t))
(webmail-error "address@hidden"))
(delete-region (match-beginning 0) (point-max))
! (nnweb-remove-markup)
! (let ((w3-html-entities (cons '(nbsp . 32) w3-html-entities)))
! (nnweb-decode-entities))
(goto-char (point-min))
(while (re-search-forward "\r\n?" nil t)
(replace-match "\n"))
--- 429,436 ----
(if (not (search-forward "</pre>" nil t))
(webmail-error "address@hidden"))
(delete-region (match-beginning 0) (point-max))
! (mm-url-remove-markup)
! (mm-url-decode-entities-nbsp)
(goto-char (point-min))
(while (re-search-forward "\r\n?" nil t)
(replace-match "\n"))
***************
*** 494,502 ****
(setq p (match-beginning 0))
(search-forward "</a>" nil t)
(delete-region p (match-end 0)))
! (nnweb-remove-markup)
! (let ((w3-html-entities (cons '(nbsp . 32) w3-html-entities)))
! (nnweb-decode-entities))
(goto-char (point-min))
(delete-blank-lines)
(goto-char (point-min))
--- 461,468 ----
(setq p (match-beginning 0))
(search-forward "</a>" nil t)
(delete-region p (match-end 0)))
! (mm-url-remove-markup)
! (mm-url-decode-entities-nbsp)
(goto-char (point-min))
(delete-blank-lines)
(goto-char (point-min))
***************
*** 516,522 ****
(delete-region p (match-end 0))
(save-excursion
(set-buffer (generate-new-buffer " *webmail-att*"))
! (nnweb-insert attachment)
(push (current-buffer) webmail-buffer-list)
(setq bufname (buffer-name)))
(setq mime t)
--- 482,488 ----
(delete-region p (match-end 0))
(save-excursion
(set-buffer (generate-new-buffer " *webmail-att*"))
! (mm-url-insert attachment)
(push (current-buffer) webmail-buffer-list)
(setq bufname (buffer-name)))
(setq mime t)
***************
*** 551,559 ****
(goto-char (match-end 0))
(if (looking-at "$") (forward-char))
(delete-region (point-min) (point))
! (nnweb-remove-markup)
! (let ((w3-html-entities (cons '(nbsp . 32) w3-html-entities)))
! (nnweb-decode-entities))
nil)
(t
(setq mime t)
--- 517,524 ----
(goto-char (match-end 0))
(if (looking-at "$") (forward-char))
(delete-region (point-min) (point))
! (mm-url-remove-markup)
! (mm-url-decode-entities-nbsp)
nil)
(t
(setq mime t)
***************
*** 648,656 ****
(setq p (match-beginning 0))
(search-forward "</a>" nil t)
(delete-region p (match-end 0)))
! (nnweb-remove-markup)
! (let ((w3-html-entities (cons '(nbsp . 32) w3-html-entities)))
! (nnweb-decode-entities))
(goto-char (point-min))
(delete-blank-lines)
(goto-char (point-max))
--- 613,620 ----
(setq p (match-beginning 0))
(search-forward "</a>" nil t)
(delete-region p (match-end 0)))
! (mm-url-remove-markup)
! (mm-url-decode-entities-nbsp)
(goto-char (point-min))
(delete-blank-lines)
(goto-char (point-max))
***************
*** 666,674 ****
(if (not (search-forward "</table>" nil t))
(webmail-error "address@hidden"))
(narrow-to-region p (match-end 0))
! (nnweb-remove-markup)
! (let ((w3-html-entities (cons '(nbsp . 32) w3-html-entities)))
! (nnweb-decode-entities))
(goto-char (point-min))
(delete-blank-lines)
(setq ct (mail-fetch-field "content-type")
--- 630,637 ----
(if (not (search-forward "</table>" nil t))
(webmail-error "address@hidden"))
(narrow-to-region p (match-end 0))
! (mm-url-remove-markup)
! (mm-url-decode-entities-nbsp)
(goto-char (point-min))
(delete-blank-lines)
(setq ct (mail-fetch-field "content-type")
***************
*** 681,687 ****
(widen)
(save-excursion
(set-buffer (generate-new-buffer " *webmail-att*"))
! (nnweb-insert (concat webmail-aux attachment))
(push (current-buffer) webmail-buffer-list)
(setq bufname (buffer-name)))
(insert "<#part")
--- 644,650 ----
(widen)
(save-excursion
(set-buffer (generate-new-buffer " *webmail-att*"))
! (mm-url-insert (concat webmail-aux attachment))
(push (current-buffer) webmail-buffer-list)
(setq bufname (buffer-name)))
(insert "<#part")
***************
*** 776,784 ****
(goto-char (point-min))
(while (re-search-forward "<br>" nil t)
(replace-match "\n"))
! (nnweb-remove-markup)
! (let ((w3-html-entities (cons '(nbsp . 32) w3-html-entities)))
! (nnweb-decode-entities))
nil)
(t
(insert "<#part type=\"text/html\" disposition=inline>")
--- 739,746 ----
(goto-char (point-min))
(while (re-search-forward "<br>" nil t)
(replace-match "\n"))
! (mm-url-remove-markup)
! (mm-url-decode-entities-nbsp)
nil)
(t
(insert "<#part type=\"text/html\" disposition=inline>")
***************
*** 806,814 ****
(goto-char (point-min))
(while (search-forward "<b>" nil t)
(replace-match "\n"))
! (nnweb-remove-markup)
! (let ((w3-html-entities (cons '(nbsp . 32) w3-html-entities)))
! (nnweb-decode-entities))
(goto-char (point-min))
(delete-blank-lines)
(goto-char (point-min))
--- 768,775 ----
(goto-char (point-min))
(while (search-forward "<b>" nil t)
(replace-match "\n"))
! (mm-url-remove-markup)
! (mm-url-decode-entities-nbsp)
(goto-char (point-min))
(delete-blank-lines)
(goto-char (point-min))
***************
*** 850,856 ****
(let (bufname);; Attachment
(save-excursion
(set-buffer (generate-new-buffer " *webmail-att*"))
! (nnweb-insert (concat (car webmail-open-url) attachment))
(push (current-buffer) webmail-buffer-list)
(setq bufname (buffer-name)))
(insert "<#part type=" type)
--- 811,817 ----
(let (bufname);; Attachment
(save-excursion
(set-buffer (generate-new-buffer " *webmail-att*"))
! (mm-url-insert (concat (car webmail-open-url) attachment))
(push (current-buffer) webmail-buffer-list)
(setq bufname (buffer-name)))
(insert "<#part type=" type)
***************
*** 934,942 ****
(goto-char (point-min))
(while (search-forward "<b>" nil t)
(replace-match "\n"))
! (nnweb-remove-markup)
! (let ((w3-html-entities (cons '(nbsp . 32) w3-html-entities)))
! (nnweb-decode-entities))
(goto-char (point-min))
(delete-blank-lines)
(goto-char (point-min))
--- 895,902 ----
(goto-char (point-min))
(while (search-forward "<b>" nil t)
(replace-match "\n"))
! (mm-url-remove-markup)
! (mm-url-decode-entities-nbsp)
(goto-char (point-min))
(delete-blank-lines)
(goto-char (point-min))
***************
*** 978,984 ****
(let (bufname);; Attachment
(save-excursion
(set-buffer (generate-new-buffer " *webmail-att*"))
! (nnweb-insert (concat (car webmail-open-url) attachment))
(push (current-buffer) webmail-buffer-list)
(setq bufname (buffer-name)))
(insert "<#part type=" type)
--- 938,944 ----
(let (bufname);; Attachment
(save-excursion
(set-buffer (generate-new-buffer " *webmail-att*"))
! (mm-url-insert (concat (car webmail-open-url) attachment))
(push (current-buffer) webmail-buffer-list)
(setq bufname (buffer-name)))
(insert "<#part type=" type)
***************
*** 1045,1051 ****
(defun webmail-my-deja-open ()
(webmail-refresh-redirect)
(goto-char (point-min))
! (if (re-search-forward "action=\"\\([^\"]+login_confirm\\.xp[^\"]*\\)\""
nil t)
(setq webmail-aux (match-string 1))
(webmail-error "address@hidden")))
--- 1005,1011 ----
(defun webmail-my-deja-open ()
(webmail-refresh-redirect)
(goto-char (point-min))
! (if (re-search-forward "action=\"\\([^\"]+maillogin\\.py[^\"]*\\)\""
nil t)
(setq webmail-aux (match-string 1))
(webmail-error "address@hidden")))
***************
*** 1058,1064 ****
(let ((url (match-string 1)))
(setq base (match-string 2))
(erase-buffer)
! (nnweb-insert url)))
(goto-char (point-min))
(when (re-search-forward
"(\\([0-9]+\\) Message.?-[^>]*\\([0-9]+\\) New"
--- 1018,1024 ----
(let ((url (match-string 1)))
(setq base (match-string 2))
(erase-buffer)
! (mm-url-insert url)))
(goto-char (point-min))
(when (re-search-forward
"(\\([0-9]+\\) Message.?-[^>]*\\([0-9]+\\) New"
***************
*** 1095,1103 ****
(match-beginning 0)
(point-max)))
(goto-char (point-min))
! (nnweb-remove-markup)
! (let ((w3-html-entities (cons '(nbsp . 32) w3-html-entities)))
! (nnweb-decode-entities))
(goto-char (point-max))))
((looking-at "[\t\040\r\n]*<TABLE")
(save-restriction
--- 1055,1062 ----
(match-beginning 0)
(point-max)))
(goto-char (point-min))
! (mm-url-remove-markup)
! (mm-url-decode-entities-nbsp)
(goto-char (point-max))))
((looking-at "[\t\040\r\n]*<TABLE")
(save-restriction
***************
*** 1126,1132 ****
(delete-region (point-min) (point-max))
(save-excursion
(set-buffer (generate-new-buffer " *webmail-att*"))
! (nnweb-insert url)
(push (current-buffer) webmail-buffer-list)
(setq bufname (buffer-name)))
(insert "<#part type=\"" type "\"")
--- 1085,1091 ----
(delete-region (point-min) (point-max))
(save-excursion
(set-buffer (generate-new-buffer " *webmail-att*"))
! (mm-url-insert url)
(push (current-buffer) webmail-buffer-list)
(setq bufname (buffer-name)))
(insert "<#part type=\"" type "\"")
***************
*** 1159,1167 ****
(narrow-to-region (point-min) (point))
(while (search-forward "\r\n" nil t)
(replace-match "\n"))
! (nnweb-remove-markup)
! (let ((w3-html-entities (cons '(nbsp . 32) w3-html-entities)))
! (nnweb-decode-entities))
(goto-char (point-min))
(while (re-search-forward "\n\n+" nil t)
(replace-match "\n"))
--- 1118,1125 ----
(narrow-to-region (point-min) (point))
(while (search-forward "\r\n" nil t)
(replace-match "\n"))
! (mm-url-remove-markup)
! (mm-url-decode-entities-nbsp)
(goto-char (point-min))
(while (re-search-forward "\n\n+" nil t)
(replace-match "\n"))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/gnus/webmail.el [emacs-unicode-2],
Miles Bader <=