Gnus development mailing list
 help / color / mirror / Atom feed
* Proposed code to cleanup gnus on Emacs exit
@ 2011-08-23 17:12 John Wiegley
  2011-09-10 22:20 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 18+ messages in thread
From: John Wiegley @ 2011-08-23 17:12 UTC (permalink / raw)
  To: ding

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




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

* Re: Proposed code to cleanup gnus on Emacs exit
  2011-08-23 17:12 Proposed code to cleanup gnus on Emacs exit John Wiegley
@ 2011-09-10 22:20 ` Lars Magne Ingebrigtsen
  2011-09-11  0:42   ` John Wiegley
  0 siblings, 1 reply; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-09-10 22:20 UTC (permalink / raw)
  To: ding

John Wiegley <jwiegley@gmail.com> writes:

> 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:

Adding large and error-prone chunks of code to the general Emacs exit
isn't a good idea, in my opinion.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




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

* Re: Proposed code to cleanup gnus on Emacs exit
  2011-09-10 22:20 ` Lars Magne Ingebrigtsen
@ 2011-09-11  0:42   ` John Wiegley
  2011-09-11  1:09     ` Richard Riley
  2011-09-29  8:32     ` Ted Zlatanov
  0 siblings, 2 replies; 18+ messages in thread
From: John Wiegley @ 2011-09-11  0:42 UTC (permalink / raw)
  To: ding

>>>>> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Adding large and error-prone chunks of code to the general Emacs exit isn't
> a good idea, in my opinion.

Are you referring to Gnus?  I've been using that exit code for about 13 years
now, and have yet to experience problems with it.

John




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

* Re: Proposed code to cleanup gnus on Emacs exit
  2011-09-11  0:42   ` John Wiegley
@ 2011-09-11  1:09     ` Richard Riley
  2011-09-29  8:32     ` Ted Zlatanov
  1 sibling, 0 replies; 18+ messages in thread
From: Richard Riley @ 2011-09-11  1:09 UTC (permalink / raw)
  To: ding

John Wiegley <jwiegley@gmail.com> writes:

>>>>>> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>
>> Adding large and error-prone chunks of code to the general Emacs exit isn't
>> a good idea, in my opinion.
>
> Are you referring to Gnus?  I've been using that exit code for about 13 years
> now, and have yet to experience problems with it.

I added it to my setup and it works fine - a +1 from me.




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

* Re: Proposed code to cleanup gnus on Emacs exit
  2011-09-11  0:42   ` John Wiegley
  2011-09-11  1:09     ` Richard Riley
@ 2011-09-29  8:32     ` Ted Zlatanov
  2011-09-29 21:55       ` John Wiegley
                         ` (2 more replies)
  1 sibling, 3 replies; 18+ messages in thread
From: Ted Zlatanov @ 2011-09-29  8:32 UTC (permalink / raw)
  To: ding

On Sat, 10 Sep 2011 19:42:53 -0500 John Wiegley <jwiegley@gmail.com> wrote: 

>>>>>> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>> Adding large and error-prone chunks of code to the general Emacs exit isn't
>> a good idea, in my opinion.

JW> Are you referring to Gnus?  I've been using that exit code for about
JW> 13 years now, and have yet to experience problems with it.

How about making it optional and off by default, toggled on by a
boolean?  It seems useful.

Ted




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

* Re: Proposed code to cleanup gnus on Emacs exit
  2011-09-29  8:32     ` Ted Zlatanov
@ 2011-09-29 21:55       ` John Wiegley
  2011-10-06 21:23       ` Lars Magne Ingebrigtsen
  2011-10-08  9:59       ` Reiner Steib
  2 siblings, 0 replies; 18+ messages in thread
From: John Wiegley @ 2011-09-29 21:55 UTC (permalink / raw)
  To: ding

>>>>> Ted Zlatanov <tzz@lifelogs.com> writes:

JW> Are you referring to Gnus?  I've been using that exit code for about 13
JW> years now, and have yet to experience problems with it.

> How about making it optional and off by default, toggled on by a boolean?
> It seems useful.

Sounds like a good compromise to me.

John




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

* Re: Proposed code to cleanup gnus on Emacs exit
  2011-09-29  8:32     ` Ted Zlatanov
  2011-09-29 21:55       ` John Wiegley
@ 2011-10-06 21:23       ` Lars Magne Ingebrigtsen
  2011-10-06 22:26         ` Dave Abrahams
  2011-10-08  9:59       ` Reiner Steib
  2 siblings, 1 reply; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-10-06 21:23 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> How about making it optional and off by default, toggled on by a
> boolean?  It seems useful.

I don't really see the need.  The dribble file is saved, and that should
be sufficient.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/



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

* Re: Proposed code to cleanup gnus on Emacs exit
  2011-10-06 21:23       ` Lars Magne Ingebrigtsen
