Support UTF-8 group names better.
* message.el (message-check-news-header-syntax): Encode group
names before comparison.
* gnus-msg.el (gnus-copy-article-buffer): Run all
`gnus-article-decode-hook's except `article-decode-charset'
instead of hardcoding call to one of them.
* gnus-art.el (gnus-article-decode-hook): Add
`article-decode-group-name'.
(article-decode-group-name): New function, use `g-d-n'.
* gnus-group.el (gnus-group-insert-group-line): Decode
gnus-tmp-group using `g-d-n'.
* gnus-util.el (gnus-decode-newsgroups): New function.
+2001-10-06 Simon Josefsson <jas@extundo.com>
+
+ Support UTF-8 group names better.
+
+ * message.el (message-check-news-header-syntax): Encode group
+ names before comparison.
+
+ * gnus-msg.el (gnus-copy-article-buffer): Run all
+ `gnus-article-decode-hook's except `article-decode-charset'
+ instead of hardcoding call to one of them.
+
+ * gnus-art.el (gnus-article-decode-hook): Add
+ `article-decode-group-name'.
+ (article-decode-group-name): New function, use `g-d-n'.
+
+ * gnus-group.el (gnus-group-insert-group-line): Decode
+ gnus-tmp-group using `g-d-n'.
+
+ * gnus-util.el (gnus-decode-newsgroups): New function.
+
2001-10-06 Per Abrahamsen <abraham@dina.kvl.dk>
* gnus-srvr.el (gnus-browse-foreign-server): Fixed bug non-nil
(face :value default)))))
(defcustom gnus-article-decode-hook
- '(article-decode-charset article-decode-encoded-words)
+ '(article-decode-charset article-decode-encoded-words
+ article-decode-group-name)
"*Hook run to decode charsets in articles."
:group 'gnus-article-headers
:type 'hook)
(article-narrow-to-head)
(funcall gnus-decode-header-function (point-min) (point-max)))))
+(defun article-decode-group-name ()
+ "Decode group names in `Newsgroups:'."
+ (let ((inhibit-point-motion-hooks t)
+ buffer-read-only
+ (method (gnus-find-method-for-group gnus-newsgroup-name)))
+ (when (and (or gnus-group-name-charset-method-alist
+ gnus-group-name-charset-group-alist)
+ (gnus-buffer-live-p gnus-original-article-buffer)
+ (mail-fetch-field "Newsgroups"))
+ (nnheader-replace-header "Newsgroups"
+ (gnus-decode-newsgroups
+ (with-current-buffer
+ gnus-original-article-buffer
+ (mail-fetch-field "Newsgroups"))
+ gnus-newsgroup-name method)))))
+
(defun article-de-quoted-unreadable (&optional force read-charset)
"Translate a quoted-printable-encoded article.
If FORCE, decode the article whether it is marked as quoted-printable
(point)
(prog1 (1+ (point))
;; Insert the text.
- (eval gnus-group-line-format-spec))
+ (let ((gnus-tmp-group (gnus-group-name-decode
+ gnus-tmp-group group-name-charset)))
+ (eval gnus-group-line-format-spec)))
`(gnus-group ,(gnus-intern-safe gnus-tmp-group gnus-active-hashtb)
gnus-unread ,(if (numberp number)
(string-to-int gnus-tmp-number-of-unread)
(or (message-goto-body) (point-max)))
;; Insert the original article headers.
(insert-buffer-substring gnus-original-article-buffer beg end)
- (article-decode-encoded-words))))
+ ;; Decode charsets.
+ (let ((gnus-article-decode-hook
+ (delq 'article-decode-charset gnus-article-decode-hook)))
+ (run-hooks 'gnus-article-decode-hook)))))
gnus-article-copy)))
(defun gnus-post-news (post &optional group header article-buffer yank subject
(search-forward ":" eol t)
(point)))))
+(defun gnus-decode-newsgroups (newsgroups group &optional method)
+ (let ((method (or method (gnus-find-method-for-group group))))
+ (mapconcat (lambda (group)
+ (gnus-group-name-decode group (gnus-group-name-charset
+ method group)))
+ (message-tokenize-header newsgroups ", ")
+ ", ")))
+
(defun gnus-remove-text-with-property (prop)
"Delete all text in the current buffer with text property PROP."
(save-excursion
(if followup-to
(concat newsgroups "," followup-to)
newsgroups)))
+ (method (if (message-functionp message-post-method)
+ (funcall message-post-method)
+ message-post-method))
(known-groups
- (mapcar (lambda (n) (gnus-group-real-name n))
- (gnus-groups-from-server
- (if (message-functionp message-post-method)
- (funcall message-post-method)
- message-post-method))))
+ (mapcar (lambda (n)
+ (gnus-group-name-decode
+ (gnus-group-real-name n)
+ (gnus-group-name-charset method n)))
+ (gnus-groups-from-server method)))
errors)
(while groups
(unless (or (equal (car groups) "poster")