X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fgnus-start.el;h=552de625f710b996268a31b234f62f7b519a6c11;hb=a469ddcc3be84b5f7924665489126f9f386017c2;hp=fd0bb8fce7e03746e996c60056719a39b70f9547;hpb=331a1db3f68e1e0c3db4d9bd1756568365188d13;p=gnus diff --git a/lisp/gnus-start.el b/lisp/gnus-start.el index fd0bb8fce..552de625f 100644 --- a/lisp/gnus-start.el +++ b/lisp/gnus-start.el @@ -32,7 +32,7 @@ (require 'gnus-spec) (require 'gnus-range) (require 'gnus-util) -(require 'message) +(autoload 'message-make-date "message") (eval-when-compile (require 'cl)) (defcustom gnus-startup-file (nnheader-concat gnus-home-directory ".newsrc") @@ -242,7 +242,12 @@ nil if you set this variable to nil. This variable can also be a regexp. In that case, all groups that do not match this regexp will be removed before saving the list." :group 'gnus-newsrc - :type 'boolean) + :type '(radio (sexp :format "Non-nil\n" + :match (lambda (widget value) + (and value (not (stringp value)))) + :value t) + (const nil) + (regexp :format "%t: %v\n" :size 0))) (defcustom gnus-ignored-newsgroups (mapconcat 'identity @@ -281,8 +286,8 @@ claim them." (repeat function))) (defcustom gnus-subscribe-newsgroup-hooks nil - "*Hooks run after you subscribe to a new group. The hooks will be called -with new group's name as argument." + "*Hooks run after you subscribe to a new group. +The hooks will be called with new group's name as argument." :group 'gnus-group-new :type 'hook) @@ -381,7 +386,7 @@ This hook is called as the first thing when Gnus is started." :group 'gnus-start :type 'hook) -(defcustom gnus-setup-news-hook +(defcustom gnus-setup-news-hook '(gnus-fixup-nnimap-unread-after-getting-new-news) "A hook after reading the .newsrc file, but before generating the buffer." :group 'gnus-start @@ -398,7 +403,7 @@ This hook is called as the first thing when Gnus is started." :type 'hook) (defcustom gnus-after-getting-new-news-hook - '(gnus-display-time-event-handler + '(gnus-display-time-event-handler gnus-fixup-nnimap-unread-after-getting-new-news) "*A hook run after Gnus checks for new news when Gnus is already running." :group 'gnus-group-new @@ -552,7 +557,7 @@ Can be used to turn version control on or off." (gnus-subscribe-newsgroup newsgroup)) (defun gnus-subscribe-alphabetically (newgroup) - "Subscribe new NEWSGROUP and insert it in alphabetical order." + "Subscribe new NEWGROUP and insert it in alphabetical order." (let ((groups (cdr gnus-newsrc-alist)) before) (while (and (not before) groups) @@ -562,7 +567,7 @@ Can be used to turn version control on or off." (gnus-subscribe-newsgroup newgroup before))) (defun gnus-subscribe-hierarchically (newgroup) - "Subscribe new NEWSGROUP and insert it in hierarchical newsgroup order." + "Subscribe new NEWGROUP and insert it in hierarchical newsgroup order." ;; Basic ideas by mike-w@cs.aukuni.ac.nz (Mike Williams) (save-excursion (set-buffer (nnheader-find-file-noselect gnus-current-startup-file)) @@ -787,17 +792,6 @@ prompt the user for the name of an NNTP server to use." (gnus-group-set-parameter "nndraft:drafts" 'gnus-dummy '((gnus-draft-mode))))) -;;;###autoload -(defun gnus-unload () - "Unload all Gnus features. -\(For some value of `all' or `Gnus'.) Currently, features whose names -have prefixes `gnus-', `nn', `mm-' or `rfc' are unloaded. Use -cautiously -- unloading may cause trouble." - (interactive) - (dolist (feature features) - (if (string-match "^\\(gnus-\\|nn\\|mm-\\|rfc\\)" (symbol-name feature)) - (unload-feature feature 'force)))) - ;;; ;;; Dribble file @@ -1024,7 +1018,7 @@ If LEVEL is non-nil, the news will be set up at level LEVEL." "Call METHOD to subscribe GROUP. If no function returns `non-nil', call `gnus-subscribe-zombies'." (unless (cond - ((gnus-functionp method) + ((functionp method) (funcall method group)) ((listp method) (catch 'found @@ -1253,7 +1247,7 @@ for new groups, and subscribe the new groups as zombies." (gnus-message 7 "`A k' to list killed groups")))))) (defun gnus-subscribe-group (group &optional previous method) - "Subcribe GROUP and put it after PREVIOUS." + "Subscribe GROUP and put it after PREVIOUS." (gnus-group-change-level (if method (list t group gnus-level-default-subscribed nil nil method) @@ -1969,7 +1963,7 @@ newsgroup." (gnus-message 5 "%sdone" mesg))))))) (defun gnus-read-active-file-2 (groups method) - "Read an active file for GROUPS in METHOD using gnus-retrieve-groups." + "Read an active file for GROUPS in METHOD using `gnus-retrieve-groups'." (when groups (save-excursion (set-buffer nntp-server-buffer) @@ -2615,10 +2609,9 @@ If FORCE is non-nil, the .newsrc file is read." (unwind-protect (progn - (gnus-with-output-to-file - working-file - (gnus-gnus-to-quick-newsrc-format) - (gnus-run-hooks 'gnus-save-quick-newsrc-hook)) + (gnus-with-output-to-file working-file + (gnus-gnus-to-quick-newsrc-format) + (gnus-run-hooks 'gnus-save-quick-newsrc-hook)) ;; These bindings will mislead the current buffer ;; into thinking that it is visiting the startup @@ -2643,26 +2636,39 @@ If FORCE is non-nil, the .newsrc file is read." (gnus-dribble-delete-file) (gnus-group-set-mode-line))))) -(defun gnus-gnus-to-quick-newsrc-format () - "Print Gnus variables such as gnus-newsrc-alist in lisp format." +(defun gnus-gnus-to-quick-newsrc-format (&optional minimal name &rest specific-variables) + "Print Gnus variables such as `gnus-newsrc-alist' in Lisp format." (princ ";; -*- emacs-lisp -*-\n") - (princ ";; Gnus startup file.\n") - (princ "\ + (if name + (princ (format ";; %s\n" name)) + (princ ";; Gnus startup file.\n")) + + (unless minimal + (princ "\ ;; Never delete this file -- if you want to force Gnus to read the ;; .newsrc file (if you have one), touch .newsrc instead.\n") - (princ "(setq gnus-newsrc-file-version ") - (princ (gnus-prin1-to-string gnus-version)) - (princ ")\n") - (let* ((gnus-killed-list + (princ "(setq gnus-newsrc-file-version ") + (princ (gnus-prin1-to-string gnus-version)) + (princ ")\n")) + + (let* ((print-quoted t) + (print-readably t) + (print-escape-multibyte nil) + (print-escape-nonascii t) + (print-length nil) + (print-level nil) + (print-escape-newlines t) + (gnus-killed-list (if (and gnus-save-killed-list (stringp gnus-save-killed-list)) (gnus-strip-killed-list) gnus-killed-list)) (variables - (if gnus-save-killed-list gnus-variable-list - ;; Remove the `gnus-killed-list' from the list of variables - ;; to be saved, if required. - (delq 'gnus-killed-list (copy-sequence gnus-variable-list)))) + (or specific-variables + (if gnus-save-killed-list gnus-variable-list + ;; Remove the `gnus-killed-list' from the list of variables + ;; to be saved, if required. + (delq 'gnus-killed-list (copy-sequence gnus-variable-list))))) ;; Peel off the "dummy" group. (gnus-newsrc-alist (cdr gnus-newsrc-alist)) variable) @@ -2889,6 +2895,7 @@ If FORCE is non-nil, the .newsrc file is read." (or (gnus-group-name-charset method name) (gnus-parameter-charset name) gnus-default-charset))) + ;; Fixme: Don't decode in unibyte mode. (when (and str charset (featurep 'mule)) (setq str (mm-decode-coding-string str charset))) (set group str))) @@ -2907,7 +2914,7 @@ If FORCE is non-nil, the .newsrc file is read." ;;;###autoload (defun gnus-declare-backend (name &rest abilities) - "Declare backend NAME with ABILITIES as a Gnus backend." + "Declare back end NAME with ABILITIES as a Gnus back end." (setq gnus-valid-select-methods (nconc gnus-valid-select-methods (list (apply 'list name abilities)))) @@ -2923,7 +2930,7 @@ If this variable is nil, don't do anything." default-directory))) (eval-and-compile -(defalias 'gnus-display-time-event-handler +(defalias 'gnus-display-time-event-handler (if (gnus-boundp 'display-time-timer) 'display-time-event-handler (lambda () "Does nothing as `display-time-timer' is not bound.