@ 2011-10-06 22:26         ` Dave Abrahams
  2011-10-06 22:33           ` Lars Magne Ingebrigtsen
  2011-10-07  1:10           ` Dan Christensen
  0 siblings, 2 replies; 18+ messages in thread
From: Dave Abrahams @ 2011-10-06 22:26 UTC (permalink / raw)
  To: ding


on Thu Oct 06 2011, Lars Magne Ingebrigtsen <larsi-AT-gnus.org> wrote:

> Ted Zlatanov <tzz@lifelogs.com> writes:
>
>> How about making it optional and off by default, toggled on by a
>> boolean?  It seems useful.
>
> I don't really see the need.  The dribble file is saved, and that should
> be sufficient.

But then you get an alarming message and a prompt the next time you
start up gnus.  Why shouldn't it just be safe and smooth to quit emacs
whenever?

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com




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

* Re: Proposed code to cleanup gnus on Emacs exit
  2011-10-06 22:26         ` Dave Abrahams
@ 2011-10-06 22:33           ` Lars Magne Ingebrigtsen
  2011-10-06 23:54             ` John Wiegley
  2011-10-07  3:00             ` Dave Abrahams
  2011-10-07  1:10           ` Dan Christensen
  1 sibling, 2 replies; 18+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-10-06 22:33 UTC (permalink / raw)
  To: Dave Abrahams; +Cc: ding

Dave Abrahams <dave@boostpro.com> writes:

> But then you get an alarming message and a prompt the next time you
> start up gnus.

I don't think it's particularly alarming.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/



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

* Re: Proposed code to cleanup gnus on Emacs exit
  2011-10-06 22:33           ` Lars Magne Ingebrigtsen
@ 2011-10-06 23:54             ` John Wiegley
  2011-10-07  3:00             ` Dave Abrahams
  1 sibling, 0 replies; 18+ messages in thread
From: John Wiegley @ 2011-10-06 23:54 UTC (permalink / raw)
  To: ding

>>>>> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Dave Abrahams <dave@boostpro.com> writes:
>> But then you get an alarming message and a prompt the next time you start
>> up gnus.

> I don't think it's particularly alarming.

I find myself alarmed.

John




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

* Re: Proposed code to cleanup gnus on Emacs exit
  2011-10-06 22:26         ` Dave Abrahams
  2011-10-06 22:33           ` Lars Magne Ingebrigtsen
@ 2011-10-07  1:10           ` Dan Christensen
  1 sibling, 0 replies; 18+ messages in thread
From: Dan Christensen @ 2011-10-07  1:10 UTC (permalink / raw)
  To: ding

Dave Abrahams <dave@boostpro.com> writes:

> But then you get an alarming message and a prompt the next time you
> start up gnus.  Why shouldn't it just be safe and smooth to quit emacs
> whenever?

If I'm in the middle of reading a message, get distracted, and then quit
emacs, gnus might mark the article as read and I'd never get to see it
again.  Those prompts about unsaved summary buffers are helpful
reminders that you might want to finish what you were in the middle of.

Dan




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

* Re: Proposed code to cleanup gnus on Emacs exit
  2011-10-06 22:33           ` Lars Magne Ingebrigtsen
  2011-10-06 23:54             ` John Wiegley
@ 2011-10-07  3:00             ` Dave Abrahams
  2011-10-07 19:48               ` Dan Christensen
  1 sibling, 1 reply; 18+ messages in thread
From: Dave Abrahams @ 2011-10-07  3:00 UTC (permalink / raw)
  To: ding


on Thu Oct 06 2011, Lars Magne Ingebrigtsen <larsi-AT-gnus.org> wrote:

> Dave Abrahams <dave@boostpro.com> writes:
>
>> But then you get an alarming message and a prompt the next time you
>> start up gnus.
>
> I don't think it's particularly alarming.

Of course not.  Can't we at least read the dribble file unconditionally?
IIRC Gnus can become hopelessly borked if you answer "no" to that
prompt.  In fact, I seem to remember you telling me years ago to just
answer yes always.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com




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

* Re: Proposed code to cleanup gnus on Emacs exit
  2011-10-07  3:00             ` Dave Abrahams
@ 2011-10-07 19:48               ` Dan Christensen
  2011-10-07 20:22                 ` Dave Abrahams
                                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Dan Christensen @ 2011-10-07 19:48 UTC (permalink / raw)
  To: ding

Dave Abrahams <dave@boostpro.com> writes:

> Can't we at least read the dribble file unconditionally?

Please, no.  If I accidentally catch up a group or something else gets
messed up, then what I do is exit emacs *without* saving the .newsrc.eld
and then start Gnus without reading the dribble file.  You are proposing
removing both of those options, which would get rid of that safety net.

Dan




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

* Re: Proposed code to cleanup gnus on Emacs exit
  2011-10-07 19:48               ` Dan Christensen
@ 2011-10-07 20:22                 ` Dave Abrahams
  2011-10-08  6:14                   ` Steinar Bang
  2011-10-07 20:48                 ` Michael Cook
  2011-10-07 23:19                 ` Richard Riley
  2 siblings, 1 reply; 18+ messages in thread
From: Dave Abrahams @ 2011-10-07 20:22 UTC (permalink / raw)
  To: ding


on Fri Oct 07 2011, Dan Christensen <jdc-AT-uwo.ca> wrote:

