Gnus development mailing list
 help / color / mirror / Atom feed
From: Teemu Likonen <tlikonen@iki.fi>
To: ding@gnus.org, emacs-devel@gnu.org
Subject: One more use for gnus-expert-user
Date: Sat, 29 May 2010 09:40:53 +0300	[thread overview]
Message-ID: <87wrunmcqy.fsf@mithlond.arda> (raw)

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



             reply	other threads:[~2010-05-29  6:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-29  6:40 Teemu Likonen [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wrunmcqy.fsf@mithlond.arda \
    --to=tlikonen@iki.fi \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).