info-gnus-english
[Top][All Lists]
Advanced

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

Re: Limiting the summary buffer by recipient


From: Reiner Steib
Subject: Re: Limiting the summary buffer by recipient
Date: Thu, 02 Dec 2004 14:11:59 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

On Wed, Dec 01 2004, David Mazieres (address expires 29 Jan 2005) wrote:

> I definitely saw that in the manual, but that info page didn't say how
> to regenerate the NOV files, just that I should do it.  I tried going
> to the server buffer and saying pressing "g"
> (gnus-server-regenerate-server), 

This should be correct.  The current version has this:

,----[ (info "(gnus)To From Newsgroups") ]
| If you have old overview files, you should regenerate them after
| changing this variable, by entering the server buffer using `^', and
| then `g' on the appropriate mail server (e.g. nnml) to cause
| regeneration.
`----

> but it says:
>
>    gnus-server-regenerate-server: This backend doesn't support
>    regeneration

Yes, nnimap doesn't.

> For what it's worth, gnus does seem to be creating novcache files in
> directories like .../overview/nnimap/servername/mailbox/....  Should I
> just delete those files and hope gnus can re-create them properly?

I don't remember how the IMAP overview stuff was in 5.9.  `/ x To RET
...'  works for me in IMAP groups.  In 5.10 the nnimap overview stuff
is done by the agent, IIRC.  Deleting the overview is okay as far as I
know.  (Personally, I don't use the agent and I don't see any IMAP
overview data on my local disk.  Nevertheless `/ x To' works fine.)

> If there's some way to fix this, I would be very happy.

I'd recommend to upgrade to Gnus 5.10.6 which is the latest release.
Gnus 5.11 (basically identical to 5.10.x) is already included in the
CVS version of Emacs.

> (Though of course the next question is whether you can limit to two
> headers at a time... i.e., restrict to any article that contains an
> email address in either the To or CC headers.  Too bad
> gnus-extra-headers takes atoms rather than regular expressions, but
> I assume this is required for efficiency.)

I have included To and Cc in `gnus-extra-headers' and
`nnmail-extra-headers' now and regenerated the overview of my nnml
server.  In both, nnml and nnimap the following code works for me.  I
think we can include it in the new version of Gnus.  Feedback welcome.

--8<---------------cut here---------------start------------->8---
;; Suggested by David Mazieres in <news:6czn0zqcc5.fsf@orchard.scs.cs.nyu.edu>
;; in analogy to `rmail-summary-by-recipients'.  Unlike
;; `rmail-summary-by-recipients', doesn't include From.

;;;###autoload
(defun rs-gnus-summary-limit-to-recipient (recipient &optional not-matching)
  "Limit the summary buffer to articles with the given RECIPIENT.

To and Cc headers are checked.  You need to include them in
`nnmail-extra-headers'."
  (interactive
   (list (read-string (format "%s recipient (regexp): "
                              (if current-prefix-arg "Exclude" "Limit to")))
         current-prefix-arg))
  (when (not (equal "" recipient))
    (prog1 (let* ((articles1
                   (if (memq 'To nnmail-extra-headers)
                       (gnus-summary-find-matching
                        (cons 'extra 'To) recipient 'all nil nil
                        not-matching)
                     (gnus-message
                      1 "`To' isn't present in `nnmail-extra-headers'")
                     (sit-for 1)
                     nil))
                  (articles2
                   (if (memq 'Cc nnmail-extra-headers)
                       (gnus-summary-find-matching
                        (cons 'extra 'Cc) recipient 'all nil nil
                        not-matching)
                     (gnus-message
                      1 "`Cc' isn't present in `nnmail-extra-headers'")
                     (sit-for 1)
                     nil))
                  (articles (nconc articles1 articles2)))
             (unless articles
               (error "Found no matches for \"%s\"" recipient))
             (gnus-summary-limit articles))
      (gnus-summary-position-point))))
--8<---------------cut here---------------end--------------->8---

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/


reply via email to

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