]> git.eshelyaron.com Git - emacs.git/commitdiff
[Gnus] Enable posting-style group parameter to hold non-ASCII string values
authorKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 22 Aug 2012 10:37:55 +0000 (10:37 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 22 Aug 2012 10:37:55 +0000 (10:37 +0000)
lisp/gnus/ChangeLog
lisp/gnus/gnus-cus.el
lisp/gnus/gnus-msg.el

index 7592c405076b07402847cedade4f6d9873de81cf..2a47b049c9bb34aa53e6665aeabf0fc38dddb151 100644 (file)
@@ -1,3 +1,12 @@
+2012-08-22  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-cus.el (gnus-group-customize): Decode values posting-style holds.
+       (gnus-group-customize-done): Encode values posting-style holds.
+
+       * gnus-msg.el (gnus-summary-resend-message)
+       (gnus-configure-posting-styles): Decode values posting-style group
+       parameter holds.
+
 2012-08-21  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-msg.el (gnus-summary-resend-message): Honor posting-style for
index 234d0f7ae56f2a49b57bf3caecf9f7ea62495c99..3440e6310af3307e2bc0a29844fc4510091afbde 100644 (file)
@@ -417,6 +417,11 @@ category."))
            (delq elem tmp))
          (setq tmp (cdr tmp))))
 
+      ;; Decode values posting-style holds.
+      (dolist (style (cdr (assq 'posting-style values)))
+       (when (stringp (cadr style))
+         (setcdr style (list (mm-decode-coding-string (cadr style) 'utf-8)))))
+
       (setq gnus-custom-params
             (apply 'widget-create 'group
                    :value values
@@ -487,14 +492,17 @@ form, but who cares?"
 (defun gnus-group-customize-done (&rest ignore)
   "Apply changes and bury the buffer."
   (interactive)
-  (if gnus-custom-topic
-      (gnus-topic-set-parameters gnus-custom-topic
-                                (widget-value gnus-custom-params))
-    (gnus-group-edit-group-done 'params gnus-custom-group
-                               (widget-value gnus-custom-params))
-    (gnus-group-edit-group-done 'method gnus-custom-group
-                               (widget-value gnus-custom-method)))
-  (bury-buffer))
+  (let ((params (widget-value gnus-custom-params)))
+    ;; Encode values posting-style holds.
+    (dolist (style (cdr (assq 'posting-style params)))
+      (when (stringp (cadr style))
+       (setcdr style (list (mm-encode-coding-string (cadr style) 'utf-8)))))
+    (if gnus-custom-topic
+       (gnus-topic-set-parameters gnus-custom-topic params)
+      (gnus-group-edit-group-done 'params gnus-custom-group params)
+      (gnus-group-edit-group-done 'method gnus-custom-group
+                                 (widget-value gnus-custom-method)))
+    (bury-buffer)))
 
 ;;; Score Customization:
 
index 07748bebb81c8428f553e4ab72910df74ff391e5..c2f79e70d1e928822d7a4c8466c97793ac855315 100644 (file)
@@ -1376,6 +1376,9 @@ For the \"inline\" alternatives, also see the variable
        (user-full-name user-full-name)
        (user-mail-address user-mail-address)
        tem)
+    (dolist (style styles)
+      (when (stringp (cadr style))
+       (setcdr style (list (mm-decode-coding-string (cadr style) 'utf-8)))))
     (dolist (style (if styles
                       (append gnus-posting-styles (list (cons ".*" styles)))
                     gnus-posting-styles))
@@ -1807,6 +1810,10 @@ this is a reply."
       (when gnus-newsgroup-name
        (let ((tmp-style (gnus-group-find-parameter group 'posting-style t)))
          (when tmp-style
+           (dolist (style tmp-style)
+             (when (stringp (cadr style))
+               (setcdr style (list (mm-decode-coding-string (cadr style)
+                                                            'utf-8)))))
            (setq styles (append styles (list (cons ".*" tmp-style)))))))
       ;; Go through all styles and look for matches.
       (dolist (style styles)