From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/79717 Path: news.gmane.org!not-for-mail From: John Wiegley Newsgroups: gmane.emacs.gnus.general Subject: Proposed code to cleanup gnus on Emacs exit Date: Tue, 23 Aug 2011 12:12:52 -0500 Organization: BoostPro Computing, Inc. Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1314120494 13779 80.91.229.12 (23 Aug 2011 17:28:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 23 Aug 2011 17:28:14 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M28011@lists.math.uh.edu Tue Aug 23 19:28:08 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qvuli-0004Ny-Vp for ding-account@gmane.org; Tue, 23 Aug 2011 19:28:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1QvukA-0008DR-9f; Tue, 23 Aug 2011 12:26:30 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1QvueN-0008AZ-Bv for ding@lists.math.uh.edu; Tue, 23 Aug 2011 12:20:31 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1Qvue4-0003lu-LQ for ding@lists.math.uh.edu; Tue, 23 Aug 2011 12:20:30 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1Qvue1-0004gF-PG for ding@gnus.org; Tue, 23 Aug 2011 19:20:09 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Qvudz-0000tV-7G for ding@gnus.org; Tue, 23 Aug 2011 19:20:07 +0200 Original-Received: from c-98-215-105-167.hsd1.il.comcast.net ([98.215.105.167]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 23 Aug 2011 19:20:07 +0200 Original-Received: from jwiegley by c-98-215-105-167.hsd1.il.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 23 Aug 2011 19:20:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 18 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-98-215-105-167.hsd1.il.comcast.net User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.3 (darwin) Cancel-Lock: sha1:FK0UolizJkilLtEGgE174W2gsJs= X-Spam-Score: -4.5 (----) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:79717 Archived-At: I'm a bit surprised Gnus doesn't do this already: This code will make sure that when you exit Emacs, and Gnus is running, that everything gets cleaned up as it should: --8<---------------cut here---------------start------------->8--- ;;; Cleanup all Gnus buffers on exit (defun exit-gnus-on-exit () (if (and (fboundp 'gnus-group-exit) (gnus-alive-p)) (with-current-buffer (get-buffer "*Group*") (let (gnus-interactive-exit) (gnus-group-exit))))) (add-hook 'kill-emacs-hook 'exit-gnus-on-exit) --8<---------------cut here---------------end--------------->8--- John