From 3eacc9cdefe67614635205305834411d7d1136b0 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Tue, 30 Aug 2011 22:07:52 +0000 Subject: [PATCH] gnus-group.el (gnus-group-name-charset): Don't bug out on server names. --- lisp/gnus/ChangeLog | 5 +++++ lisp/gnus/gnus-group.el | 36 +++++++++++++++++++++--------------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index feee3c49f3a..3893ec8ea7b 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2011-08-30 Lars Magne Ingebrigtsen + + * gnus-group.el (gnus-group-name-charset): Don't bug out on server + names. + 2011-08-27 Daiki Ueno * mml-smime.el (mml-smime-epg-verify): Don't use the 4th arg of diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 5ae29053b6f..5cc01759a04 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -1194,21 +1194,27 @@ The following commands are available: (gnus-group-mode))) (defun gnus-group-name-charset (method group) - (if (null method) - (setq method (gnus-find-method-for-group group))) - (let ((item (or (assoc method gnus-group-name-charset-method-alist) - (and (consp method) - (assoc (list (car method) (cadr method)) - gnus-group-name-charset-method-alist)))) - (alist gnus-group-name-charset-group-alist) - result) - (if item - (cdr item) - (while (setq item (pop alist)) - (if (string-match (car item) group) - (setq alist nil - result (cdr item)))) - result))) + (unless method + (setq method (gnus-find-method-for-group group))) + (when (stringp method) + (setq method (gnus-server-to-method method))) + (if (eq (car method) 'nnimap) + ;; IMAP groups should not be encoded, since they do the encoding + ;; in utf7 in the protocol. + nil + (let ((item (or (assoc method gnus-group-name-charset-method-alist) + (and (consp method) + (assoc (list (car method) (cadr method)) + gnus-group-name-charset-method-alist)))) + (alist gnus-group-name-charset-group-alist) + result) + (if item + (cdr item) + (while (setq item (pop alist)) + (if (string-match (car item) group) + (setq alist nil + result (cdr item)))) + result)))) (defun gnus-group-name-decode (string charset) ;; Fixme: Don't decode in unibyte mode. -- 2.39.2