;;; gnus-cus.el --- customization commands for Gnus
-;; Copyright (C) 1996, 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1999-2016 Free Software Foundation, Inc.
;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
;; Keywords: news
;;; 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:
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 21 stuff:
+ ;; Emacs stuff:
(when (and (facep 'custom-button-face)
(facep 'custom-button-pressed-face))
(set (make-local-variable 'widget-button-face)
(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:
(repeat (list (string :format "%v" :tag "File name"))))
"Which score files to use when using score to select articles to fetch.
- `nil'
+ nil
All articles will be scored to zero (0).
`file'
(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
:greedy t
:tag "Agent Parameters"
:format "%t:\n%h%v"
- :doc "\ These agent parameters are
+ :doc "These agent parameters are
recognized by Gnus. They control article selection and expiration for
use in the unplugged cache. Check the [ ] for the parameters you want
to apply to this group or to the groups in this topic, then edit the
(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:
Check the [ ] for the entries you want to apply to this score file, then
edit the value to suit your taste. Don't forget to mark the checkbox,
if you do all your changes will be lost. ")
- (widget-create 'push-button
- :action (lambda (&rest ignore)
- (require 'gnus-audio)
- (gnus-audio-play "Evil_Laugh.au"))
- "Bhahahah!")
(widget-insert "\n\n")
(make-local-variable 'gnus-custom-scores)
(setq gnus-custom-scores
`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)
(widget-create
'push-button
:notify
- '(lambda (&rest ignore)
- (let* ((info (assq gnus-agent-cat-name gnus-category-alist))
- (widgets category-fields))
- (while widgets
- (let* ((widget (pop widgets))
- (value (condition-case nil (widget-value widget) (error))))
- (eval `(setf (,(widget-get widget :accessor) ',info)
- ',value)))))
- (gnus-category-write)
- (gnus-kill-buffer (current-buffer))
- (when (get-buffer gnus-category-buffer)
- (switch-to-buffer (get-buffer gnus-category-buffer))
- (gnus-category-list)))
+ (lambda (&rest ignore)
+ (let* ((info (assq gnus-agent-cat-name gnus-category-alist))
+ (widgets category-fields))
+ (while widgets
+ (let* ((widget (pop widgets))
+ (value (condition-case nil (widget-value widget) (error))))
+ (eval `(setf (,(widget-get widget :accessor) ',info)
+ ',value)))))
+ (gnus-category-write)
+ (gnus-kill-buffer (current-buffer))
+ (when (get-buffer gnus-category-buffer)
+ (switch-to-buffer (get-buffer gnus-category-buffer))
+ (gnus-category-list)))
"Done")
(widget-insert
"\n Note: Empty fields default to the customizable global\
(provide 'gnus-cus)
-;; arch-tag: a37c285a-49bc-4235-8244-804536effeaf
;;; gnus-cus.el ends here