[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

One more use for gnus-expert-user

From: Teemu Likonen
Subject: One more use for gnus-expert-user
Date: Sat, 29 May 2010 09:40:53 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.50 (gnu/linux)

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

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
--8<---------------cut here---------------end--------------->8---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]