Gnus development mailing list
 help / color / mirror / Atom feed
* One more use for gnus-expert-user
@ 2010-05-29  6:40 Teemu Likonen
  2010-06-05  2:28 ` Ted Zlatanov
  0 siblings, 1 reply; 6+ messages in thread
From: Teemu Likonen @ 2010-05-29  6:40 UTC (permalink / raw)
  To: ding, emacs-devel

I'd like to suggest one more case where gnus-expert-user variable is
respected.

Details: Function gnus-agent-expire expires old articles from Gnus
agent's cache. When it founds directories (under ~/News/agent/) which
are no longer needed gnus-agent-expire (well, actually its helper
function) uses gnus-y-or-n-p function to ask whether the directory
should be deleted. User may want to unconditionally delete such
directories when she runs gnus-agent-expire automatically from some hook
(like gnus-exit-gnus-hook). The problem is that currently there is no
simple way to prevent the y-or-n question.

Currently I'm using a work-around with around-advice for gnus-y-or-n-p.
My advice, when activated, doesn't call the original gnus-y-or-n-p
function at all. It just unconditionally returns non-nil. I think that
this would be a good place to respect gnus-expert-user variable, though.

Here's a patch that implements my suggestion:

--8<---------------cut here---------------start------------->8---
diff --git i/lisp/gnus/gnus-agent.el w/lisp/gnus/gnus-agent.el
index f385c71..67af39b 100644
--- i/lisp/gnus/gnus-agent.el
+++ w/lisp/gnus/gnus-agent.el
@@ -3631,7 +3631,8 @@ articles in every agentized group? "))
  deleting them?")))
           (while to-remove
             (let ((dir (pop to-remove)))
-              (if (gnus-y-or-n-p (format "Delete %s? " dir))
+              (if (or gnus-expert-user
+		      (gnus-y-or-n-p (format "Delete %s? " dir)))
                   (let* (delete-recursive
 			 files f
                          (delete-recursive
--8<---------------cut here---------------end--------------->8---



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

* Re: One more use for gnus-expert-user
  2010-05-29  6:40 One more use for gnus-expert-user Teemu Likonen
@ 2010-06-05  2:28 ` Ted Zlatanov
  2010-06-05  4:30   ` Teemu Likonen
  0 siblings, 1 reply; 6+ messages in thread
From: Ted Zlatanov @ 2010-06-05  2:28 UTC (permalink / raw)
  To: Teemu Likonen; +Cc: ding, emacs-devel

On Sat, 29 May 2010 09:40:53 +0300 Teemu Likonen <tlikonen@iki.fi> wrote: 

TL> Here's a patch that implements my suggestion:
TL> diff --git i/lisp/gnus/gnus-agent.el w/lisp/gnus/gnus-agent.el
TL> index f385c71..67af39b 100644
TL> --- i/lisp/gnus/gnus-agent.el
TL> +++ w/lisp/gnus/gnus-agent.el
TL> @@ -3631,7 +3631,8 @@ articles in every agentized group? "))
TL>   deleting them?")))
TL>            (while to-remove
TL>              (let ((dir (pop to-remove)))
TL> -              (if (gnus-y-or-n-p (format "Delete %s? " dir))
TL> +              (if (or gnus-expert-user
TL> +		      (gnus-y-or-n-p (format "Delete %s? " dir)))
TL>                    (let* (delete-recursive
TL>  			 files f
TL>                           (delete-recursive

I'm OK with this (although it's pretty esoteric for most users), but the
Gnus manual should be updated correspondingly as well.  Can you include
that in your patch?

Thanks!
Ted



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

* Re: One more use for gnus-expert-user
  2010-06-05  2:28 ` Ted Zlatanov
@ 2010-06-05  4:30   ` Teemu Likonen
  2010-06-05 21:38     ` Ted Zlatanov
  0 siblings, 1 reply; 6+ messages in thread
From: Teemu Likonen @ 2010-06-05  4:30 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding, emacs-devel

* 2010-06-04 21:28 (-0500), Ted Zlatanov wrote:

> On Sat, 29 May 2010 09:40:53 +0300 Teemu Likonen <tlikonen@iki.fi> wrote: 
> TL> Here's a patch that implements my suggestion:
> TL> diff --git i/lisp/gnus/gnus-agent.el w/lisp/gnus/gnus-agent.el

> I'm OK with this (although it's pretty esoteric for most users), but
> the Gnus manual should be updated correspondingly as well. Can you
> include that in your patch?

I could but I have no idea what "corresponding update" might mean in
this case. The only place where variable gnus-expert-user is mentioned
in the manual (in GNU Emacs 23.2) is section 8.2 Interactive:

    `gnus-expert-user'
         If this variable is non-`nil', you will seldom be asked any
         questions by Gnus.  It will simply assume you know what you're
         doing, no matter how strange.

And that description covers everything.

Section 6.9.6 Agent Expiry is only about user-interface. There is
nothing about files and such things nor about current uses of
gnus-expert-user (which do exist in the expiry mechanism).

So, to be honest, I feel that my patch fits there just fine without
changes in the manual.



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

