[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: M-g on nnml group
From: |
Katsumi Yamaoka |
Subject: |
Re: M-g on nnml group |
Date: |
Mon, 26 Mar 2007 18:38:25 +0900 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.96 (gnu/linux) |
>>>>> In <mailman.1434.1174895767.7795.info-gnus-english@gnu.org>
>>>>> Leo wrote:
> On 2007-03-26, Katsumi Yamaoka said:
>> I have no idea if you wrote about the `M-g' command in the group
>> buffer, not in the summary buffer.
> I mean M-g in the group buffer. Does your solution still work?
It is not very easy to advise `gnus-group-get-new-news-this-group'
since it should work even for two or more groups (when you give
a numeric argument or set the region). But here it is:
--8<---------------cut here---------------start------------->8---
(defadvice gnus-group-get-new-news-this-group (around dont-fetch-mails
activate)
"Don't fetch mails for certain nnml groups."
(let* ((groups (gnus-group-process-prefix (ad-get-arg 0)))
(ret (if (numberp (ad-get-arg 0))
(- (ad-get-arg 0) (length groups))
0))
(beg (unless (ad-get-arg 0)
(point)))
nofetch fetch ggpp)
(dolist (group groups)
(if (string-match "\\`nnml:Sent-Mails\\." group)
(push group nofetch)
(push group fetch)))
(cond ((null nofetch)
ad-do-it)
((null fetch)
(let ((nnml-get-new-mail nil))
ad-do-it))
(t
(setq ggpp (symbol-function 'gnus-group-process-prefix))
(fset 'gnus-group-process-prefix
`(lambda (arg) ,(cons 'list (nreverse nofetch))))
(unwind-protect
(let ((gnus-goto-next-group-when-activating nil))
(let ((nnml-get-new-mail nil))
ad-do-it)
(fset 'gnus-group-process-prefix
`(lambda (arg) ,(cons 'list (nreverse fetch))))
ad-do-it)
(fset 'gnus-group-process-prefix ggpp))
(when beg
(goto-char beg))
(when gnus-goto-next-group-when-activating
(gnus-group-next-unread-group 1 t))))
(setq ad-return-value ret)))
--8<---------------cut here---------------end--------------->8---