Gnus development mailing list
 help / color / mirror / Atom feed
* Saving .newsrc upon *Summary* exit
@ 2001-07-15 19:47 Paul Jarc
  2001-07-24 16:17 ` Colin Rafferty
  2001-07-24 17:53 ` ShengHuo ZHU
  0 siblings, 2 replies; 9+ messages in thread
From: Paul Jarc @ 2001-07-15 19:47 UTC (permalink / raw)


Is it appropriate to add gnus-group-save-newsrc to
gnus-summary-exit-hook?  Or is that hook called at a bad time for
saving?


paul


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Saving .newsrc upon *Summary* exit
  2001-07-15 19:47 Saving .newsrc upon *Summary* exit Paul Jarc
@ 2001-07-24 16:17 ` Colin Rafferty
  2001-07-24 17:53 ` ShengHuo ZHU
  1 sibling, 0 replies; 9+ messages in thread
From: Colin Rafferty @ 2001-07-24 16:17 UTC (permalink / raw)
  Cc: ding

Paul Jarc wrote:

> Is it appropriate to add gnus-group-save-newsrc to
> gnus-summary-exit-hook?  Or is that hook called at a bad time for
> saving?

I prefer gnus-dribble-save instead.

It gives me the same effect, but it's much quicker.

-- 
Colin


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Saving .newsrc upon *Summary* exit
  2001-07-15 19:47 Saving .newsrc upon *Summary* exit Paul Jarc
  2001-07-24 16:17 ` Colin Rafferty
@ 2001-07-24 17:53 ` ShengHuo ZHU
  2001-07-24 18:18   ` Paul Jarc
  2001-07-24 18:39   ` Stainless Steel Rat
  1 sibling, 2 replies; 9+ messages in thread
From: ShengHuo ZHU @ 2001-07-24 17:53 UTC (permalink / raw)


prj@po.cwru.edu (Paul Jarc) writes:

> Is it appropriate to add gnus-group-save-newsrc to
> gnus-summary-exit-hook?  Or is that hook called at a bad time for
> saving?

I think it is OK. If not, please post your solution.

ShengHuo


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Saving .newsrc upon *Summary* exit
  2001-07-24 17:53 ` ShengHuo ZHU
@ 2001-07-24 18:18   ` Paul Jarc
  2001-07-24 21:55     ` Kai Großjohann
  2001-07-24 18:39   ` Stainless Steel Rat
  1 sibling, 1 reply; 9+ messages in thread
From: Paul Jarc @ 2001-07-24 18:18 UTC (permalink / raw)


ShengHuo ZHU <zsh@cs.rochester.edu> writes:
> prj@po.cwru.edu (Paul Jarc) writes:
>> Is it appropriate to add gnus-group-save-newsrc to
>> gnus-summary-exit-hook?  Or is that hook called at a bad time for
>> saving?
> 
> I think it is OK. If not, please post your solution.

I haven't had any problems so far.  Now, since I've gotten into the
habit of not leaving *Summary* buffers hanging around, I can leave one
Gnus running and safely run a second one in a second Emacs (on the
same machine, using the same account, .emacs, etc.).  The first one
will have saved my newsrc, so the second one will see something
consistent and up-to-date when it starts, and when I get back to the
first one, I immediately quit and restart Gnus to pick up the changes
made by the second one.  Quitting won't clobber those changes because
the first Gnus thinks newsrc is already saved.


paul


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Saving .newsrc upon *Summary* exit
  2001-07-24 17:53 ` ShengHuo ZHU
  2001-07-24 18:18   ` Paul Jarc
@ 2001-07-24 18:39   ` Stainless Steel Rat
  1 sibling, 0 replies; 9+ messages in thread
From: Stainless Steel Rat @ 2001-07-24 18:39 UTC (permalink / raw)


* ShengHuo ZHU <zsh@cs.rochester.edu>  on Tue, 24 Jul 2001
| I think it is OK. If not, please post your solution.

I've been doing it for a while, though instead of saving every group (which
is slow) I programmatically save every five groups exited, like so:

(add-hook 'gnus-startup-hook 'rat:gnus-startup-hook)
(defun rat:gnus-startup-hook ()
  (setq rat:gnus-selected-newsgroups 0)
  (setq rat:gnus-incremental-save-newsrc t)
  (setq rat:gnus-incremental-save-newsrc-threshold 5)
  )

(add-hook 'gnus-save-newsrc-hook 'rat:gnus-save-newsrc-hook)
(defun rat:gnus-save-newsrc-hook ()
  (if rat:gnus-incremental-save-newsrc
      (setq rat:gnus-selected-newsgroups 0)))

(add-hook 'gnus-exit-group-hook 'rat:gnus-exit-group-hook)
(defun rat:gnus-exit-group-hook ()
  (if rat:gnus-incremental-save-newsrc
      (progn
	(setq rat:gnus-selected-newsgroups (+ rat:gnus-selected-newsgroups 1))
	(if (> rat:gnus-selected-newsgroups
	       rat:gnus-incremental-save-newsrc-threshold)
	    (gnus-save-newsrc-file)))))
-- 
Rat <ratinox@peorth.gweep.net>    \ Warning: pregnant women, the elderly, and
Minion of Nathan - Nathan says Hi! \ children under 10 should avoid prolonged
PGP Key: at a key server near you!  \ exposure to Happy Fun Ball.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Saving .newsrc upon *Summary* exit
  2001-07-24 18:18   ` Paul Jarc
