* 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; 3+ 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 related [flat|nested] 3+ 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; 3+ 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] 3+ 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
0 siblings, 0 replies; 3+ 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] 3+ messages in thread
end of thread, other threads:[~2010-06-05 4:30 UTC | newest]
Thread overview: 3+ 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
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).