aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/gnus
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus')
-rw-r--r--lisp/gnus/ChangeLog35
-rw-r--r--lisp/gnus/gnus-msg.el2
-rw-r--r--lisp/gnus/gnus-start.el11
-rw-r--r--lisp/gnus/nnmail.el3
-rw-r--r--lisp/gnus/nnml.el9
-rw-r--r--lisp/gnus/nntp.el45
-rw-r--r--lisp/gnus/pop3.el25
7 files changed, 103 insertions, 27 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 9b9f026f27..212c071116 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -88,6 +88,41 @@
* gnus-demon.el (gnus-demon):
* gnus-uu.el (gnus-uu-default-view-rules): Fix typos in docstrings.
+2007-11-15 Katsumi Yamaoka <[email protected]>
+
+ * nntp.el (nntp-insert-buffer-substring, nntp-copy-to-buffer): New
+ macros.
+ (nntp-wait-for, nntp-retrieve-articles, nntp-async-trigger)
+ (nntp-retrieve-headers-with-xover): Use nntp-insert-buffer-substring to
+ copy data from unibyte buffer to multibyte current buffer.
+ (nntp-retrieve-headers, nntp-retrieve-groups); Use nntp-copy-to-buffer
+ to copy data from unibyte current buffer to multibyte buffer.
+ (nntp-make-process-buffer): Make process buffer unibyte.
+
+ * pop3.el (pop3-open-server): Fix typo in Lisp code.
+
+2007-11-14 Denys Duchier <[email protected]> (tiny change)
+
+ * pop3.el (pop3-open-server): Accept and process data more robustly at
+ connexion start to avoid spurious "POP SSL connexion failed" errors.
+
+2007-11-14 Katsumi Yamaoka <[email protected]>
+
+ * gnus-start.el (gnus-active-to-gnus-format): Use unibyte buffer to
+ read group names.
+
+2007-11-12 Reiner Steib <[email protected]>
+
+ * gnus-msg.el (gnus-confirm-mail-reply-to-news): Adjust :version.
+
+2007-11-12 Katsumi Yamaoka <[email protected]>
+
+ * nnmail.el (nnmail-parse-active): Make group names unibyte.
+ (nnmail-save-active): Use a unibyte buffer when saving active file,
+ which may contain non-ASCII group names.
+
+ * nnml.el (nnml-request-group): Decode group names in messages.
+
2007-11-05 Reiner Steib <[email protected]>
* message.el (message-citation-line-function)
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index 891ed1bc26..f5bf3a7ef6 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -265,7 +265,7 @@ This can also be a function receiving the group name as the only
parameter, which should return non-nil if a confirmation is needed; or
a regexp, in which case a confirmation is asked for if the group name
matches the regexp."
- :version "22.1"
+ :version "23.0" ;; No Gnus (default changed)
:group 'gnus-message
:type '(choice (const :tag "No" nil)
(const :tag "Yes" t)
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index e58187548b..98994d5aaf 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -2103,7 +2103,8 @@ If SCAN, request a scan of that group as well."
(if (equal method gnus-select-method)
(gnus-make-hashtable
(count-lines (point-min) (point-max)))
- (gnus-make-hashtable 4096)))))))
+ (gnus-make-hashtable 4096))))))
+ group max min)
;; Delete unnecessary lines.
(goto-char (point-min))
(cond
@@ -2138,8 +2139,12 @@ If SCAN, request a scan of that group as well."
(insert prefix)
(zerop (forward-line 1)))))))
;; Store the active file in a hash table.
- (goto-char (point-min))
- (let (group max min)
+ ;; Use a unibyte buffer in order to make `read' read non-ASCII
+ ;; group names (which have been encoded) as unibyte strings.
+ (mm-with-unibyte-buffer
+ (insert-buffer-substring cur)
+ (setq cur (current-buffer))
+ (goto-char (point-min))
(while (not (eobp))
(condition-case ()
(progn
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index 7608660f01..8ff6d1d145 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -693,7 +693,7 @@ nn*-request-list should have been called before calling this function."
(setq group (symbol-name group)))
(if (and (numberp (setq max (read buffer)))
(numberp (setq min (read buffer))))
- (push (list group (cons min max))
+ (push (list (mm-string-as-unibyte group) (cons min max))
group-assoc)))
(error nil))
(widen)
@@ -708,6 +708,7 @@ nn*-request-list should have been called before calling this function."
(let ((coding-system-for-write nnmail-active-file-coding-system))
(when file-name
(with-temp-file file-name
+ (mm-disable-multibyte)
(nnmail-generate-active group-assoc)))))
(defun nnmail-generate-active (alist)
diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el
index f483636418..8a5afbe5b6 100644
--- a/lisp/gnus/nnml.el
+++ b/lisp/gnus/nnml.el
@@ -258,7 +258,8 @@ non-nil.")
(string-to-number (file-name-nondirectory path)))))))
(deffoo nnml-request-group (group &optional server dont-check)
- (let ((file-name-coding-system nnmail-pathname-coding-system))
+ (let ((file-name-coding-system nnmail-pathname-coding-system)
+ (decoded (nnml-decoded-group-name group server)))
(cond
((not (nnml-possibly-change-directory group server))
(nnheader-report 'nnml "Invalid group (no such directory)"))
@@ -268,15 +269,15 @@ non-nil.")
((not (file-directory-p nnml-current-directory))
(nnheader-report 'nnml "%s is not a directory" nnml-current-directory))
(dont-check
- (nnheader-report 'nnml "Group %s selected" group)
+ (nnheader-report 'nnml "Group %s selected" decoded)
t)
(t
(nnheader-re-read-dir nnml-current-directory)
(nnmail-activate 'nnml)
(let ((active (nth 1 (assoc group nnml-group-alist))))
(if (not active)
- (nnheader-report 'nnml "No such group: %s" group)
- (nnheader-report 'nnml "Selected group %s" group)
+ (nnheader-report 'nnml "No such group: %s" decoded)
+ (nnheader-report 'nnml "Selected group %s" decoded)
(nnheader-insert "211 %d %d %d %s\n"
(max (1+ (- (cdr active) (car active))) 0)
(car active) (cdr active) group)))))))
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index c8c14da4df..356ffefdde 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -364,6 +364,32 @@ be restored and the command retried."
(throw 'nntp-with-open-group-error t))
+(defmacro nntp-insert-buffer-substring (buffer &optional start end)
+ "Copy string from unibyte buffer to multibyte current buffer."
+ (if (featurep 'xemacs)
+ `(insert-buffer-substring ,buffer ,start ,end)
+ `(if enable-multibyte-characters
+ (insert (with-current-buffer ,buffer
+ (mm-string-to-multibyte
+ ,(if (or start end)
+ `(buffer-substring (or ,start (point-min))
+ (or ,end (point-max)))
+ '(buffer-string)))))
+ (insert-buffer-substring ,buffer ,start ,end))))
+
+(defmacro nntp-copy-to-buffer (buffer start end)
+ "Copy string from unibyte current buffer to multibyte buffer."
+ (if (featurep 'xemacs)
+ `(copy-to-buffer ,buffer ,start ,end)
+ `(let ((string (buffer-substring ,start ,end)))
+ (with-current-buffer ,buffer
+ (erase-buffer)
+ (insert (if enable-multibyte-characters
+ (mm-string-to-multibyte string)
+ string))
+ (goto-char (point-min))
+ nil))))
+
(defsubst nntp-wait-for (process wait-for buffer &optional decode discard)
"Wait for WAIT-FOR to arrive from PROCESS."
@@ -409,7 +435,7 @@ be restored and the command retried."
(save-excursion
(set-buffer buffer)
(goto-char (point-max))
- (insert-buffer-substring (process-buffer process))
+ (nntp-insert-buffer-substring (process-buffer process))
;; Nix out "nntp reading...." message.
(when nntp-have-messaged
(setq nntp-have-messaged nil)
@@ -653,7 +679,7 @@ command whose response triggered the error."
nntp-server-buffer))
(buffer (and process
(process-buffer process))))
- ;; When I an able to identify the
+ ;; When I am able to identify the
;; connection to the server AND I've
;; received NO reponse for
;; nntp-connection-timeout seconds.
@@ -738,7 +764,7 @@ command whose response triggered the error."
(nnheader-fold-continuation-lines)
;; Remove all "\r"'s.
(nnheader-strip-cr)
- (copy-to-buffer nntp-server-buffer (point-min) (point-max))
+ (nntp-copy-to-buffer nntp-server-buffer (point-min) (point-max))
'headers)))))
(deffoo nntp-retrieve-groups (groups &optional server)
@@ -820,7 +846,8 @@ command whose response triggered the error."
(if (not nntp-server-list-active-group)
(progn
- (copy-to-buffer nntp-server-buffer (point-min) (point-max))
+ (nntp-copy-to-buffer nntp-server-buffer
+ (point-min) (point-max))
'group)
;; We have read active entries, so we just delete the
;; superfluous gunk.
@@ -828,7 +855,7 @@ command whose response triggered the error."
(while (re-search-forward "^[.2-5]" nil t)
(delete-region (match-beginning 0)
(progn (forward-line 1) (point))))
- (copy-to-buffer nntp-server-buffer (point-min) (point-max))
+ (nntp-copy-to-buffer nntp-server-buffer (point-min) (point-max))
'active)))))))
(deffoo nntp-retrieve-articles (articles &optional group server)
@@ -893,7 +920,7 @@ command whose response triggered the error."
(narrow-to-region
(setq point (goto-char (point-max)))
(progn
- (insert-buffer-substring buf last-point (cdr entry))
+ (nntp-insert-buffer-substring buf last-point (cdr entry))
(point-max)))
(setq last-point (cdr entry))
(nntp-decode-text)
@@ -1206,7 +1233,7 @@ password contained in '~/.nntp-authinfo'."
(format " *server %s %s %s*"
nntp-address nntp-port-number
(gnus-buffer-exists-p buffer))))
- (mm-enable-multibyte)
+ (mm-disable-multibyte)
(set (make-local-variable 'after-change-functions) nil)
(set (make-local-variable 'nntp-process-wait-for) nil)
(set (make-local-variable 'nntp-process-callback) nil)
@@ -1390,7 +1417,7 @@ password contained in '~/.nntp-authinfo'."
(goto-char (point-max))
(save-restriction
(narrow-to-region (point) (point))
- (insert-buffer-substring buf start)
+ (nntp-insert-buffer-substring buf start)
(when decode
(nntp-decode-text))))))
;; report it.
@@ -1619,7 +1646,7 @@ password contained in '~/.nntp-authinfo'."
(when in-process-buffer-p
(set-buffer buf)
(goto-char (point-max))
- (insert-buffer-substring process-buffer)
+ (nntp-insert-buffer-substring process-buffer)
(set-buffer process-buffer)
(erase-buffer)
(set-buffer buf))
diff --git a/lisp/gnus/pop3.el b/lisp/gnus/pop3.el
index 595d0c2ff6..d152c2480a 100644
--- a/lisp/gnus/pop3.el
+++ b/lisp/gnus/pop3.el
@@ -242,16 +242,23 @@ Returns the process associated with the connection."
mailhost port)))
(when process
;; There's a load of info printed that needs deleting.
- (while (when (memq (process-status process) '(open run))
- (pop3-accept-process-output process)
- (goto-char (point-max))
- (forward-line -1)
- (if (looking-at "\\+OK")
- (progn
- (delete-region (point-min) (point))
- nil)
+ (let ((again 't))
+ ;; repeat until
+ ;; - either we received the +OK line
+ ;; - or accept-process-output timed out without getting
+ ;; anything
+ (while (and again
+ (setq again (memq (process-status process)
+ '(open run))))
+ (setq again (pop3-accept-process-output process))
+ (goto-char (point-max))
+ (forward-line -1)
+ (cond ((looking-at "\\+OK")
+ (setq again nil)
+ (delete-region (point-min) (point)))
+ ((not again)
(pop3-quit process)
- (error "POP SSL connexion failed"))))
+ (error "POP SSL connexion failed")))))
process)))
((eq pop3-stream-type 'starttls)
;; gnutls-cli, openssl don't accept service names