aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2000-05-08 17:59:45 +0000
committerDave Love2000-05-08 17:59:45 +0000
commit4cac7481eeb35835e306a3287dfb4523d8935bd4 (patch)
tree13404a698b674535a83acded088d41d2fea27ebd
parent6abca616a3ac6770633fc9b70e9dd0e628bf08be (diff)
downloademacs-4cac7481eeb35835e306a3287dfb4523d8935bd4.tar.gz
emacs-4cac7481eeb35835e306a3287dfb4523d8935bd4.zip
Import changes from current Gnus.
(pop3-open-server): Bind coding systems before creating buffer and fix creating its name. (pop3-string-to-list): Function deleted. Change callers to use split-string.
-rw-r--r--lisp/gnus/ChangeLog8
-rw-r--r--lisp/gnus/pop3.el52
2 files changed, 24 insertions, 36 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index b4e5a3f6d3e..7cd2d0af6a1 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,11 @@
12000-05-08 Dave Love <fx@gnu.org>
2
3 * pop3.el: Import changes from current Gnus.
4 (pop3-open-server): Bind coding systems before creating buffer and
5 fix creating its name.
6 (pop3-string-to-list): Function deleted. Change callers to use
7 split-string.
8
11999-12-19 Dave Love <fx@gnu.org> 91999-12-19 Dave Love <fx@gnu.org>
2 10
3 * mail/pop3.el (pop3-movemail-file-coding-system): Doc fix. 11 * mail/pop3.el (pop3-movemail-file-coding-system): Doc fix.
diff --git a/lisp/gnus/pop3.el b/lisp/gnus/pop3.el
index 1ea3b0a2c74..9b75b120242 100644
--- a/lisp/gnus/pop3.el
+++ b/lisp/gnus/pop3.el
@@ -114,25 +114,20 @@ Used for APOP authentication.")
114(defun pop3-open-server (mailhost port) 114(defun pop3-open-server (mailhost port)
115 "Open TCP connection to MAILHOST on PORT. 115 "Open TCP connection to MAILHOST on PORT.
116Returns the process associated with the connection." 116Returns the process associated with the connection."
117 (let ((process-buffer 117 (let ((coding-system-for-read 'binary)
118 (get-buffer-create (format "trace of POP session to %s" mailhost)))
119 (process)
120 (coding-system-for-read 'binary)
121 (coding-system-for-write 'binary) 118 (coding-system-for-write 'binary)
122 ) 119 process)
123 (save-excursion 120 (save-excursion
124 (set-buffer process-buffer) 121 (set-buffer (get-buffer-create (concat " trace of POP session to "
122 mailhost)))
125 (erase-buffer) 123 (erase-buffer)
126 (setq pop3-read-point (point-min)) 124 (setq pop3-read-point (point-min))
127 ) 125 (setq process (open-network-stream "POP"(current-buffer) mailhost port))
128 (setq process 126 (let ((response (pop3-read-response process t)))
129 (open-network-stream "POP" process-buffer mailhost port)) 127 (setq pop3-timestamp
130 (let ((response (pop3-read-response process t))) 128 (substring response (or (string-match "<" response) 0)
131 (setq pop3-timestamp 129 (+ 1 (or (string-match ">" response) -1)))))
132 (substring response (or (string-match "<" response) 0) 130 process)))
133 (+ 1 (or (string-match ">" response) -1)))))
134 process
135 ))
136 131
137;; Support functions 132;; Support functions
138 133
@@ -176,22 +171,6 @@ Return the response string if optional second argument is non-nil."
176 t) 171 t)
177 ))))) 172 )))))
178 173
179(defun pop3-string-to-list (string &optional regexp)
180 "Chop up a string into a list."
181 (let ((list)
182 (regexp (or regexp " "))
183 (string (if (string-match "\r" string)
184 (substring string 0 (match-beginning 0))
185 string)))
186 (store-match-data nil)
187 (while string
188 (if (string-match regexp string)
189 (setq list (cons (substring string 0 (- (match-end 0) 1)) list)
190 string (substring string (match-end 0)))
191 (setq list (cons string list)
192 string nil)))
193 (nreverse list)))
194
195(defvar pop3-read-passwd nil) 174(defvar pop3-read-passwd nil)
196(defun pop3-read-passwd (prompt) 175(defun pop3-read-passwd (prompt)
197 (if (not pop3-read-passwd) 176 (if (not pop3-read-passwd)
@@ -227,8 +206,9 @@ Return the response string if optional second argument is non-nil."
227 (looking-at "BABYL OPTIONS:") ; Babyl 206 (looking-at "BABYL OPTIONS:") ; Babyl
228 )) 207 ))
229 (let ((from (mail-strip-quoted-names (mail-fetch-field "From"))) 208 (let ((from (mail-strip-quoted-names (mail-fetch-field "From")))
230 (date (pop3-string-to-list (or (mail-fetch-field "Date") 209 (date (split-string (or (mail-fetch-field "Date")
231 (message-make-date)))) 210 (message-make-date))
211 " "))
232 (From_)) 212 (From_))
233 ;; sample date formats I have seen 213 ;; sample date formats I have seen
234 ;; Date: Tue, 9 Jul 1996 09:04:21 -0400 (EDT) 214 ;; Date: Tue, 9 Jul 1996 09:04:21 -0400 (EDT)
@@ -314,8 +294,8 @@ Return the response string if optional second argument is non-nil."
314 "Return the number of messages in the maildrop and the maildrop's size." 294 "Return the number of messages in the maildrop and the maildrop's size."
315 (pop3-send-command process "STAT") 295 (pop3-send-command process "STAT")
316 (let ((response (pop3-read-response process t))) 296 (let ((response (pop3-read-response process t)))
317 (list (string-to-int (nth 1 (pop3-string-to-list response))) 297 (list (string-to-int (nth 1 (split-string response " ")))
318 (string-to-int (nth 2 (pop3-string-to-list response)))) 298 (string-to-int (nth 2 (split-string response " "))))
319 )) 299 ))
320 300
321(defun pop3-list (process &optional msg) 301(defun pop3-list (process &optional msg)
@@ -377,7 +357,7 @@ This function currently does nothing.")
377 "Return highest accessed message-id number for the session." 357 "Return highest accessed message-id number for the session."
378 (pop3-send-command process "LAST") 358 (pop3-send-command process "LAST")
379 (let ((response (pop3-read-response process t))) 359 (let ((response (pop3-read-response process t)))
380 (string-to-int (nth 1 (pop3-string-to-list response))) 360 (string-to-int (nth 1 (split-string response " ")))
381 )) 361 ))
382 362
383(defun pop3-rset (process) 363(defun pop3-rset (process)