From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/68927 Path: news.gmane.org!not-for-mail From: Dan Christensen Newsgroups: gmane.emacs.gnus.general Subject: Re: accidentally started gnus Date: Tue, 25 Aug 2009 08:46:19 -0400 Message-ID: <87tyzw12p0.fsf@uwo.ca> References: <87r5v7lpzj.fsf@jidanni.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1251211699 987 80.91.229.12 (25 Aug 2009 14:48:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Aug 2009 14:48:19 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M17346@lists.math.uh.edu Tue Aug 25 16:48:12 2009 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.50) id 1MfxJg-0004yR-W9 for ding-account@gmane.org; Tue, 25 Aug 2009 16:48:09 +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 1MfxIV-000674-Rx; Tue, 25 Aug 2009 09:46:55 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1MfvQD-0005dx-US for ding@lists.math.uh.edu; Tue, 25 Aug 2009 07:46:45 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1MfvQB-0004ej-Vs for ding@lists.math.uh.edu; Tue, 25 Aug 2009 07:46:45 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1MfvQm-0008Kd-00 for ; Tue, 25 Aug 2009 14:47:20 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1MfvQ9-0002Dh-R3 for ding@gnus.org; Tue, 25 Aug 2009 14:46:41 +0200 Original-Received: from bas3-london14-1096780790.dsl.bell.ca ([65.95.139.246]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 25 Aug 2009 14:46:41 +0200 Original-Received: from jdc by bas3-london14-1096780790.dsl.bell.ca with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 25 Aug 2009 14:46:41 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 22 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: bas3-london14-1096780790.dsl.bell.ca User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:/zecBY96+agfb0QRH27N3JGoC1I= X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:68927 Archived-At: To avoid accidentally starting Gnus a second time, I use the following code, which requires that you have the lockfile program in your path. After a crash, the lock file will still exist, in which case you can steal the lock. It's amazing how often this has saved me from having two copies of Gnus running! (add-hook 'gnus-before-startup-hook 'jdc-gnus-lock) (defun jdc-gnus-lock () (or (equal 0 (shell-command "lockfile -r0 ~/Gnus/lock")) (y-or-n-p "Lockfile exists. Steal lock? ") (progn (kill-buffer "*Group*") (error "Unable to lock ~/Gnus/lock")))) (add-hook 'gnus-after-exiting-gnus-hook 'jdc-gnus-unlock) (defun jdc-gnus-unlock () (shell-command "rm -f ~/Gnus/lock")) Dan