gnus-art.el (gnus-mime-buttonize-attachments-in-header): Improve criterion that finds...
[gnus] / lisp / gnus-cus.el
index 98f0426..5c5d4a2 100644 (file)
@@ -1,6 +1,6 @@
 ;;; gnus-cus.el --- customization commands for Gnus
 
-;; Copyright (C) 1996, 1999-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1999-2014 Free Software Foundation, Inc.
 
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Keywords: news
@@ -33,7 +33,7 @@
 
 ;;; Widgets:
 
-(defun gnus-custom-mode ()
+(define-derived-mode gnus-custom-mode fundamental-mode "Gnus Customize"
   "Major mode for editing Gnus customization buffers.
 
 The following commands are available:
@@ -45,9 +45,6 @@ The following commands are available:
 
 Entry to this mode calls the value of `gnus-custom-mode-hook'
 if that value is non-nil."
-  (kill-all-local-variables)
-  (setq major-mode 'gnus-custom-mode
-       mode-name "Gnus Customize")
   (use-local-map widget-keymap)
   ;; Emacs stuff:
   (when (and (facep 'custom-button-face)
@@ -63,8 +60,7 @@ if that value is non-nil."
     (set (make-local-variable 'widget-push-button-prefix) "")
     (set (make-local-variable 'widget-push-button-suffix) "")
     (set (make-local-variable 'widget-link-prefix) "")
-    (set (make-local-variable 'widget-link-suffix) ""))
-  (gnus-run-mode-hooks 'gnus-custom-mode-hook))
+    (set (make-local-variable 'widget-link-suffix) "")))
 
 ;;; Group Customization:
 
@@ -417,6 +413,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 +488,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:
 
@@ -922,7 +926,7 @@ will add a new `thread' match for each article that has X in its
 `Message-ID's of these matching articles.)  This will ensure that you
 can raise/lower the score of an entire thread, even though some
 articles in the thread may not have complete `References' headers.
-Note that using this may lead to undeterministic scores of the
+Note that using this may lead to nondeterministic scores of the
 articles in the thread.
 ")
                                     ,@types)