* gnus-group-save-newsrc on group exit
@ 2003-01-22 12:40 Ted Zlatanov
2003-01-22 13:57 ` Reiner Steib
2003-01-24 21:31 ` Lars Magne Ingebrigtsen
0 siblings, 2 replies; 8+ messages in thread
From: Ted Zlatanov @ 2003-01-22 12:40 UTC (permalink / raw)
I'd like to run gnus-group-save-newsrc every time I exit a group, but this:
(add-hook 'gnus-exit-group-hook 'gnus-group-save-newsrc)
doesn't seem to do it (probably gnus-group-save-newsrc needs to be
invoked from outside the group). Any suggestions?
Ted
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: gnus-group-save-newsrc on group exit
2003-01-22 12:40 gnus-group-save-newsrc on group exit Ted Zlatanov
@ 2003-01-22 13:57 ` Reiner Steib
2003-01-22 16:05 ` Ted Zlatanov
2003-01-24 21:31 ` Lars Magne Ingebrigtsen
1 sibling, 1 reply; 8+ messages in thread
From: Reiner Steib @ 2003-01-22 13:57 UTC (permalink / raw)
On Wed, Jan 22 2003, Ted Zlatanov wrote:
> I'd like to run gnus-group-save-newsrc every time I exit a group,
> but this:
>
> (add-hook 'gnus-exit-group-hook 'gnus-group-save-newsrc)
>
> doesn't seem to do it (probably gnus-group-save-newsrc needs to be
> invoked from outside the group). Any suggestions?
In the summary buffer, there is `C-u Z s'. So the following may work:
(add-hook 'gnus-exit-group-hook
(lambda () (gnus-summary-save-newsrc t)))
Hmm, after exiting a group the saving is done, but the *Group* buffer
is still marked as modified.
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- PGP key available via WWW http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: gnus-group-save-newsrc on group exit
2003-01-22 13:57 ` Reiner Steib
@ 2003-01-22 16:05 ` Ted Zlatanov
0 siblings, 0 replies; 8+ messages in thread
From: Ted Zlatanov @ 2003-01-22 16:05 UTC (permalink / raw)
On Wed, 22 Jan 2003, 4uce.02.r.steib@gmx.net wrote:
> In the summary buffer, there is `C-u Z s'. So the following may
> work:
>
> (add-hook 'gnus-exit-group-hook
> (lambda () (gnus-summary-save-newsrc t)))
>
> Hmm, after exiting a group the saving is done, but the *Group*
> buffer is still marked as modified.
Right, that doesn't seem to work, unfortunately.
Ted
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: gnus-group-save-newsrc on group exit
2003-01-22 12:40 gnus-group-save-newsrc on group exit Ted Zlatanov
2003-01-22 13:57 ` Reiner Steib
@ 2003-01-24 21:31 ` Lars Magne Ingebrigtsen
2003-01-27 18:12 ` Ted Zlatanov
1 sibling, 1 reply; 8+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-01-24 21:31 UTC (permalink / raw)
Ted Zlatanov <tzz@lifelogs.com> writes:
> (add-hook 'gnus-exit-group-hook 'gnus-group-save-newsrc)
>
> doesn't seem to do it (probably gnus-group-save-newsrc needs to be
> invoked from outside the group). Any suggestions?
You could just do something like
(lambda ()
(save-excursion
(set-buffer gnus-group-buffer)
(gnus-group-save-newsrc)))
Or something.
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: gnus-group-save-newsrc on group exit
2003-01-24 21:31 ` Lars Magne Ingebrigtsen
@ 2003-01-27 18:12 ` Ted Zlatanov
2003-01-27 18:34 ` Ted Zlatanov
2003-01-27 23:39 ` Lars Magne Ingebrigtsen
0 siblings, 2 replies; 8+ messages in thread
From: Ted Zlatanov @ 2003-01-27 18:12 UTC (permalink / raw)
On Fri, 24 Jan 2003, larsi@gnus.org wrote:
> Ted Zlatanov <tzz@lifelogs.com> writes:
>
>> (add-hook 'gnus-exit-group-hook 'gnus-group-save-newsrc)
>>
>> doesn't seem to do it (probably gnus-group-save-newsrc needs to be
>> invoked from outside the group). Any suggestions?
>
> You could just do something like
>
> (lambda ()
> (save-excursion
> (set-buffer gnus-group-buffer)
> (gnus-group-save-newsrc)))
I tried variations of this, but nothing worked. I still need to hit
's' every time I go back to the group buffer.
Ted
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: gnus-group-save-newsrc on group exit
2003-01-27 18:12 ` Ted Zlatanov
@ 2003-01-27 18:34 ` Ted Zlatanov
2003-01-27 23:39 ` Lars Magne Ingebrigtsen
1 sibling, 0 replies; 8+ messages in thread
From: Ted Zlatanov @ 2003-01-27 18:34 UTC (permalink / raw)
On Mon, 27 Jan 2003, tzz@lifelogs.com wrote:
> On Fri, 24 Jan 2003, larsi@gnus.org wrote:
>> Ted Zlatanov <tzz@lifelogs.com> writes:
>>
>>> (add-hook 'gnus-exit-group-hook 'gnus-group-save-newsrc)
>>>
>>> doesn't seem to do it (probably gnus-group-save-newsrc needs to be
>>> invoked from outside the group). Any suggestions?
>>
>> You could just do something like
>>
>> (lambda ()
>> (save-excursion
>> (set-buffer gnus-group-buffer)
>> (gnus-group-save-newsrc)))
>
> I tried variations of this, but nothing worked. I still need to hit
> 's' every time I go back to the group buffer.
Here's the exact code and output:
(defun tzz-save-newsrc ()
(save-excursion
(set-buffer gnus-group-buffer)
(gnus-group-save-newsrc))
(message "Saved newsrc tzz"))
(add-hook 'gnus-exit-group-hook 'tzz-save-newsrc)
Output:
Exiting summary buffer and applying spam rules
Saving /home/tzz/.newsrc...
Wrote /home/tzz/.newsrc
Saving /home/tzz/.newsrc...done
Saving /home/tzz/.newsrc.eld...
Adding whitespace to .newsrc.eld
Wrote /home/tzz/.newsrc.eld
Saving /home/tzz/.newsrc.eld...done
Saved newsrc tzz
(No changes need to be saved)
Thanks
Ted
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: gnus-group-save-newsrc on group exit
2003-01-27 18:12 ` Ted Zlatanov
2003-01-27 18:34 ` Ted Zlatanov
@ 2003-01-27 23:39 ` Lars Magne Ingebrigtsen
2003-01-28 1:37 ` Ted Zlatanov
1 sibling, 1 reply; 8+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-01-27 23:39 UTC (permalink / raw)
Ted Zlatanov <tzz@lifelogs.com> writes:
> I tried variations of this, but nothing worked. I still need to hit
> 's' every time I go back to the group buffer.
Try using `gnus-summary-exit-hook' instead -- it's called later than
the other hook.
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: gnus-group-save-newsrc on group exit
2003-01-27 23:39 ` Lars Magne Ingebrigtsen
@ 2003-01-28 1:37 ` Ted Zlatanov
0 siblings, 0 replies; 8+ messages in thread
From: Ted Zlatanov @ 2003-01-28 1:37 UTC (permalink / raw)
On Tue, 28 Jan 2003, larsi@gnus.org wrote:
> Try using `gnus-summary-exit-hook' instead -- it's called later than
> the other hook.
Perfect, that works great.
Thanks
Ted
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2003-01-28 1:37 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-22 12:40 gnus-group-save-newsrc on group exit Ted Zlatanov
2003-01-22 13:57 ` Reiner Steib
2003-01-22 16:05 ` Ted Zlatanov
2003-01-24 21:31 ` Lars Magne Ingebrigtsen
2003-01-27 18:12 ` Ted Zlatanov
2003-01-27 18:34 ` Ted Zlatanov
2003-01-27 23:39 ` Lars Magne Ingebrigtsen
2003-01-28 1:37 ` Ted Zlatanov
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).