* Re: accidentally started gnus [not found] <op.uywjaz0jq40fbn@balu.cs.uni-paderborn.de> @ 2009-08-19 16:37 ` jidanni 2009-08-25 12:46 ` Dan Christensen 0 siblings, 1 reply; 6+ messages in thread From: jidanni @ 2009-08-19 16:37 UTC (permalink / raw) To: ding Also, today I just accidentally started a _second_ gnus in a second emacs... luckily I got out of that alive without damaging .newsrc.eld, but perhaps the message should mention 'Holmes, you might have a gnus already running..." too. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: accidentally started gnus 2009-08-19 16:37 ` accidentally started gnus jidanni @ 2009-08-25 12:46 ` Dan Christensen 2009-08-29 23:10 ` Tim Landscheidt 0 siblings, 1 reply; 6+ messages in thread From: Dan Christensen @ 2009-08-25 12:46 UTC (permalink / raw) To: ding 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: accidentally started gnus 2009-08-25 12:46 ` Dan Christensen @ 2009-08-29 23:10 ` Tim Landscheidt 2009-08-30 5:17 ` Graham Murray 0 siblings, 1 reply; 6+ messages in thread From: Tim Landscheidt @ 2009-08-29 23:10 UTC (permalink / raw) To: ding Dan Christensen <jdc@uwo.ca> wrote: > 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 () > [...] That sounds rather interesting. Any chance this could be in- tegrated into the main source? Tim ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: accidentally started gnus 2009-08-29 23:10 ` Tim Landscheidt @ 2009-08-30 5:17 ` Graham Murray 2009-08-30 9:01 ` lock mechanism like in desktop.el (was: accidentally started gnus) Reiner Steib 0 siblings, 1 reply; 6+ messages in thread From: Graham Murray @ 2009-08-30 5:17 UTC (permalink / raw) To: ding Tim Landscheidt <tim@tim-landscheidt.de> writes: > That sounds rather interesting. Any chance this could be in- > tegrated into the main source? Or change it so that instead of failing if gnus is already running it automatically runs 'gnus-slave' instead. ^ permalink raw reply [flat|nested] 6+ messages in thread
* lock mechanism like in desktop.el (was: accidentally started gnus) 2009-08-30 5:17 ` Graham Murray @ 2009-08-30 9:01 ` Reiner Steib 2009-08-30 19:58 ` lock mechanism like in desktop.el Stefan Monnier 0 siblings, 1 reply; 6+ messages in thread From: Reiner Steib @ 2009-08-30 9:01 UTC (permalink / raw) To: ding, emacs-devel [ From the Gnus list, adding emacs-devel. ] On Sun, Aug 30 2009, Graham Murray wrote: > Tim Landscheidt <tim@tim-landscheidt.de> writes: [ citation added ... ] >> Dan Christensen <jdc@uwo.ca> wrote: >>> 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")) >> That sounds rather interesting. Any chance this could be in- >> tegrated into the main source? desktop.el has a lock mechanism that is independent of external programs. I'd prefer such a solution. Maybe the lock mechanism in desktop.el could be made more generic (and moved from desktop.el to simple.el/files.el?) so that other packages could use it without duplicating the code (and loading desktop.el). > Or change it so that instead of failing if gnus is already running it > automatically runs 'gnus-slave' instead. Prompting could offer this as well. Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: lock mechanism like in desktop.el 2009-08-30 9:01 ` lock mechanism like in desktop.el (was: accidentally started gnus) Reiner Steib @ 2009-08-30 19:58 ` Stefan Monnier 0 siblings, 0 replies; 6+ messages in thread From: Stefan Monnier @ 2009-08-30 19:58 UTC (permalink / raw) To: ding; +Cc: emacs-devel > desktop.el has a lock mechanism that is independent of external > programs. I'd prefer such a solution. Maybe the lock mechanism in > desktop.el could be made more generic (and moved from desktop.el to > simple.el/files.el?) so that other packages could use it without > duplicating the code (and loading desktop.el). We already have such functionality (lock-buffer, unlock-buffer, file-locked-p), or am I missing something? Stefan ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-08-30 19:58 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <op.uywjaz0jq40fbn@balu.cs.uni-paderborn.de> 2009-08-19 16:37 ` accidentally started gnus jidanni 2009-08-25 12:46 ` Dan Christensen 2009-08-29 23:10 ` Tim Landscheidt 2009-08-30 5:17 ` Graham Murray 2009-08-30 9:01 ` lock mechanism like in desktop.el (was: accidentally started gnus) Reiner Steib 2009-08-30 19:58 ` lock mechanism like in desktop.el Stefan Monnier
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).