+(defun gnus-demon-add-nntp-close-connection ()
+ "Add daemonic nntp server disconnection to Gnus.
+If no commands have gone out via nntp during the last five
+minutes, the connection is closed."
+ (gnus-demon-add-handler 'gnus-demon-nntp-close-connections 5 nil))
+
+(defun gnus-demon-nntp-close-connection ()
+ (save-window-excursion
+ (when (time-less-p '(0 300) (time-since nntp-last-command-time))
+ (nntp-close-server))))
+