"Setup news information.
If RAWFILE is non-nil, the .newsrc file will also be read.
If LEVEL is non-nil, the news will be set up at level LEVEL."
+ (require 'nnmail)
(let ((init (not (and gnus-newsrc-alist gnus-active-hashtb (not rawfile))))
;; Binding this variable will inhibit multiple fetchings
;; of the same mail source.
(setq gnus-newsrc-options-n out))))
-;; The following four lines will be deleted in the future.
-(require 'poe)
-(defun-maybe save-buffer-as-coding-system (coding-system &optional args)
- (let ((coding-system-for-write coding-system))
- (save-buffer args)))
-
(defun gnus-save-newsrc-file (&optional force)
"Save .newsrc file."
;; Note: We cannot save .newsrc file if all newsgroups are removed
(gnus-dribble-delete-file)
(gnus-group-set-mode-line)))))
+;; Call the function above at C-x C-c.
+(defadvice save-buffers-kill-emacs (before save-gnus-newsrc-file-maybe activate)
+ "Save .newsrc and .newsrc.eld when Emacs is killed."
+ (when (get-buffer gnus-group-buffer)
+ (gnus-run-hooks 'gnus-exit-gnus-hook)
+ (gnus-offer-save-summaries)
+ (gnus-save-newsrc-file)))
+
(defun gnus-gnus-to-quick-newsrc-format ()
"Insert Gnus variables such as gnus-newsrc-alist in lisp format."
(let ((print-quoted t)