message.el (message-expand-group): Decode group names
authorKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 16 May 2013 23:28:58 +0000 (23:28 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 16 May 2013 23:28:58 +0000 (23:28 +0000)
lisp/ChangeLog
lisp/message.el

index 24967e8..c12d076 100644 (file)
@@ -1,3 +1,7 @@
+2013-05-16  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * message.el (message-expand-group): Decode group names.
+
 2013-05-16  Julien Danjou  <julien@danjou.info>
 
        * gnus-notifications.el (gnus-notifications-notify): Use photo-file as
index f867938..8e5b817 100644 (file)
@@ -8004,19 +8004,29 @@ those headers."
 
 (defun message-expand-group ()
   "Expand the group name under point."
-  (let* ((b (save-excursion
-             (save-restriction
-               (narrow-to-region
-                (save-excursion
-                  (beginning-of-line)
-                  (skip-chars-forward "^:")
-                  (1+ (point)))
-                (point))
-               (skip-chars-backward "^, \t\n") (point))))
-        (completion-ignore-case t)
-         (e (progn (skip-chars-forward "^,\t\n ") (point)))
-        (hashtb (and (boundp 'gnus-active-hashtb) gnus-active-hashtb)))
-    (message-completion-in-region e b hashtb)))
+  (let ((b (save-excursion
+            (save-restriction
+              (narrow-to-region
+               (save-excursion
+                 (beginning-of-line)
+                 (skip-chars-forward "^:")
+                 (1+ (point)))
+               (point))
+              (skip-chars-backward "^, \t\n") (point))))
+       (completion-ignore-case t)
+       (e (progn (skip-chars-forward "^,\t\n ") (point)))
+       group collection)
+    (when (and (boundp 'gnus-active-hashtb)
+              gnus-active-hashtb)
+      (mapatoms
+       (lambda (symbol)
+        (setq group (symbol-name symbol))
+        (push (if (string-match "[^\000-\177]" group)
+                  (gnus-group-decoded-name group)
+                group)
+              collection))
+       gnus-active-hashtb))
+    (message-completion-in-region e b collection)))
 
 (defalias 'message-completion-in-region
   (if (fboundp 'completion-in-region)