* Re: One more use for gnus-expert-user
  2010-06-05  4:30   ` Teemu Likonen
@ 2010-06-05 21:38     ` Ted Zlatanov
  2010-06-06  8:51       ` Teemu Likonen
  0 siblings, 1 reply; 6+ messages in thread
From: Ted Zlatanov @ 2010-06-05 21:38 UTC (permalink / raw)
  To: Teemu Likonen; +Cc: ding

On Sat, 05 Jun 2010 07:30:36 +0300 Teemu Likonen <tlikonen@iki.fi> wrote: 

TL> * 2010-06-04 21:28 (-0500), Ted Zlatanov wrote:
>> On Sat, 29 May 2010 09:40:53 +0300 Teemu Likonen <tlikonen@iki.fi> wrote: 
TL> Here's a patch that implements my suggestion:
TL> diff --git i/lisp/gnus/gnus-agent.el w/lisp/gnus/gnus-agent.el

>> I'm OK with this (although it's pretty esoteric for most users), but
>> the Gnus manual should be updated correspondingly as well. Can you
>> include that in your patch?

TL> I could but I have no idea what "corresponding update" might mean in
TL> this case. The only place where variable gnus-expert-user is mentioned
TL> in the manual (in GNU Emacs 23.2) is section 8.2 Interactive:

TL>     `gnus-expert-user'
TL>          If this variable is non-`nil', you will seldom be asked any
TL>          questions by Gnus.  It will simply assume you know what you're
TL>          doing, no matter how strange.

(removing emacs-devel for now)

Hmm, I could have sworn that variable was covered in more detail.
Sorry.  Here's a manual change that lists some of the more interesting
uses of gnus-expert-user; I omitted the agent expiry.  WDYT?

Thanks
Ted

diff --git a/texi/gnus.texi b/texi/gnus.texi
index abb84de..a921cc6 100644
--- a/texi/gnus.texi
+++ b/texi/gnus.texi
@@ -22906,8 +22906,11 @@ default.
 @item gnus-expert-user
 @vindex gnus-expert-user
 If this variable is non-@code{nil}, you will seldom be asked any
-questions by Gnus.  It will simply assume you know what you're doing, no
-matter how strange.
+questions by Gnus.  It will simply assume you know what you're doing,
+no matter how strange.  For example, quitting Gnus, exiting a group
+without an update, catching up with a group, deleting expired
+articles, and replying by mail to a news message will not require
+confirmation.
 
 @item gnus-interactive-catchup
 @vindex gnus-interactive-catchup



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

* Re: One more use for gnus-expert-user
  2010-06-05 21:38     ` Ted Zlatanov
@ 2010-06-06  8:51       ` Teemu Likonen
  2010-06-07 16:20         ` Ted Zlatanov
  0 siblings, 1 reply; 6+ messages in thread
From: Teemu Likonen @ 2010-06-06  8:51 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding

* 2010-06-05 16:38 (-0500), Ted Zlatanov wrote:

> Here's a manual change that lists some of the more interesting uses of
> gnus-expert-user; I omitted the agent expiry. WDYT?

I think it's good: examples are always helpful. 

Thanks.


> diff --git a/texi/gnus.texi b/texi/gnus.texi
> index abb84de..a921cc6 100644
> --- a/texi/gnus.texi
> +++ b/texi/gnus.texi
> @@ -22906,8 +22906,11 @@ default.
>  @item gnus-expert-user
>  @vindex gnus-expert-user
>  If this variable is non-@code{nil}, you will seldom be asked any
> -questions by Gnus.  It will simply assume you know what you're doing, no
> -matter how strange.
> +questions by Gnus.  It will simply assume you know what you're doing,
> +no matter how strange.  For example, quitting Gnus, exiting a group
> +without an update, catching up with a group, deleting expired
> +articles, and replying by mail to a news message will not require
> +confirmation.
>  
>  @item gnus-interactive-catchup
>  @vindex gnus-interactive-catchup



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

* Re: One more use for gnus-expert-user
  2010-06-06  8:51       ` Teemu Likonen
@ 2010-06-07 16:20         ` Ted Zlatanov
  0 siblings, 0 replies; 6+ messages in thread
From: Ted Zlatanov @ 2010-06-07 16:20 UTC (permalink / raw)
  To: Teemu Likonen; +Cc: ding

On Sun, 06 Jun 2010 11:51:18 +0300 Teemu Likonen <tlikonen@iki.fi> wrote: 

TL> * 2010-06-05 16:38 (-0500), Ted Zlatanov wrote:
>> Here's a manual change that lists some of the more interesting uses of
>> gnus-expert-user; I omitted the agent expiry. WDYT?

TL> I think it's good: examples are always helpful. 

Great, thanks.  I comitted the doc change and your tiny patch as well.

Ted



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

end of thread, other threads:[~2010-06-07 16:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-29  6:40 One more use for gnus-expert-user Teemu Likonen
2010-06-05  2:28 ` Ted Zlatanov
2010-06-05  4:30   ` Teemu Likonen
2010-06-05 21:38     ` Ted Zlatanov
2010-06-06  8:51       ` Teemu Likonen
2010-06-07 16:20         ` 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).