@ 2001-07-24 21:55     ` Kai Großjohann
  2001-07-24 22:37       ` Paul Jarc
  0 siblings, 1 reply; 9+ messages in thread
From: Kai Großjohann @ 2001-07-24 21:55 UTC (permalink / raw)


On Tue, 24 Jul 2001, Paul Jarc wrote:

> I haven't had any problems so far.  Now, since I've gotten into the
> habit of not leaving *Summary* buffers hanging around, I can leave
> one Gnus running and safely run a second one in a second Emacs (on
> the same machine, using the same account, .emacs, etc.).  

This sounds dangerous.  Why don't you do M-x gnus-slave RET for the
second one?

kai
-- 
~/.signature: No such file or directory


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Saving .newsrc upon *Summary* exit
  2001-07-24 21:55     ` Kai Großjohann
@ 2001-07-24 22:37       ` Paul Jarc
  2001-07-25  1:14         ` David S. Goldberg
  2001-07-25  8:21         ` Kai Großjohann
  0 siblings, 2 replies; 9+ messages in thread
From: Paul Jarc @ 2001-07-24 22:37 UTC (permalink / raw)


Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:
> On Tue, 24 Jul 2001, Paul Jarc wrote:
>> Now, since I've gotten into the habit of not leaving *Summary*
>> buffers hanging around, I can leave one Gnus running and safely run
>> a second one in a second Emacs (on the same machine, using the same
>> account, .emacs, etc.).
> 
> This sounds dangerous.

Yes, it sounds that way, but I don't think it is.  Anyway, I'm only
using nntp and nnmaildir, and nnmaildir tolerates even less
synchronized concurrency.  So I'm not risking much.

> Why don't you do M-x gnus-slave RET for the second one?

Mostly because I didn't know about it.  But reading the manual - what
happens if I run a slave, quit from it, and then run a slave again
without touching the master?  Will the second slave notice the changes
from the first?  With my way, it will, and that's what I want.


paul


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Saving .newsrc upon *Summary* exit
  2001-07-24 22:37       ` Paul Jarc
@ 2001-07-25  1:14         ` David S. Goldberg
  2001-07-25  8:21         ` Kai Großjohann
  1 sibling, 0 replies; 9+ messages in thread
From: David S. Goldberg @ 2001-07-25  1:14 UTC (permalink / raw)


> Mostly because I didn't know about it.  But reading the manual - what
> happens if I run a slave, quit from it, and then run a slave again
> without touching the master?  Will the second slave notice the changes
> from the first?  With my way, it will, and that's what I want.

Yes, it does for me with nntp, nnml and nnimap backends.
-- 
Dave Goldberg
dsg@world.std.com


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Saving .newsrc upon *Summary* exit
  2001-07-24 22:37       ` Paul Jarc
  2001-07-25  1:14         ` David S. Goldberg
@ 2001-07-25  8:21         ` Kai Großjohann
  1 sibling, 0 replies; 9+ messages in thread
From: Kai Großjohann @ 2001-07-25  8:21 UTC (permalink / raw)


On Tue, 24 Jul 2001, Paul Jarc wrote:

> Mostly because I didn't know about it.  But reading the manual -
> what happens if I run a slave, quit from it, and then run a slave
> again without touching the master?  Will the second slave notice the
> changes from the first?  With my way, it will, and that's what I
> want.

I'm not sure.  Maybe you have to `g' in the master.  I've never used
slaves.  But if it works for you... 

kai
-- 
~/.signature: No such file or directory


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-07-25  8:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-15 19:47 Saving .newsrc upon *Summary* exit Paul Jarc
2001-07-24 16:17 ` Colin Rafferty
2001-07-24 17:53 ` ShengHuo ZHU
2001-07-24 18:18   ` Paul Jarc
2001-07-24 21:55     ` Kai Großjohann
2001-07-24 22:37       ` Paul Jarc
2001-07-25  1:14         ` David S. Goldberg
2001-07-25  8:21         ` Kai Großjohann
2001-07-24 18:39   ` Stainless Steel Rat

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).