> Dave Abrahams <dave@boostpro.com> writes:
>
>> Can't we at least read the dribble file unconditionally?
>
> Please, no.  If I accidentally catch up a group or something else gets
> messed up, then what I do is exit emacs *without* saving the .newsrc.eld
> and then start Gnus without reading the dribble file.  You are proposing
> removing both of those options, which would get rid of that safety net.

This seems like optimizing the 1% case at the expense of the other 99.

`M-x gnus-no-dribble RET'?


-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com




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

* Re: Proposed code to cleanup gnus on Emacs exit
  2011-10-07 19:48               ` Dan Christensen
  2011-10-07 20:22                 ` Dave Abrahams
@ 2011-10-07 20:48                 ` Michael Cook
  2011-10-07 23:19                 ` Richard Riley
  2 siblings, 0 replies; 18+ messages in thread
From: Michael Cook @ 2011-10-07 20:48 UTC (permalink / raw)
  To: ding

Dan Christensen <jdc@uwo.ca> writes:

> Dave Abrahams <dave@boostpro.com> writes:
>
>> Can't we at least read the dribble file unconditionally?
>
> Please, no.  If I accidentally catch up a group or something else gets
> messed up, then what I do is exit emacs *without* saving the .newsrc.eld
> and then start Gnus without reading the dribble file.  You are proposing
> removing both of those options, which would get rid of that safety net.

Your safety net could be to remove the dribble file before
restarting gnus.  After all, you knew something had gone wrong
before you decided to exit without saving.

Michael



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

* Re: Proposed code to cleanup gnus on Emacs exit
  2011-10-07 19:48               ` Dan Christensen
  2011-10-07 20:22                 ` Dave Abrahams
  2011-10-07 20:48                 ` Michael Cook
@ 2011-10-07 23:19                 ` Richard Riley
  2 siblings, 0 replies; 18+ messages in thread
From: Richard Riley @ 2011-10-07 23:19 UTC (permalink / raw)
  To: ding

Dan Christensen <jdc@uwo.ca> writes:

> Dave Abrahams <dave@boostpro.com> writes:
>
>> Can't we at least read the dribble file unconditionally?
>
> Please, no.  If I accidentally catch up a group or something else gets
> messed up, then what I do is exit emacs *without* saving the .newsrc.eld
> and then start Gnus without reading the dribble file.  You are proposing
> removing both of those options, which would get rid of that safety net.

So the poor solution remains because of the chance of one person making
the wrong decision and issuing a legitimate command which then gnus acts
correctly on? Better would be if you want to be able to undo stuff then
use git or something on your .eld file.





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

* Re: Proposed code to cleanup gnus on Emacs exit
  2011-10-07 20:22                 ` Dave Abrahams
@ 2011-10-08  6:14                   ` Steinar Bang
  0 siblings, 0 replies; 18+ messages in thread
From: Steinar Bang @ 2011-10-08  6:14 UTC (permalink / raw)
  To: ding

>>>>> Dave Abrahams <dave@boostpro.com>:

> This seems like optimizing the 1% case at the expense of the other 99.

Just stating for the record: as a long term gnus user, I'm comfortable
with the current behaviour, and see no need for a change.




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

* Re: Proposed code to cleanup gnus on Emacs exit
  2011-09-29  8:32     ` Ted Zlatanov
  2011-09-29 21:55       ` John Wiegley
  2011-10-06 21:23       ` Lars Magne Ingebrigtsen
@ 2011-10-08  9:59       ` Reiner Steib
  2 siblings, 0 replies; 18+ messages in thread
From: Reiner Steib @ 2011-10-08  9:59 UTC (permalink / raw)
  To: ding

On Thu, Sep 29 2011, Ted Zlatanov wrote:

> On Sat, 10 Sep 2011 19:42:53 -0500 John Wiegley <jwiegley@gmail.com> wrote: 
[ `gnus-group-exit' in `kill-emacs-hook´ ]
> How about making it optional and off by default, toggled on by a
> boolean?  It seems useful.

If such code is added to `kill-emacs-hook´, it should query to save
the ~/.newsrc.eld file instead of doing it unconditionally.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

end of thread, other threads:[~2011-10-08  9:59 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-23 17:12 Proposed code to cleanup gnus on Emacs exit John Wiegley
2011-09-10 22:20 ` Lars Magne Ingebrigtsen
2011-09-11  0:42   ` John Wiegley
2011-09-11  1:09     ` Richard Riley
2011-09-29  8:32     ` Ted Zlatanov
2011-09-29 21:55       ` John Wiegley
2011-10-06 21:23       ` Lars Magne Ingebrigtsen
2011-10-06 22:26         ` Dave Abrahams
2011-10-06 22:33           ` Lars Magne Ingebrigtsen
2011-10-06 23:54             ` John Wiegley
2011-10-07  3:00             ` Dave Abrahams
2011-10-07 19:48               ` Dan Christensen
2011-10-07 20:22                 ` Dave Abrahams
2011-10-08  6:14                   ` Steinar Bang
2011-10-07 20:48                 ` Michael Cook
2011-10-07 23:19                 ` Richard Riley
2011-10-07  1:10           ` Dan Christensen
2011-10-08  9:59       ` Reiner Steib

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