changeset 110297:95864039082f

Merge changes made in Gnus trunk. gnus-html.el (gnus-html-wash-tags): Refactor out the image bit, and don't restrict end-tag searches to the end of the line. Remove pop3-movemail and rename pop3-streaming-movemail to pop3-movemail.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Fri, 10 Sep 2010 00:10:20 +0000
parents 3afdbf4cdf4b (current diff) ef15e8533a1c (diff)
children dd7892bf6d8d 8e82c01724e1
files
diffstat 4 files changed, 24 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Thu Sep 09 15:24:39 2010 +0200
+++ b/lisp/gnus/ChangeLog	Fri Sep 10 00:10:20 2010 +0000
@@ -1,3 +1,13 @@
+2010-09-09  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* mail-source.el (mail-source-fetch-pop): Use pop3-movemail again.
+
+	* pop3.el (pop3-movemail): Removed.
+	(pop3-streaming-movemail): Renamed to pop3-movemail.
+
+	* gnus-html.el (gnus-html-wash-tags): Refactor out the image bit, and
+	don't restrict end-tag searches to the end of the line.
+
 2010-09-09  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* gnus-start.el (gnus-get-unread-articles): Set the number of unread
--- a/lisp/gnus/gnus-html.el	Thu Sep 09 15:24:39 2010 +0200
+++ b/lisp/gnus/gnus-html.el	Fri Sep 10 00:10:20 2010 +0000
@@ -128,11 +128,9 @@
   (while (re-search-forward "<a name[^\n>]+>" nil t)
     (replace-match "" t t)))
 
-(defun gnus-html-wash-tags ()
+(defun gnus-html-wash-images ()
   (let (tag parameters string start end images url)
-    (gnus-html-pre-wash)
     (goto-char (point-min))
-
     ;; Search for all the images first.
     (while (re-search-forward "<img_alt \\([^>]*\\)>" nil t)
       (setq parameters (match-string 1)
@@ -210,6 +208,13 @@
 			      (set-marker (make-marker) start)
 			      (point-marker))
 			images))))))))
+    (when images
+      (gnus-html-schedule-image-fetching (current-buffer) (nreverse images)))))
+
+(defun gnus-html-wash-tags ()
+  (let (tag parameters string start end images url)
+    (gnus-html-pre-wash)
+    (gnus-html-wash-images)
 
     (goto-char (point-min))
     ;; Then do the other tags.
@@ -220,7 +225,7 @@
       (when (plusp (length parameters))
 	(set-text-properties 0 (1- (length parameters)) nil parameters))
       (delete-region start (point))
-      (when (search-forward (concat "</" tag ">") (line-end-position) t)
+      (when (search-forward (concat "</" tag ">") nil t)
 	(delete-region (match-beginning 0) (match-end 0)))
       (setq end (point))
       (cond
@@ -254,8 +259,6 @@
     ;; off any </pre_int>s that were left over.
     (while (re-search-forward "</pre_int>\\|</internal>" nil t)
       (replace-match "" t t))
-    (when images
-      (gnus-html-schedule-image-fetching (current-buffer) (nreverse images)))
     (mm-url-decode-entities)))
 
 (defun gnus-html-insert-image ()
--- a/lisp/gnus/mail-source.el	Thu Sep 09 15:24:39 2010 +0200
+++ b/lisp/gnus/mail-source.el	Fri Sep 10 00:10:20 2010 +0000
@@ -34,7 +34,7 @@
   (require 'cl)
   (require 'imap))
 (autoload 'auth-source-user-or-password "auth-source")
-(autoload 'pop3-streaming-movemail "pop3")
+(autoload 'pop3-movemail "pop3")
 (autoload 'pop3-get-message-count "pop3")
 (autoload 'nnheader-cancel-timer "nnheader")
 (require 'mm-util)
@@ -839,11 +839,9 @@
 		     (if (eq authentication 'apop) 'apop 'pass))
 		    (pop3-stream-type stream))
 		(if (or debug-on-quit debug-on-error)
-		    (save-excursion (pop3-streaming-movemail
-				     mail-source-crash-box))
+		    (save-excursion (pop3-movemail mail-source-crash-box))
 		  (condition-case err
-		      (save-excursion (pop3-streaming-movemail
-				       mail-source-crash-box))
+		      (save-excursion (pop3-movemail mail-source-crash-box))
 		    (error
 		     ;; We nix out the password in case the error
 		     ;; was because of a wrong password being given.
--- a/lisp/gnus/pop3.el	Thu Sep 09 15:24:39 2010 +0200
+++ b/lisp/gnus/pop3.el	Fri Sep 10 00:10:20 2010 +0000
@@ -129,7 +129,8 @@
 		       (truncate pop3-read-timeout))
 		    1000))))))
 
-(defun pop3-streaming-movemail (file)
+;;;###autoload
+(defun pop3-movemail (file)
   "Transfer contents of a maildrop to the specified FILE.
 Use streaming commands."
   (let* ((process (pop3-open-server pop3-mailhost pop3-port))
@@ -227,44 +228,6 @@
 	   (pop3-pass process))
 	  (t (error "Invalid POP3 authentication scheme")))))
 
-(defun pop3-movemail (&optional crashbox)
-  "Transfer contents of a maildrop to the specified CRASHBOX."
-  (or crashbox (setq crashbox (expand-file-name "~/.crashbox")))
-  (let* ((process (pop3-open-server pop3-mailhost pop3-port))
-	 (crashbuf (get-buffer-create " *pop3-retr*"))
-	 (n 1)
-	 message-count
-	 message-sizes)
-    (pop3-logon process)
-    (setq message-count (car (pop3-stat process)))
-    (when (> message-count 0)
-      (setq message-sizes (pop3-list process)))
-    (unwind-protect
-	(while (<= n message-count)
-	  (message "Retrieving message %d of %d from %s... (%.1fk)"
-		   n message-count pop3-mailhost
-		   (/ (cdr (assoc n message-sizes))
-		      1024.0))
-	  (pop3-retr process n crashbuf)
-	  (save-excursion
-	    (set-buffer crashbuf)
-	    (let ((coding-system-for-write 'binary))
-	      (write-region (point-min) (point-max) crashbox t 'nomesg))
-	    (set-buffer (process-buffer process))
-	    (erase-buffer))
-          (unless pop3-leave-mail-on-server
-            (pop3-dele process n))
-	  (setq n (+ 1 n))
-	  (pop3-accept-process-output process))
-      (when (and pop3-leave-mail-on-server
-		 (> n 1))
-	(message "pop3.el doesn't support UIDL.  Setting `pop3-leave-mail-on-server'
-to %s might not give the result you'd expect." pop3-leave-mail-on-server)
-	(sit-for 1))
-      (pop3-quit process))
-    (kill-buffer crashbuf))
-  t)
-
 (defun pop3-get-message-count ()
   "Return the number of messages in the maildrop."
   (let* ((process (pop3-open-server pop3-mailhost pop3-port))