changeset 96024:be43dd7afc91

Merge from gnus--devo--0 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1244
author Miles Bader <miles@gnu.org>
date Tue, 17 Jun 2008 02:32:59 +0000
parents 936483adbab6
children 86b03e4cc6d7
files doc/misc/ChangeLog doc/misc/gnus-faq.texi doc/misc/gnus.texi lisp/gnus/ChangeLog lisp/gnus/gnus-sum.el lisp/gnus/gnus-util.el lisp/gnus/nnimap.el lisp/gnus/nnmairix.el
diffstat 8 files changed, 1147 insertions(+), 460 deletions(-) [+]
line wrap: on
line diff
--- a/doc/misc/ChangeLog	Tue Jun 17 02:16:09 2008 +0000
+++ b/doc/misc/ChangeLog	Tue Jun 17 02:32:59 2008 +0000
@@ -63,9 +63,42 @@
 	* woman.texi:
 	Update Back-Cover Text as per maintain.info.
 
+2008-06-15  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus-faq.texi: Generate.  Change node names to "FAQ N-M".
+
+	* Makefile.in (gnus-faq-clean): Don't remove gnus-faq.texi.
+	(gnus-faq.xml): Update repository host.
+
+	* xml2texi.scm (boilerplate): Update copyright years.
+	(format-q-level): Change node names to "FAQ N-M", since period in
+	"[N.M]" is invalid, see "(texinfo)Node Line Requirements".
+
+	* gnus-faq.texi: Generate from gnus-faq.xml (sourceforge.net).
+
+2008-06-15  Frank Schmitt  <ich@frank-schmitt.net>
+
+	* gnus-faq.texi ([5.12]): Add entry about message-kill-buffer-on-exit.
+	Fix a typo.
+
+2008-06-15  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus.texi (Mail Source Customization): Correct values of
+	 `mail-source-delete-incoming'.  Reported by Tassilo Horn.
+	(Oort Gnus): Fix version comment for mml-dnd-protocol-alist.
+
+2008-06-14  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus.texi (nnmairix): Eliminate wrong use of `path', cf. the GNU
+	coding standards.
+
+2008-06-14  David Engster  <dengste@eml.cc>
+
+	* gnus.texi (nnmairix): Markup fixes.
+
 2008-06-05  Reiner Steib  <Reiner.Steib@gmx.de>
 
-	* gnus.texi (nnmairix): Markup and othe minor fixes.
+	* gnus.texi (nnmairix): Markup and other minor fixes.
 
 2008-06-05  David Engster  <dengste@eml.cc>
 
--- a/doc/misc/gnus-faq.texi	Tue Jun 17 02:16:09 2008 +0000
+++ b/doc/misc/gnus-faq.texi	Tue Jun 17 02:32:59 2008 +0000
@@ -63,8 +63,12 @@
 @itemize @bullet
 
 @item
-Updated FAQ to reflect release of Gnus 5.10 and start of
-No Gnus development.
+2008-06-15: Adjust for message-fill-column.  Add x-face-file.
+Clarify difference between ding and gnu.emacs.gnus.  Remove
+reference to discontinued service.
+
+@item
+2006-04-15: Added tip on how to delete sent buffer on exit.
 @end itemize
 
 @node FAQ - Introduction
@@ -109,17 +113,17 @@
 @subsection Installation FAQ
 
 @menu
-* [1.1]::    What is the latest version of Gnus?
-* [1.2]::    What's new in 5.10?
-* [1.3]::    Where and how to get Gnus?
-* [1.4]::    What to do with the tarball now?
-* [1.5]::    I sometimes read references to No Gnus and Oort Gnus, what
-             are those?
-* [1.6]::    Which version of Emacs do I need?
-* [1.7]::    How do I run Gnus on both Emacs and XEmacs?
+* FAQ 1-1::    What is the latest version of Gnus?
+* FAQ 1-2::    What's new in 5.10?
+* FAQ 1-3::    Where and how to get Gnus?
+* FAQ 1-4::    What to do with the tarball now?
+* FAQ 1-5::    I sometimes read references to No Gnus and Oort Gnus,
+               what are those?
+* FAQ 1-6::    Which version of Emacs do I need?
+* FAQ 1-7::    How do I run Gnus on both Emacs and XEmacs?
 @end menu
 
-@node [1.1]
+@node FAQ 1-1
 @subsubheading Question 1.1
 
 What is the latest version of Gnus?
@@ -132,7 +136,7 @@
 shouldn't miss. The current release (5.13) should be at
 least as stable as the latest release of the 5.8 series.
 
-@node [1.2]
+@node FAQ 1-2
 @subsubheading Question 1.2
 
 What's new in 5.10?
@@ -166,7 +170,7 @@
 a complex trn-style thread tree.
 @end itemize
 
-@node [1.3]
+@node FAQ 1-3
 @subsubheading Question 1.3
 
 Where and how to get Gnus?
@@ -176,13 +180,13 @@
 Gnus is released independent from releases of Emacs and XEmacs.
 Therefore, the version bundled with Emacs or the version in XEmacs'
 package system might not be up to date (e.g. Gnus 5.9 bundled with Emacs
-20 is outdated).
-@c
+21 is outdated).
 You can get the latest released version of Gnus from
-@uref{http://www.gnus.org/dist/gnus.tar.gz} or via anonymous FTP from
+@uref{http://www.gnus.org/dist/gnus.tar.gz}
+or via anonymous FTP from 
 @uref{ftp://ftp.gnus.org/pub/gnus/gnus.tar.gz}.
 
-@node [1.4]
+@node FAQ 1-4
 @subsubheading Question 1.4
 
 What to do with the tarball now?
@@ -213,7 +217,7 @@
 before this line, on MS Windows use something like
 "C:/path/to/lisp" (yes, "/").
 
-@node [1.5]
+@node FAQ 1-5
 @subsubheading Question 1.5
 
 I sometimes read references to No Gnus and Oort Gnus,
@@ -228,7 +232,7 @@
 not 5.11, the odd version numbers are normally used for
 the Gnus versions bundled with Emacs)
 
-@node [1.6]
+@node FAQ 1-6
 @subsubheading Question 1.6
 
 Which version of Emacs do I need?
@@ -240,7 +244,7 @@
 The development versions of Gnus (aka No Gnus) requires Emacs 21
 or XEmacs 21.4.
 
-@node [1.7]
+@node FAQ 1-7
 @subsubheading Question 1.7
 
 How do I run Gnus on both Emacs and XEmacs?
@@ -256,20 +260,20 @@
 @subsection Startup / Group buffer
 
 @menu
-* [2.1]::    Every time I start Gnus I get a message "Gnus auto-save
-             file exists. Do you want to read it?", what does this mean and
-             how to prevent it?
-* [2.2]::    Gnus doesn't remember which groups I'm subscribed to,
-             what's this?
-* [2.3]::    How to change the format of the lines in Group buffer?
-* [2.4]::    My group buffer becomes a bit crowded, is there a way to
-             sort my groups into categories so I can easier browse through
-             them?
-* [2.5]::    How to manually sort the groups in Group buffer? How to
-             sort the groups in a topic?
+* FAQ 2-1::    Every time I start Gnus I get a message "Gnus auto-save
+               file exists. Do you want to read it?", what does this mean and
+               how to prevent it?
+* FAQ 2-2::    Gnus doesn't remember which groups I'm subscribed to,
+               what's this?
+* FAQ 2-3::    How to change the format of the lines in Group buffer?
+* FAQ 2-4::    My group buffer becomes a bit crowded, is there a way to
+               sort my groups into categories so I can easier browse through
+               them?
+* FAQ 2-5::    How to manually sort the groups in Group buffer? How to
+               sort the groups in a topic?
 @end menu
 
-@node [2.1]
+@node FAQ 2-1
 @subsubheading Question 2.1
 
 Every time I start Gnus I get a message "Gnus auto-save
@@ -288,7 +292,7 @@
 via @samp{q} in group buffer instead of
 just killing Emacs.
 
-@node [2.2]
+@node FAQ 2-2
 @subsubheading Question 2.2
 
 Gnus doesn't remember which groups I'm subscribed to,
@@ -300,7 +304,7 @@
 starting Gnus, right? It's an other symptom for the same
 problem, so read the answer above.
 
-@node [2.3]
+@node FAQ 2-3
 @subsubheading Question 2.3
 
 How to change the format of the lines in Group buffer?
@@ -317,7 +321,7 @@
 @end example
 @noindent
 
-@node [2.4]
+@node FAQ 2-4
 @subsubheading Question 2.4
 
 My group buffer becomes a bit crowded, is there a way to
@@ -340,7 +344,7 @@
 beginning of your gnus-group-line-format variable to have
 the groups nicely indented.
 
-@node [2.5]
+@node FAQ 2-5
 @subsubheading Question 2.5
 
 How to manually sort the groups in Group buffer? How to
@@ -357,29 +361,29 @@
 @subsection Getting Messages
 
 @menu
-* [3.1]::     I just installed Gnus, started it via  @samp{M-x gnus} 
-              but it only says "nntp (news) open error", what to do?
-* [3.2]::     I'm working under Windows and have no idea what ~/.gnus.el
-              means.
-* [3.3]::     My news server requires authentication, how to store user
-              name and password on disk?
-* [3.4]::     Gnus seems to start up OK, but I can't find out how to
-              subscribe to a group.
-* [3.5]::     Gnus doesn't show all groups / Gnus says I'm not allowed
-              to post on this server as well as I am, what's that?
-* [3.6]::     I want Gnus to fetch news from several servers, is this
-              possible?
-* [3.7]::     And how about local spool files?
-* [3.8]::     OK, reading news works now, but I want to be able to read
-              my mail with Gnus, too. How to do it?
-* [3.9]::     And what about IMAP?
-* [3.10]::    At the office we use one of those MS Exchange servers, can
-              I use Gnus to read my mail from it?
-* [3.11]::    Can I tell Gnus not to delete the mails on the server it
-              retrieves via POP3?
+* FAQ 3-1::     I just installed Gnus, started it via  @samp{M-x gnus} 
+                but it only says "nntp (news) open error", what to do?
+* FAQ 3-2::     I'm working under Windows and have no idea what
+                ~/.gnus.el means.
+* FAQ 3-3::     My news server requires authentication, how to store
+                user name and password on disk?
+* FAQ 3-4::     Gnus seems to start up OK, but I can't find out how to
+                subscribe to a group.
+* FAQ 3-5::     Gnus doesn't show all groups / Gnus says I'm not allowed
+                to post on this server as well as I am, what's that?
+* FAQ 3-6::     I want Gnus to fetch news from several servers, is this
+                possible?
+* FAQ 3-7::     And how about local spool files?
+* FAQ 3-8::     OK, reading news works now, but I want to be able to
+                read my mail with Gnus, too. How to do it?
+* FAQ 3-9::     And what about IMAP?
+* FAQ 3-10::    At the office we use one of those MS Exchange servers,
+                can I use Gnus to read my mail from it?
+* FAQ 3-11::    Can I tell Gnus not to delete the mails on the server it
+                retrieves via POP3?
 @end menu
 
-@node [3.1]
+@node FAQ 3-1
 @subsubheading Question 3.1
 
 I just installed Gnus, started it via 
@@ -399,7 +403,7 @@
 @end example
 @noindent
 
-@node [3.2]
+@node FAQ 3-2
 @subsubheading Question 3.2
 
 I'm working under Windows and have no idea what ~/.gnus.el means.
@@ -429,16 +433,16 @@
 @noindent
 
 in your autoexec.bat and reboot.  Under NT, 2000 and XP, hit
-Winkey+Pause/Break to enter system options (if it doesn't work, go to
-Control Panel -> System -> Advanced). There you'll find the possibility
-to set environment variables.  Create a new one with name HOME and value
-C:\myhome.  Rebooting is not necessary.
+Winkey+Pause/Break to enter system options (if it doesn't work, go
+to Control Panel -> System -> Advanced). There you'll find the
+possibility to set environment variables.  Create a new one with
+name HOME and value C:\myhome.  Rebooting is not necessary.
 
 Now to create ~/.gnus.el, say
 @samp{C-x C-f ~/.gnus.el RET C-x C-s}.
 in Emacs.
 
-@node [3.3]
+@node FAQ 3-3
 @subsubheading Question 3.3
 
 My news server requires authentication, how to store
@@ -463,7 +467,7 @@
 
 in a shell.)
 
-@node [3.4]
+@node FAQ 3-4
 @subsubheading Question 3.4
 
 Gnus seems to start up OK, but I can't find out how to
@@ -480,7 +484,7 @@
 you want to subscribe to and say @samp{u}
 to subscribe to it.
 
-@node [3.5]
+@node FAQ 3-5
 @subsubheading Question 3.5
 
 Gnus doesn't show all groups / Gnus says I'm not allowed to
@@ -499,7 +503,7 @@
  
 to the line for those servers in ~/.authinfo.
 
-@node [3.6]
+@node FAQ 3-6
 @subsubheading Question 3.6
 
 I want Gnus to fetch news from several servers, is this possible?
@@ -518,7 +522,7 @@
 @end example
 @noindent
 
-@node [3.7]
+@node FAQ 3-7
 @subsubheading Question 3.7
 
 And how about local spool files?
@@ -554,7 +558,7 @@
 You might have to specify more stuff like the program used
 to post articles, see the Gnus manual on how to do this.
 
-@node [3.8]
+@node FAQ 3-8
 @subsubheading Question 3.8
 
 OK, reading news works now, but I want to be able to read my mail
@@ -652,7 +656,7 @@
 @end example
 @noindent
 
-@node [3.9]
+@node FAQ 3-9
 @subsubheading Question 3.9
 
 And what about IMAP?
@@ -698,7 +702,7 @@
 server if Gnus can't guess the correct way, see the Manual
 Node "IMAP" for detailed information.
 
-@node [3.10]
+@node FAQ 3-10
 @subsubheading Question 3.10
 
 At the office we use one of those MS Exchange servers, can I use
@@ -710,7 +714,7 @@
 activating IMAP on the server and follow the instructions
 above.
 
-@node [3.11]
+@node FAQ 3-11
 @subsubheading Question 3.11
 
 Can I tell Gnus not to delete the mails on the server it
@@ -749,38 +753,38 @@
 @subsection Reading messages
 
 @menu
-* [4.1]::     When I enter a group, all read messages are gone. How to
-              view them again?
-* [4.2]::     How to tell Gnus to show an important message every time I
-              enter a group, even when it's read?
-* [4.3]::     How to view the headers of a message?
-* [4.4]::     How to view the raw unformatted message?
-* [4.5]::     How can I change the headers Gnus displays by default at
-              the top of the article buffer?
-* [4.6]::     I'd like Gnus NOT to render HTML-mails but show me the
-              text part if it's available. How to do it?
-* [4.7]::     Can I use some other browser than w3 to render my
-              HTML-mails?
-* [4.8]::     Is there anything I can do to make poorly formatted mails
-              more readable?
-* [4.9]::     Is there a way to automatically ignore posts by specific
-              authors or with specific words in the subject? And can I highlight
-              more interesting ones in some way?
-* [4.10]::    How can I disable threading in some (e.g. mail-) groups,
-              or set other variables specific for some groups?
-* [4.11]::    Can I highlight messages written by me and follow-ups to
-              those?
-* [4.12]::    The number of total messages in a group which Gnus
-              displays in group buffer is by far to high, especially in mail
-              groups. Is this a bug?
-* [4.13]::    I don't like the layout of summary and article buffer, how
-              to change it? Perhaps even a three pane display?
-* [4.14]::    I don't like the way the Summary buffer looks, how to
-              tweak it?
-* [4.15]::    How to split incoming mails in several groups?
+* FAQ 4-1::     When I enter a group, all read messages are gone. How to
+                view them again?
+* FAQ 4-2::     How to tell Gnus to show an important message every time
+                I enter a group, even when it's read?
+* FAQ 4-3::     How to view the headers of a message?
+* FAQ 4-4::     How to view the raw unformatted message?
+* FAQ 4-5::     How can I change the headers Gnus displays by default at
+                the top of the article buffer?
+* FAQ 4-6::     I'd like Gnus NOT to render HTML-mails but show me the
+                text part if it's available. How to do it?
+* FAQ 4-7::     Can I use some other browser than w3 to render my
+                HTML-mails?
+* FAQ 4-8::     Is there anything I can do to make poorly formatted
+                mails more readable?
+* FAQ 4-9::     Is there a way to automatically ignore posts by specific
+                authors or with specific words in the subject? And can I
+                highlight more interesting ones in some way?
+* FAQ 4-10::    How can I disable threading in some (e.g. mail-) groups,
+                or set other variables specific for some groups?
+* FAQ 4-11::    Can I highlight messages written by me and follow-ups to
+                those?
+* FAQ 4-12::    The number of total messages in a group which Gnus
+                displays in group buffer is by far to high, especially in mail
+                groups. Is this a bug?
+* FAQ 4-13::    I don't like the layout of summary and article buffer,
+                how to change it? Perhaps even a three pane display?
+* FAQ 4-14::    I don't like the way the Summary buffer looks, how to
+                tweak it?
+* FAQ 4-15::    How to split incoming mails in several groups?
 @end menu
 
-@node [4.1]
+@node FAQ 4-1
 @subsubheading Question 4.1
 
 When I enter a group, all read messages are gone. How to view them again?
@@ -813,7 +817,7 @@
 you can say @samp{^}, if you want to retrieve the whole thread
 the message you're just reading belongs to, @samp{A T} is your friend.
 
-@node [4.2]
+@node FAQ 4-2
 @subsubheading Question 4.2
 
 How to tell Gnus to show an important message every time I
@@ -828,7 +832,7 @@
 mark and set's unread mark) or @samp{M c}
 (which deletes all marks for the message).
 
-@node [4.3]
+@node FAQ 4-3
 @subsubheading Question 4.3
 
 How to view the headers of a message?
@@ -840,7 +844,7 @@
 @samp{t} 
 hides them again.
 
-@node [4.4]
+@node FAQ 4-4
 @subsubheading Question 4.4
 
 How to view the raw unformatted message?
@@ -853,7 +857,7 @@
 @samp{g} 
 returns to normal view.
 
-@node [4.5]
+@node FAQ 4-5
 @subsubheading Question 4.5
 
 How can I change the headers Gnus displays by default at
@@ -874,7 +878,7 @@
 @end example
 @noindent
 
-@node [4.6]
+@node FAQ 4-6
 @subsubheading Question 4.6
 
 I'd like Gnus NOT to render HTML-mails but show me the
@@ -901,7 +905,7 @@
 
 too.
 
-@node [4.7]
+@node FAQ 4-7
 @subsubheading Question 4.7
 
 Can I use some other browser than w3 to render my HTML-mails?
@@ -919,7 +923,7 @@
 @end example
 @noindent
 
-@node [4.8]
+@node FAQ 4-8
 @subsubheading Question 4.8
 
 Is there anything I can do to make poorly formatted mails
@@ -938,7 +942,7 @@
 other deuglifications).  Outlook deuglify is only available since
 Gnus 5.10.
 
-@node [4.9]
+@node FAQ 4-9
 @subsubheading Question 4.9
 
 Is there a way to automatically ignore posts by specific
@@ -1008,7 +1012,7 @@
 
 in ~/.gnus.el.
 
-@node [4.10]
+@node FAQ 4-10
 @subsubheading Question 4.10
 
 How can I disable threading in some (e.g. mail-) groups, or
@@ -1025,7 +1029,7 @@
 value. Hit button done at the top of the buffer when
 you're ready.
 
-@node [4.11]
+@node FAQ 4-11
 @subsubheading Question 4.11
 
 Can I highlight messages written by me and follow-ups to
@@ -1041,7 +1045,7 @@
 faces. You can find detailed instructions on how to do it on
 @uref{http://my.gnus.org/node/view/224, my.gnus.org}
 
-@node [4.12]
+@node FAQ 4-12
 @subsubheading Question 4.12
 
 The number of total messages in a group which Gnus
@@ -1065,7 +1069,7 @@
 right again (until you delete and move your mail to other
 groups again).
 
-@node [4.13]
+@node FAQ 4-13
 @subsubheading Question 4.13
 
 I don't like the layout of summary and article buffer, how
@@ -1110,7 +1114,7 @@
 @end example
 @noindent
 
-@node [4.14]
+@node FAQ 4-14
 @subsubheading Question 4.14
 
 I don't like the way the Summary buffer looks, how to tweak it?
@@ -1155,7 +1159,7 @@
 @end example
 @noindent
 
-@node [4.15]
+@node FAQ 4-15
 @subsubheading Question 4.15
 
 How to split incoming mails in several groups?
@@ -1226,31 +1230,36 @@
 @subsection Composing messages
 
 @menu
-* [5.1]::     What are the basic commands I need to know for sending
-              mail and postings?
-* [5.2]::     How to enable automatic word-wrap when composing messages?
-* [5.3]::     How to set stuff like From, Organization, Reply-To,
-              signature...?
-* [5.4]::     Can I set things like From, Signature etc group based on
-              the group I post too?
-* [5.5]::     Is there a spell-checker? Perhaps even on-the-fly
-              spell-checking?
-* [5.6]::     Can I set the dictionary based on the group I'm posting
-              to?
-* [5.7]::     Is there some kind of address-book, so I needn't remember
-              all those email addresses?
-* [5.8]::     Sometimes I see little images at the top of article
-              buffer. What's that and how can I send one with my postings, too?
-* [5.9]::     Sometimes I accidentally hit r instead of f in newsgroups.
-              Can Gnus warn me, when I'm replying by mail in newsgroups?
-* [5.10]::    How to tell Gnus not to generate a sender header?
-* [5.11]::    I want Gnus to locally store copies of my send mail and
-              news, how to do it?
-* [5.12]::    People tell me my Message-IDs are not correct, why aren't
-              they and how to fix it?
+* FAQ 5-1::     What are the basic commands I need to know for sending
+                mail and postings?
+* FAQ 5-2::     How to enable automatic word-wrap when composing
+                messages?
+* FAQ 5-3::     How to set stuff like From, Organization, Reply-To,
+                signature...?
+* FAQ 5-4::     Can I set things like From, Signature etc group based on
+                the group I post too?
+* FAQ 5-5::     Is there a spell-checker? Perhaps even on-the-fly
+                spell-checking?
+* FAQ 5-6::     Can I set the dictionary based on the group I'm posting
+                to?
+* FAQ 5-7::     Is there some kind of address-book, so I needn't
+                remember all those email addresses?
+* FAQ 5-8::     Sometimes I see little images at the top of article
+                buffer. What's that and how can I send one with my postings,
+                too?
+* FAQ 5-9::     Sometimes I accidentally hit r instead of f in
+                newsgroups. Can Gnus warn me, when I'm replying by mail in
+                newsgroups?
+* FAQ 5-10::    How to tell Gnus not to generate a sender header?
+* FAQ 5-11::    I want Gnus to locally store copies of my send mail and
+                news, how to do it?
+* FAQ 5-12::    I want Gnus to kill the buffer after successful sending
+                instead of keeping it alive as "Sent mail to...", how to do it?
+* FAQ 5-13::    People tell me my Message-IDs are not correct, why
+                aren't they and how to fix it?
 @end menu
 
-@node [5.1]
+@node FAQ 5-1
 @subsubheading Question 5.1
 
 What are the basic commands I need to know for sending mail and postings?
@@ -1280,7 +1289,7 @@
 can start editing it again by saying @samp{D
 e}.
 
-@node [5.2]
+@node FAQ 5-2
 @subsubheading Question 5.2
 
 How to enable automatic word-wrap when composing messages?
@@ -1303,9 +1312,10 @@
 
 in ~/.gnus.el.
 
-You can reformat a paragraph by hitting @samp{M-q} (as usual).
-
-@node [5.3]
+You can reformat a paragraph by hitting @samp{M-q}
+(as usual).
+
+@node FAQ 5-3
 @subsubheading Question 5.3
 
 How to set stuff like From, Organization, Reply-To, signature...?
@@ -1339,7 +1349,7 @@
 then the function foo will be evaluated with argument bar
 and the result will be thrown away.
 
-@node [5.4]
+@node FAQ 5-4
 @subsubheading Question 5.4
 
 Can I set things like From, Signature etc group based on the group I post too?
@@ -1390,7 +1400,7 @@
 @end example
 @noindent
 
-@node [5.5]
+@node FAQ 5-5
 @subsubheading Question 5.5
 
 Is there a spell-checker? Perhaps even on-the-fly spell-checking?
@@ -1433,7 +1443,7 @@
 @end example
 @noindent
 
-@node [5.6]
+@node FAQ 5-6
 @subsubheading Question 5.6
 
 Can I set the dictionary based on the group I'm posting to?
@@ -1457,7 +1467,7 @@
 in ~/.gnus.el. Change "^de\\." and "deutsch8" to something
 that suits your needs.
 
-@node [5.7]
+@node FAQ 5-7
 @subsubheading Question 5.7
 
 Is there some kind of address-book, so I needn't remember
@@ -1521,7 +1531,7 @@
 hit @samp{TAB} to cycle through know
 recipients.
 
-@node [5.8]
+@node FAQ 5-8
 @subsubheading Question 5.8
 
 Sometimes I see little images at the top of article
@@ -1571,7 +1581,7 @@
 
 to gnus-posting-styles.
 
-@node [5.9]
+@node FAQ 5-9
 @subsubheading Question 5.9
 
 Sometimes I accidentally hit r instead of f in
@@ -1602,7 +1612,7 @@
 @end example
 @noindent
 
-@node [5.10]
+@node FAQ 5-10
 @subsubheading Question 5.10
 
 How to tell Gnus not to generate a sender header?
@@ -1618,7 +1628,7 @@
 @end example
 @noindent
 
-@node [5.11]
+@node FAQ 5-11
 @subsubheading Question 5.11
 
 I want Gnus to locally store copies of my send mail and
@@ -1640,9 +1650,24 @@
 @end example
 @noindent
 
-@node [5.12]
+@node FAQ 5-12
 @subsubheading Question 5.12
 
+I want Gnus to kill the buffer after successful sending instead of keeping
+it alive as "Sent mail to...", how to do it?
+
+@subsubheading Answer
+
+Add this to your ~/.gnus:
+
+@example
+(setq message-kill-buffer-on-exit t)
+@end example
+@noindent
+
+@node FAQ 5-13
+@subsubheading Question 5.13
+
 People tell me my Message-IDs are not correct, why
 aren't they and how to fix it?
 
@@ -1661,7 +1686,7 @@
 @noindent
 
 in ~/.gnus.el.  If you use Gnus 5.9 or earlier, you can use this
-instead (works for newer versions a well): 
+instead (works for newer versions as well): 
 
 @example
 (eval-after-load "message"
@@ -1709,17 +1734,17 @@
 @subsection Old messages
 
 @menu
-* [6.1]::    How to import my old mail into Gnus?
-* [6.2]::    How to archive interesting messages?
-* [6.3]::    How to search for a specific message?
-* [6.4]::    How to get rid of old unwanted mail?
-* [6.5]::    I want that all read messages are expired (at least in some
-             groups). How to do it?
-* [6.6]::    I don't want expiration to delete my mails but to move them
-             to another group.
+* FAQ 6-1::    How to import my old mail into Gnus?
+* FAQ 6-2::    How to archive interesting messages?
+* FAQ 6-3::    How to search for a specific message?
+* FAQ 6-4::    How to get rid of old unwanted mail?
+* FAQ 6-5::    I want that all read messages are expired (at least in
+               some groups). How to do it?
+* FAQ 6-6::    I don't want expiration to delete my mails but to move
+               them to another group.
 @end menu
 
-@node [6.1]
+@node FAQ 6-1
 @subsubheading Question 6.1
 
 How to import my old mail into Gnus?
@@ -1746,7 +1771,7 @@
 through nnmail-split-methods (respool them) by saying
 @samp{B r}.
 
-@node [6.2]
+@node FAQ 6-2
 @subsubheading Question 6.2
 
 How to archive interesting messages?
@@ -1797,7 +1822,7 @@
 mark for articles you want to keep, setting the read
 mark will remove them from cache.
 
-@node [6.3]
+@node FAQ 6-3
 @subsubheading Question 6.3
 
 How to search for a specific message?
@@ -1839,7 +1864,7 @@
 or @uref{ftp://ftp.is.informatik.uni-duisburg.de/pub/src/emacs/}.
 Instructions on how to use it are at the top of the file.
 
-@node [6.4]
+@node FAQ 6-4
 @subsubheading Question 6.4
 
 How to get rid of old unwanted mail?
@@ -1864,7 +1889,7 @@
 expirable before and if they are old enough (default is
 older than a week) they are deleted.
 
-@node [6.5]
+@node FAQ 6-5
 @subsubheading Question 6.5
 
 I want that all read messages are expired (at least in
@@ -1900,7 +1925,7 @@
 can also set the read mark (hit
 @samp{d}).
 
-@node [6.6]
+@node FAQ 6-6
 @subsubheading Question 6.6
 
 I don't want expiration to delete my mails but to move them
@@ -1924,15 +1949,16 @@
 @subsection Gnus in a dial-up environment
 
 @menu
-* [7.1]::    I don't have a permanent connection to the net, how can I
-             minimize the time I've got to be connected?
-* [7.2]::    So what was this thing about the Agent?
-* [7.3]::    I want to store article bodies on disk, too. How to do it?
-* [7.4]::    How to tell Gnus not to try to send mails / postings while
-             I'm offline?
+* FAQ 7-1::    I don't have a permanent connection to the net, how can I
+               minimize the time I've got to be connected?
+* FAQ 7-2::    So what was this thing about the Agent?
+* FAQ 7-3::    I want to store article bodies on disk, too. How to do
+               it?
+* FAQ 7-4::    How to tell Gnus not to try to send mails / postings
+               while I'm offline?
 @end menu
 
-@node [7.1]
+@node FAQ 7-1
 @subsubheading Question 7.1
 
 I don't have a permanent connection to the net, how can
@@ -1978,7 +2004,7 @@
 respectively POP3 or IMAP. It also includes a smtp
 server for receiving mails from Gnus.
 
-@node [7.2]
+@node FAQ 7-2
 @subsubheading Question 7.2
 
 So what was this thing about the Agent?
@@ -2010,7 +2036,7 @@
 server, the headers will be stored on disk and read from
 there the next time you enter the group.
 
-@node [7.3]
+@node FAQ 7-3
 @subsubheading Question 7.3
 
 I want to store article bodies on disk, too. How to do it?
@@ -2045,7 +2071,7 @@
 server.  Depending on the volume of headers, the initial
 fetch session could take hours.
 
-@node [7.4]
+@node FAQ 7-4
 @subsubheading Question 7.4
 
 How to tell Gnus not to try to send mails / postings
@@ -2066,16 +2092,16 @@
 @subsection Getting help
 
 @menu
-* [8.1]::    How to find information and help inside Emacs?
-* [8.2]::    I can't find anything in the Gnus manual about X (e.g.
-             attachments, PGP, MIME...), is it not documented?
-* [8.3]::    Which websites should I know?
-* [8.4]::    Which mailing lists and newsgroups are there?
-* [8.5]::    Where to report bugs?
-* [8.6]::    I need real-time help, where to find it?
+* FAQ 8-1::    How to find information and help inside Emacs?
+* FAQ 8-2::    I can't find anything in the Gnus manual about X (e.g.
+               attachments, PGP, MIME...), is it not documented?
+* FAQ 8-3::    Which websites should I know?
+* FAQ 8-4::    Which mailing lists and newsgroups are there?
+* FAQ 8-5::    Where to report bugs?
+* FAQ 8-6::    I need real-time help, where to find it?
 @end menu
 
-@node [8.1]
+@node FAQ 8-1
 @subsubheading Question 8.1
 
 How to find information and help inside Emacs?
@@ -2093,7 +2119,7 @@
 search through all available functions and @samp{M-x
 apropos} searches the bound variables.
 
-@node [8.2]
+@node FAQ 8-2
 @subsubheading Question 8.2
 
 I can't find anything in the Gnus manual about X
@@ -2108,7 +2134,7 @@
 different info files, you should have a look in those
 manuals, too.
 
-@node [8.3]
+@node FAQ 8-3
 @subsubheading Question 8.3
 
 Which websites should I know?
@@ -2124,7 +2150,7 @@
 
 Tell me about other sites which are interesting.
 
-@node [8.4]
+@node FAQ 8-4
 @subsubheading Question 8.4
 
 Which mailing lists and newsgroups are there?
@@ -2132,15 +2158,15 @@
 @subsubheading Answer
 
 There's the newsgroup gnu.emacs.gnus (also available as
-@uref{http://dir.gmane.org/gmane.emacs.gnus.user,
-gmane.emacs.gnus.user}) which deals with general Gnus questions.  If you
-have questions about development versions of Gnus, you should better ask
-on the ding mailing list, see below.
+@uref{http://dir.gmane.org/gmane.emacs.gnus.user, 
+gmane.emacs.gnus.user}) which deals with general Gnus
+questions.  If you have questions about development versions of
+Gnus, you should better ask on the ding mailing list, see below.
 
 If you want to stay in the big8,
 news.software.newssreaders is also read by some Gnus
 users (but chances for qualified help are much better in
-the above groups). If you speak German, there's
+the above groups).  If you speak German, there's
 de.comm.software.gnus.
 
 The ding mailing list (ding@@gnus.org) deals with development of
@@ -2148,7 +2174,7 @@
 @uref{http://dir.gmane.org/gmane.emacs.gnus.general, 
 gmane.emacs.gnus.general} from news.gmane.org.
 
-@node [8.5]
+@node FAQ 8-5
 @subsubheading Question 8.5
 
 Where to report bugs?
@@ -2161,7 +2187,7 @@
 including information about your environment which make
 it easier to help you.
 
-@node [8.6]
+@node FAQ 8-6
 @subsubheading Question 8.6
 
 I need real-time help, where to find it?
@@ -2174,12 +2200,12 @@
 @subsection Tuning Gnus
 
 @menu
-* [9.1]::    Starting Gnus is really slow, how to speed it up?
-* [9.2]::    How to speed up the process of entering a group?
-* [9.3]::    Sending mail becomes slower and slower, what's up?
+* FAQ 9-1::    Starting Gnus is really slow, how to speed it up?
+* FAQ 9-2::    How to speed up the process of entering a group?
+* FAQ 9-3::    Sending mail becomes slower and slower, what's up?
 @end menu
 
-@node [9.1]
+@node FAQ 9-1
 @subsubheading Question 9.1
 
 Starting Gnus is really slow, how to speed it up?
@@ -2214,7 +2240,7 @@
 
 it's loaded when it's needed.
 
-@node [9.2]
+@node FAQ 9-2
 @subsubheading Question 9.2
 
 How to speed up the process of entering a group?
@@ -2258,7 +2284,7 @@
 5.10 since there quite some work on improving it has
 been done.
 
-@node [9.3]
+@node FAQ 9-3
 @subsubheading Question 9.3
 
 Sending mail becomes slower and slower, what's up?
--- a/doc/misc/gnus.texi	Tue Jun 17 02:16:09 2008 +0000
+++ b/doc/misc/gnus.texi	Tue Jun 17 02:32:59 2008 +0000
@@ -4398,9 +4398,9 @@
 * nnmairix caveats::            Some more stuff you might want to know
 @end menu
 
-@c FIXME: The markup in this section needs improvement.  E.g. add
-@c @sample{...}, maybe remove some @strong{...}, convert ` - ' to `---`,
-@c ...
+@c FIXME: The markup in this section might need improvement.
+@c E.g. adding @samp, @var, @file, @command, etc.
+@c Cf. (info "(texinfo)Indicating")
 
 @node About mairix
 @subsubsection About mairix
@@ -4436,16 +4436,15 @@
 @node nnmairix requirements
 @subsubsection nnmairix requirements
 
-Mairix searches local mail - that means, mairix absolutely must have
+Mairix searches local mail---that means, mairix absolutely must have
 direct access to your mail folders.  If your mail resides on another
 server (e.g. an @acronym{IMAP} server) and you happen to have shell
 access, @code{nnmairix} supports running mairix remotely, e.g. via ssh.
 
 Additionally, @code{nnmairix} only supports the following Gnus back
-ends: @code{nnml}, @code{nnmaildir}, and @code{nnimap}.  You
-@strong{must} use one of these back ends for using
-@code{nnmairix}.  Other back ends, like @code{nnmbox}, @code{nnfolder} or
-@code{nnmh}, won't work.
+ends: @code{nnml}, @code{nnmaildir}, and @code{nnimap}.  You must use
+one of these back ends for using @code{nnmairix}.  Other back ends, like
+@code{nnmbox}, @code{nnfolder} or @code{nnmh}, won't work.
 
 If you absolutely must use mbox and still want to use @code{nnmairix},
 you can set up a local @acronym{IMAP} server, which you then access via
@@ -4473,7 +4472,7 @@
 You might ask why you need @code{nnmairix} at all, since mairix already
 creates the group, populates it with links to the mails so that you can
 then access it with Gnus, right? Well, this @emph{might} work, but often
-does not - at least not without problems.  Most probably you will get
+does not---at least not without problems.  Most probably you will get
 strange article counts, and sometimes you might see mails which Gnus
 claims have already been canceled and are inaccessible.  This is due to
 the fact that Gnus isn't really amused when things are happening behind
@@ -4482,7 +4481,7 @@
 about corrupt index files when mairix changed the contents of the search
 group).  Using @code{nnmairix} should circumvent these problems.
 
-@code{nnmairix} is not really a mail back end - it's actually more like a
+@code{nnmairix} is not really a mail back end---it's actually more like a
 wrapper, sitting between a ``real'' mail back end where mairix stores the
 searches and the Gnus front end.  You can choose between three different
 mail back ends for the mairix folders: @code{nnml}, @code{nnmaildir} or
@@ -4495,7 +4494,7 @@
 alongside your other mail, you can also create e.g. a new
 @code{nnmaildir} server exclusively for mairix.  However, a special case
 exists if you want to use mairix remotely on an IMAP server with
-@code{nnimap} - here the mairix folders and your other mail must be on
+@code{nnimap}---here the mairix folders and your other mail must be on
 the same @code{nnimap} back end.
 
 @node Setting up mairix
@@ -4511,12 +4510,11 @@
 base=~/Maildir
 @end example
 
-This is the base folder for your mails.  All the following paths are
-relative to this base folder.  If you want to use @code{nnmairix} with
-@code{nnimap}, this base path has to point to the mail path where the
-@acronym{IMAP} server stores the mail folders!
-
-@c FIXME: Add typical examples?
+This is the base folder for your mails.  All the following directories
+are relative to this base folder.  If you want to use @code{nnmairix}
+with @code{nnimap}, this base directory has to point to the mail
+directory where the @acronym{IMAP} server stores the mail folders!
+
 @example
 maildir= ... your maildir folders which should be indexed ...
 mh= ... your nnml/mh folders which should be indexed ...
@@ -4524,7 +4522,7 @@
 @end example
 
 Specify all your maildir/nnml folders and mbox files (relative to the
-base path!) you want to index with mairix.  See the man-page for
+base directory!) you want to index with mairix.  See the man-page for
 mairixrc for details.
 
 @example
@@ -4536,7 +4534,6 @@
 search results.  You can change the prefix of these folders with the
 variable @code{nnmairix-group-prefix}.
 
-@c FIXME: Add typical examples?
 @example
 mformat= ... 'maildir' or 'mh' ...
 database= ... location of database file ...
@@ -4546,8 +4543,38 @@
 search folder.  Set this to @code{mh} if you want to access search results
 with @code{nnml}.  Otherwise choose @code{maildir}.
 
-See the man pages for mairix and mairixrc for further options.  Now
-simply call @code{mairix} to create the index for the first time.
+To summarize, here is my shortened @file{.mairixrc} file as an example:
+
+@example
+base=~/Maildir
+maildir=.personal:.work:.logcheck:.sent
+mh=../Mail/nnml/*...
+mbox=../mboxmail/mailarchive_year*
+mformat=maildir
+omit=zz_mairix-*
+database=~/.mairixdatabase
+@end example
+
+In this case, the base directory is @file{~/Maildir}, where all my Maildir
+folders are stored.  As you can see, the folders are separated by
+colons.  If you wonder why every folder begins with a dot: this is
+because I use Dovecot as @acronym{IMAP} server, which again uses
+@code{Maildir++} folders.  For testing nnmairix, I also have some
+@code{nnml} mail, which is saved in @file{~/Mail/nnml}.  Since this has
+to be specified relative to the @code{base} directory, the @code{../Mail}
+notation is needed.  Note that the line ends in @code{*...}, which means
+to recursively scan all files under this directory.  Without the three
+dots, the wildcard @code{*} will not work recursively.  I also have some
+old mbox files with archived mail lying around in @file{~/mboxmail}.
+The other lines should be obvious.
+
+See the man page for @code{mairixrc} for details and further options,
+especially regarding wildcard usage, which may be a little different
+than you are used to.
+
+Now simply call @code{mairix} to create the index for the first time.
+Note that this may take a few minutes, but every following index will do
+the updates incrementally and hence is very fast.
 
 @node Configuring nnmairix
 @subsubsection Configuring nnmairix
@@ -4560,7 +4587,7 @@
 @itemize @bullet
 
 @item
-The @strong{name} of the @code{nnmairix} server - choose whatever you
+The @strong{name} of the @code{nnmairix} server---choose whatever you
 want.
 
 @item
@@ -4743,7 +4770,7 @@
 e.g. replying to this article the correct posting styles/group
 parameters are applied (@code{nnmairix-goto-original-article}).  This
 function will use the registry if available, but can also parse the
-article file path as a fallback method.
+article file name as a fallback method.
 
 @item $ u
 @kindex $ u (Summary)
@@ -4781,11 +4808,11 @@
 groups instead of your ``real'' mail groups.
 
 There is one problem, though: say you got a new mail from
-@samp{david@@foobar.com} - it will now show up in two groups, the
+@samp{david@@foobar.com}; it will now show up in two groups, the
 ``real'' group (your INBOX, for example) and in the @code{nnmairix}
 search group (provided you have updated the mairix database). Now you
 enter the @code{nnmairix} group and read the mail. The mail will be
-marked as read, but only in the @code{nnmairix} group - in the ``real''
+marked as read, but only in the @code{nnmairix} group---in the ``real''
 mail group it will be still shown as unread.
 
 You could now catch up the mail group (@pxref{Group Data}), but this is
@@ -4832,11 +4859,11 @@
 
 @vindex nnmairix-only-use-registry
 If you don't want to use the registry or the registry hasn't seen the
-original article yet, @code{nnmairix} will use an additional mairix search
-for determining the file path of the article. This, of course, is way
-slower than the registry - if you set hundreds or even thousands of
-marks this way, it might take some time. You can avoid this situation
-by setting @code{nnmairix-only-use-registry} to t.
+original article yet, @code{nnmairix} will use an additional mairix
+search for determining the file name of the article. This, of course, is
+way slower than the registry---if you set hundreds or even thousands of
+marks this way, it might take some time. You can avoid this situation by
+setting @code{nnmairix-only-use-registry} to t.
 
 Maybe you also want to propagate marks the other way round, i.e. if you
 tick an article in a "real" mail group, you'd like to have the same
@@ -4898,7 +4925,7 @@
 Now activate marks propagation for this group by using @kbd{G b p}. Then
 activate the always-unread feature by using @kbd{G b r} twice.
 
-So far so good - but how do you remove the tick marks in the @code{nnmairix}
+So far so good---but how do you remove the tick marks in the @code{nnmairix}
 group?  There are two options: You may simply use
 @code{nnmairix-remove-tick-mark-original-article} (bound to @kbd{$ u}) to remove
 tick marks from the original article. The other possibility is to set
@@ -4920,7 +4947,7 @@
 the mail back end in the form @samp{zz_mairix-<NAME>-<NUMBER>}. You can
 see them when you enter the back end server in the server buffer. You
 should not subscribe these groups! Unfortunately, these groups will
-usually get @strong{auto-subscribed} when you use @code{nnmaildir} or
+usually get @emph{auto-subscribed} when you use @code{nnmaildir} or
 @code{nnml}, i.e. you will suddenly see groups of the form
 @samp{zz_mairix*} pop up in your group buffer. If this happens to you,
 simply kill these groups with C-k.  For avoiding this, turn off
@@ -4947,13 +4974,13 @@
 @item
 If you use the Gnus registry: don't use the registry with
 @code{nnmairix} groups (put them in
-@code{gnus-registry-unfollowed-groups}).  Be @strong{extra careful} if
-you use @code{gnus-registry-split-fancy-with-parent} - mails which are
+@code{gnus-registry-unfollowed-groups}).  Be @emph{extra careful} if
+you use @code{gnus-registry-split-fancy-with-parent}; mails which are
 split into @code{nnmairix} groups are usually gone for good as soon as
 you check the group for new mail (yes, it has happened to me...).
 
 @item
-Therefore: @strong{Never ever} put ``real'' mails into @code{nnmairix}
+Therefore: @emph{Never ever} put ``real'' mails into @code{nnmairix}
 groups (you shouldn't be able to, anyway).
 
 @item
@@ -4962,7 +4989,7 @@
 @item
 @code{nnmairix} uses a rather brute force method to force Gnus to
 completely reread the group on the mail back end after mairix was
-called - it simply deletes and re-creates the group on the mail
+called---it simply deletes and re-creates the group on the mail
 back end. So far, this has worked for me without any problems, and I
 don't see how @code{nnmairix} could delete other mail groups than its
 own, but anyway: you really should have a backup of your mail
@@ -4986,7 +5013,7 @@
 @code{nnmairix-group-prefix}.
 
 @item
-The following only applies if you @strong{don't} use the mentioned patch
+The following only applies if you @emph{don't} use the mentioned patch
 for mairix (@pxref{Propagating marks}):
 
 A problem can occur when using @code{nnmairix} with maildir folders and
@@ -15382,8 +15409,8 @@
 (the deletion will only happen when receiving new mail).  You may also
 set @code{mail-source-delete-incoming} to @code{nil} and call
 @code{mail-source-delete-old-incoming} from a hook or interactively.
-@code{mail-source-delete-incoming} defaults to @code{2} in alpha Gnusae
-and @code{10} in released Gnusae.  @xref{Gnus Development}.
+@code{mail-source-delete-incoming} defaults to @code{10} in alpha Gnusae
+and @code{2} in released Gnusae.  @xref{Gnus Development}.
 
 @item mail-source-delete-old-incoming-confirm
 @vindex mail-source-delete-old-incoming-confirm
@@ -28604,7 +28631,7 @@
 @item You can now drag and drop attachments to the Message buffer.
 See @code{mml-dnd-protocol-alist} and @code{mml-dnd-attach-options}.
 @xref{MIME, ,MIME, message, Message Manual}.
-@c New in 5.10.9 / 5.11 (Emacs 21.1)
+@c New in 5.10.9 / 5.11 (Emacs 22.1)
 
 @item @code{auto-fill-mode} is enabled by default in Message mode.
 See @code{message-fill-column}.  @xref{Various Message Variables, ,
--- a/lisp/gnus/ChangeLog	Tue Jun 17 02:16:09 2008 +0000
+++ b/lisp/gnus/ChangeLog	Tue Jun 17 02:32:59 2008 +0000
@@ -1,3 +1,77 @@
+2008-06-16  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* dgnushack.el: Autoload get-display-table and put-display-table for
+	XEmacs 21.5.
+
+	* lpath.el: Fbind get-display-table and put-display-table for XEmacs
+	21.4 and SXEmacs.
+
+2008-06-15  David Engster  <dengste@eml.cc>
+
+	* nnimap.el (nnimap-request-delete-group): Unselect group if necessary.
+
+2008-06-14  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* gnus-util.el (gnus-put-display-table, gnus-get-display-table): New
+	macros that expand to an `aset'/`aref' call under Emacs, and to a
+	runtime choice under XEmacs.
+
+	* gnus-sum.el (gnus-summary-set-display-table): Use
+	`gnus-put-display-table', `gnus-get-display-table',
+	`gnus-set-display-table' for the display table, instead of `aset'.
+
+	* gnus-xmas.el (gnus-xmas-summary-set-display-table): Use
+	`gnus-put-display-table', `gnus-get-display-table',
+	`gnus-set-display-table' for the display table.
+
+2008-06-14  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* nnmairix.el: Add autoloads.
+
+2008-06-14  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* nnmairix.el (nnmairix-delete-recreate-group)
+	(nnmairix-update-and-clear-marks): Fix error messages.
+
+2008-06-14  David Engster  <dengste@eml.cc>
+
+	* nnmairix.el: Upgrade to version 0.6.
+	(nnmairix-group-toggle-propmarks-this-group)
+	(nnmairix-group-toggle-readmarks-this-group)
+	(nnmairix-group-delete-recreate-this-group)
+	(nnmairix-group-toggle-allowfast-this-group, nnmairix-propagate-marks)
+	(nnmairix-remove-tick-mark-original-article): New commands.
+	(nnmairix-mairix-search-options, nnmairix-propagate-marks-upon-close)
+	(nnmairix-propagate-marks-to-nnmairix-groups)
+	(nnmairix-only-use-registry, nnmairix-allowfast-default)
+	(nnmairix-marks-cache, nnmairix-version-output): New variables.
+	(nnmairix-request-set-mark, nnmairix-request-update-info): New back end
+	functions needed for marks propagation and manipulation of read marks.
+	(nnmairix-update-groups): New function.
+	(nnmairix-get-groups-from-server, nnmairix-delete-recreate-group)
+	(nnmairix-determine-original-group-from-registry)
+	(nnmairix-determine-original-group-from-path)
+	(nnmairix-get-group-from-file-path, nnmairix-map-range)
+	(nnmairix-check-mairix-version, nnmairix-group-toggle-parameter): New
+	helper functions.
+	(nnmairix-group-mode-hook, nnmairix-summary-mode-hook): Inserted new
+	keystrokes for new commands.
+	(nnmairix-delete-and-create-on-change): Doc string cleanup.
+	(nnmairix-request-group): Check allow-fast group parameter.
+	(nnmairix-request-create-group): Set allow-fast group parameter if
+	nnmairix-allowfast-default is set.
+	(nnmairix-close-group): Propagate marks upon closing if needed.
+	(nnmairix-group-toggle-threads-this-group): Use new.
+	nnmairix-group-toggle-parameter helper function.
+	(nnmairix-search): Better check for empty search result.
+	(nnmairix-goto-original-article): Use new helper functions for
+	determining original article.
+	(nnmairix-show-original-article): Make sure message-id is in brackets.
+	(nnmairix-call-mairix-binary): Change variable name.
+	(nnmairix-update-and-clear-marks): Use nnmairix-delete-recreate-group
+	helper function.
+	(nnmairix-widget-toggle-activate): Fix doc string.
+
 2008-06-11  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* nnir.el: Require edmacro when compiling with XEmacs.
--- a/lisp/gnus/gnus-sum.el	Tue Jun 17 02:16:09 2008 +0000
+++ b/lisp/gnus/gnus-sum.el	Tue Jun 17 02:32:59 2008 +0000
@@ -3420,13 +3420,13 @@
 	(i 32))
     ;; Nix out all the control chars...
     (while (>= (setq i (1- i)) 0)
-      (aset table i [??]))
+      (gnus-put-display-table i [??] table))
    ;; ... but not newline and cr, of course.  (cr is necessary for the
     ;; selective display).
-    (aset table ?\n nil)
-    (aset table ?\r nil)
+    (gnus-put-display-table ?\n nil table)
+    (gnus-put-display-table ?\r nil table)
     ;; We keep TAB as well.
-    (aset table ?\t nil)
+    (gnus-put-display-table ?\t nil table)
     ;; We nix out any glyphs 127 through 255, or 127 through 159 in
     ;; Emacs 23 (unicode), that are not set already.
     (let ((i (if (ignore-errors (= (make-char 'latin-iso8859-1 160) 160))
@@ -3434,8 +3434,8 @@
 	       256)))
       (while (>= (setq i (1- i)) 127)
 	;; Only modify if the entry is nil.
-	(unless (aref table i)
-	  (aset table i [??]))))
+	(unless (gnus-get-display-table i table)
+	  (gnus-put-display-table i [??] table))))
     (setq buffer-display-table table)))
 
 (defun gnus-summary-set-article-display-arrow (pos)
--- a/lisp/gnus/gnus-util.el	Tue Jun 17 02:16:09 2008 +0000
+++ b/lisp/gnus/gnus-util.el	Tue Jun 17 02:32:59 2008 +0000
@@ -1801,6 +1801,27 @@
 (defalias 'gnus-read-shell-command
   (if (fboundp 'read-shell-command) 'read-shell-command 'read-string))
 
+(defmacro gnus-put-display-table (range value display-table)
+  "Set the value for char RANGE to VALUE in DISPLAY-TABLE.  "
+  (if (featurep 'xemacs)
+      (progn
+        `(if (fboundp 'put-display-table)
+          (put-display-table ,range ,value ,display-table)
+          (if (sequencep ,display-table)
+              (aset ,display-table ,range ,value)
+            (put-char-table ,range ,value ,display-table))))
+    `(aset ,display-table ,range ,value)))
+
+(defmacro gnus-get-display-table (character display-table)
+  "Find value for CHARACTER in DISPLAY-TABLE.  "
+  (if (featurep 'xemacs)
+      `(if (fboundp 'get-display-table)
+          (get-display-table ,character ,display-table)
+          (if (sequencep ,display-table)
+              (aref ,display-table ,character)
+            (get-char-table ,character ,display-table)))
+    `(aref ,display-table ,character)))
+
 (provide 'gnus-util)
 
 ;; arch-tag: f94991af-d32b-4c97-8c26-ca12a934de49
--- a/lisp/gnus/nnimap.el	Tue Jun 17 02:16:09 2008 +0000
+++ b/lisp/gnus/nnimap.el	Tue Jun 17 02:32:59 2008 +0000
@@ -1608,6 +1608,8 @@
 
 (deffoo nnimap-request-delete-group (group force &optional server)
   (when (nnimap-possibly-change-server server)
+    (when (string= group (imap-current-mailbox nnimap-server-buffer))
+      (imap-mailbox-unselect nnimap-server-buffer))
     (with-current-buffer nnimap-server-buffer
       (if force
 	  (or (null (imap-mailbox-status group 'uidvalidity))
--- a/lisp/gnus/nnmairix.el	Tue Jun 17 02:16:09 2008 +0000
+++ b/lisp/gnus/nnmairix.el	Tue Jun 17 02:32:59 2008 +0000
@@ -4,7 +4,7 @@
 
 ;; Author: David Engster <dengste@eml.cc>
 ;; Keywords: mail searching
-;; Version: 0.5
+;; Version: 0.6
 
 ;; This file is part of GNU Emacs.
 
@@ -83,21 +83,33 @@
 ;; I thought it would be a "nice to have feature"...
 
 ;; KNOWN BUGS:
-;; * When using Maildir: path and filename of a mail can change due to
-;; reading/replying/etc.  This can lead to dangling symlinks in
-;; nnmairix groups and it depends on the back end how well it deals
-;; with that (some IMAP servers out there may not be amused).  Update the
-;; database ('G b u') and the group to fix it.
 ;; * Mairix does only support us-ascii characters.
 
 ;; TODO/MISSING FEATURES:
-;; * Possibility to propagate flags like seen, replied, ticked
-;;   to original message
 ;; * Support of more back ends (nnmh, nnfolder, nnmbox...)?
 ;; * Maybe use an active file instead of group parameters?
-;; * Use "-a" when updating groups which are not newly created
+;; * Maybe use "-a" when updating groups which are not newly created?
 
 ;;; Changelog:
+;; 05/30/2008 - version 0.6
+;;
+;;    * It is now possible to propagate marks from the nnmairix groups
+;;      to the original messages (and for maildir also vice versa). See
+;;      the docs for details on this feature - it's pretty delicate
+;;      and currently needs a patched mairix binary to work smoothly.
+;;
+;;    * Keep messages in nnmairix groups always read/unread
+;;      (bound to 'G b r').
+;;
+;;    * Recreate back end folder for nnmairix groups in case you
+;;      somehow get wrong article counts (bound to 'G b d').
+;;
+;;    * New group parameter 'allow-fast'. Toggling of parameter bound
+;;      to 'G b a'. The default is nil, meaning that the group will
+;;      always be updated with a mairix search, even when only entered.
+;;
+;;    * More/Better use of the registry (if available). Can now also
+;;      deal with duplicate messages in different groups.
 ;;
 ;; 02/06/2008 - version 0.5
 ;;
@@ -115,7 +127,7 @@
 ;;
 ;;    * New/fixed doc strings and code cleanup.
 ;;
-;; 18/11/2007 - version 0.3
+;; 11/18/2007 - version 0.3
 ;;
 ;;    * Fixed bugs when dealing with nnml and native servers
 ;;
@@ -124,15 +136,15 @@
 ;; 10/10/2007 - version 0.2
 ;;
 ;;    * Use nnml-directory/directory server variables for nnml and
-;;    nnmaildir backends as path for search folders. This way it
+;;    nnmaildir back ends as path for search folders. This way it
 ;;    becomes independent of 'base' setting in .mairixirc (but not for
 ;;    nnimap).
 ;;
 ;;    * As a result: Changed nnmairix-backend-to-server so that user
 ;;    is asked when more than one nnmairix server exists and we do not
-;;    know which one is responsible for current backend.
+;;    know which one is responsible for current back end.
 ;;
-;;    * Rename files when using nnml backends so that there are no
+;;    * Rename files when using nnml back ends so that there are no
 ;;    holes in article numbers. This should fix all problems regarding
 ;;    wrong article counts with nnml.
 ;;
@@ -187,7 +199,17 @@
   (define-key gnus-group-mode-map
     (kbd "G b i") 'nnmairix-search-interactive)
   (define-key gnus-group-mode-map
-    (kbd "G b m") 'nnmairix-widget-search))
+    (kbd "G b m") 'nnmairix-widget-search)
+  (define-key gnus-group-mode-map
+    (kbd "G b p") 'nnmairix-group-toggle-propmarks-this-group)
+  (define-key gnus-group-mode-map
+    (kbd "G b r") 'nnmairix-group-toggle-readmarks-this-group)
+  (define-key gnus-group-mode-map
+    (kbd "G b d") 'nnmairix-group-delete-recreate-this-group)
+  (define-key gnus-group-mode-map
+    (kbd "G b a") 'nnmairix-group-toggle-allowfast-this-group)
+  (define-key gnus-group-mode-map
+    (kbd "G b o") 'nnmairix-propagate-marks))
 
 ;; Summary mode
 (defun nnmairix-summary-mode-hook ()
@@ -201,16 +223,26 @@
   (define-key gnus-summary-mode-map
     (kbd "$ g") 'nnmairix-create-search-group-from-message)
   (define-key gnus-summary-mode-map
-    (kbd "$ o") 'nnmairix-goto-original-article))
+    (kbd "$ o") 'nnmairix-goto-original-article)
+  (define-key gnus-summary-mode-map
+    (kbd "$ u") 'nnmairix-remove-tick-mark-original-article))
 
 (add-hook 'gnus-group-mode-hook 'nnmairix-group-mode-hook)
 (add-hook 'gnus-summary-mode-hook 'nnmairix-summary-mode-hook)
 
+;; ;;;###autoload
+;; (defun nnmairix-initalize (&optional force)
+;;   (interactive "P")
+;;   (if (not (or (file-readable-p "~/.mairixrc")
+;; 	       force))
+;;       (message "No file `~/.mairixrc', skipping nnmairix setup")
+;;     (add-hook 'gnus-group-mode-hook 'nnmairix-group-mode-hook)
+;;     (add-hook 'gnus-summary-mode-hook 'nnmairix-summary-mode-hook)))
 
 ;; Customizable stuff
 
 (defgroup nnmairix nil
-  "Backend for the Mairix mail search engine."
+  "Back end for the Mairix mail search engine."
   :group 'gnus)
 
 (defcustom nnmairix-group-prefix "zz_mairix"
@@ -245,6 +277,13 @@
   :type '(repeat string)
   :group 'nnmairix)
 
+(defcustom nnmairix-mairix-search-options '("-Q")
+  "Options when calling mairix for searching.
+The default is '-Q' for making searching faster."
+  :version "23.1"
+  :type '(repeat string)
+  :group 'nnmairix)
+
 (defcustom nnmairix-mairix-synchronous-update nil
   "Set this to t if you want Emacs to wait for mairix updating the database."
   :version "23.1"
@@ -253,7 +292,7 @@
 
 (defcustom nnmairix-rename-files-for-nnml t
   "Rename nnml mail files so that they are consecutively numbered.
-When using nnml as backend, mairix might produce holes in the
+When using nnml as back end, mairix might produce holes in the
 article numbers which will produce wrong article counts by
 Gnus.  This option controls whether nnmairix should rename the
 files consecutively."
@@ -294,6 +333,48 @@
   :type 'function
   :group 'nnmairix)
 
+(defcustom nnmairix-propagate-marks-upon-close t
+  "Flag if marks should be propagated upon closing a group.
+The default of this variable is t. If set to 'ask, the
+user will be asked if the flags should be propagated when the
+group is closed.  If set to nil, the user will have to manually
+call 'nnmairix-propagate-marks'."
+  :version "23.1"
+  :type '(choice (const :tag "always" t)
+		 (const :tag "ask" 'ask)
+		 (const :tag "never" nil))
+  :group 'nnmairix)
+
+(defcustom nnmairix-propagate-marks-to-nnmairix-groups nil
+  "Flag if marks from original articles should be seen in nnmairix groups.
+The default is nil since it will only work if the articles are in
+maildir format and NOT managed by the nnmaildir back end but
+e.g. an IMAP server (which stores the marks in the maildir file
+name).  You may safely set this to t for testing - the worst that
+can happen are wrong marks in nnmairix groups."
+  :version "23.1"
+  :type 'boolean
+  :group 'nnmairix)
+
+(defcustom nnmairix-only-use-registry nil
+  "Use only the registry for determining original group(s).
+If set to t, nnmairix will only use the registry for determining
+the original group(s) of an article (which is also necessary for
+propapagting marks).  If set to nil, it will also try to determine
+the group from an additional mairix search which might be slow
+when propagating lots of marks."
+  :version "23.1"
+  :type 'boolean
+  :group 'nnmairix)
+
+(defcustom nnmairix-allowfast-default nil
+  "Whether fast entering should be the default for nnmairix groups.
+You may set this to t to make entering the group faster, but note that
+this might lead to problems, especially when used with marks propagation."
+  :version "23.1"
+  :type 'boolean
+  :group 'nnmairix)
+
 ;; ==== Other variables
 
 (defvar nnmairix-widget-other
@@ -310,20 +391,18 @@
 message field (if any), mairix command and description.")
 
 (defvar nnmairix-delete-and-create-on-change '(nnimap nnmaildir nnml)
-  "Controls on which backends groups should be deleted and re-created.
-This variable is a list of back ends where the search group should
-be completely deleted and re-created when the query or thread
-parameter changes.  I know this is rather \"brute force\" and maybe
-even dangerous (you have backups, right?), but it should be used at
-least for nnimap since some IMAP servers are really not amused when
-mailbox content changes behind their back.  It usually also corrects
-the problem of \"holes\" in the article numbers which often lead to a
+  "Controls on which back ends groups should be deleted and re-created.
+This variable is a list of back ends where the search group
+should be completely deleted and re-created when the query or
+thread parameter changes.  The default is to this for all
+currently supported back ends.  It usually also corrects the
+problem of \"holes\" in the article numbers which often lead to a
 wrong count of total articles shown by Gnus.")
 
 ;;; === Server variables
 
 (defvoo nnmairix-backend  nil
-  "Backend where mairix stores its searches.")
+  "Back end where mairix stores its searches.")
 
 (defvoo nnmairix-backend-server nil
   "Name of the server where mairix stores its searches.")
@@ -346,8 +425,8 @@
   "Regexp for mairix groups on back end.")
 
 (defconst nnmairix-valid-backends '(nnimap nnml nnmaildir)
-  "Backends supported by nnmairix.
-Other backends might or might not work.")
+  "Back ends supported by nnmairix.
+Other back ends might or might not work.")
 
 (defvar nnmairix-last-server nil
   "Last chosen server.")
@@ -355,7 +434,13 @@
 (defvar nnmairix-current-server nil
   "Current server.")
 
-;;; === Gnus backend functions
+(defvar nnmairix-marks-cache nil
+  "Cache for marks which should be set upon closing current group.")
+
+(defvar nnmairix-version-output nil
+  "Version string of mairix binary.")
+
+;;; === Gnus back end functions
 
 (nnoo-define-basics nnmairix)
 
@@ -372,13 +457,14 @@
   (let* ((qualgroup (if server
 			(gnus-group-prefixed-name group (list 'nnmairix server))
 		      group))
+	 (folder (gnus-group-get-parameter qualgroup 'folder))
+	 (allowfast (gnus-group-get-parameter qualgroup 'allow-fast))
 	 (query (gnus-group-get-parameter qualgroup 'query t))
-	(folder (gnus-group-get-parameter qualgroup 'folder))
-	(threads (gnus-group-get-parameter qualgroup 'threads))
-	(backendmethod (gnus-server-to-method
-			(format "%s:%s" (symbol-name nnmairix-backend)
-				nnmairix-backend-server)))
-	rval mfolder folderpath)
+	 (threads (gnus-group-get-parameter qualgroup 'threads))
+	 (backendmethod (gnus-server-to-method
+			 (format "%s:%s" (symbol-name nnmairix-backend)
+				 nnmairix-backend-server)))
+	 rval mfolder folderpath args)
     (cond
      ((not folder)
       ;; No folder parameter -> error
@@ -416,8 +502,10 @@
 		 folderpath))
 	       mfolder)))
       ;; If (not fast), call Mairix binary
+      ;; recreate underlying folder on the back end
       (setq rval
-	    (if fast 0
+	    (if (and fast allowfast)
+		0
 	      (nnmairix-call-mairix-binary
 	       (split-string nnmairix-mairix-command)
 	       mfolder query threads)))
@@ -435,7 +523,7 @@
 	  (nnml-generate-nov-databases-directory mfolder))
 	(nnmairix-call-backend
 	 "request-scan" folder nnmairix-backend-server)
-	(if fast
+	(if (and fast allowfast)
 	    t
 	  (nnmairix-request-group-with-article-number-correction
 	   folder qualgroup)))
@@ -475,6 +563,8 @@
     (nnmairix-call-backend
      "request-create-group" groupname nnmairix-backend-server)
     (gnus-group-add-parameter qualgroup '(folder . nil))
+    (when nnmairix-allowfast-default
+      (gnus-group-add-parameter qualgroup '(allow-fast . t)))
     (gnus-group-set-parameter qualgroup 'folder groupname))
   t)
 
@@ -512,11 +602,6 @@
      "request-article" article folder nnmairix-backend-server to-buffer))
   t)
 
-(deffoo nnmairix-close-group (group &optional server)
-  ;; Should we do something here?
-  nil)
-
-
 (deffoo nnmairix-request-list (&optional server)
   (when server (nnmairix-open-server server))
   (if (nnmairix-call-backend "request-list" nnmairix-backend-server)
@@ -542,6 +627,156 @@
 	t)
     nil))
 
+;; Silence byte-compiler.
+(defvar gnus-registry-install)
+(autoload 'gnus-registry-fetch-group "gnus-registry")
+(autoload 'gnus-registry-fetch-groups "gnus-registry")
+(autoload 'gnus-registry-add-group "gnus-registry")
+
+(deffoo nnmairix-request-set-mark (group actions &optional server)
+  (when server
+    (nnmairix-open-server server))
+  (let* ((qualgroup (gnus-group-prefixed-name group (list 'nnmairix nnmairix-current-server)))
+	 (propmarks (gnus-group-get-parameter qualgroup 'propmarks))
+	 (propto (gnus-group-get-parameter qualgroup 'propto t))
+	 (corr (nnmairix-get-numcorr group server))
+	 (folder (nnmairix-get-backend-folder group server)))
+    (save-excursion
+      (dolist (cur actions)
+	(let ((type (nth 1 cur))
+	      (cmdmarks (nth 2 cur))
+	      (range (gnus-uncompress-range (nth 0 cur)))
+	      mid ogroup number method temp)
+	  (when (and corr
+		     (not (zerop (cadr corr))))
+	    (setq range (mapcar (lambda (arg)
+				  (- arg (cadr corr)))
+				range)))
+	  (when propmarks
+	    (nnheader-message 7 "nnmairix: Setting marks...")
+	      (dolist (article range)
+		;; get article (header) and extract message id
+		;; we try to determine as many original articles as possible
+		(catch 'problem
+		  (nnmairix-call-backend "open-server" nnmairix-backend-server)
+		  (unless (gnus-request-head
+			   article
+			   (gnus-group-prefixed-name
+			    folder
+			    (list nnmairix-backend nnmairix-backend-server)))
+		    (nnheader-message
+		     3 "Unable to set mark: couldn't fetch article header for article number %d"
+		     article)
+		    (throw 'problem nil))
+		  (set-buffer nntp-server-buffer)
+		  (goto-char (point-min))
+		  (let ((case-fold-search t))
+		    (re-search-forward "^message-id:.*\\(<.+>\\)" nil t))
+		  (setq mid (match-string 1))
+		  (unless mid
+		    (nnheader-message
+		     3 "Unable to set mark: article number %d has no message-id header"
+		     article)
+		    (throw 'problem nil))
+		  ;; get original group. First try registry, then file path
+		  (setq ogroup
+			(nnmairix-determine-original-group-from-registry mid))
+		  (unless (or ogroup
+			      nnmairix-only-use-registry)
+		    (setq ogroup
+			  (nnmairix-determine-original-group-from-path
+			   mid nnmairix-current-server))
+		    ;; if available and allowed, add this entry to the registry
+		    (when (and (boundp 'gnus-registry-install)
+			       gnus-registry-install)
+		      (dolist (cur ogroup)
+			(unless (gnus-parameter-registry-ignore cur)
+			  (gnus-registry-add-group mid cur)))))
+		  (unless ogroup
+		    (nnheader-message
+		     3 "Unable to set mark: couldn't find original group for %s" mid)
+		    (throw 'problem nil))
+		  ;; store original groups with mid's. We cannot get
+		  ;; the article number immediately since this would
+		  ;; generate problems with maildir (articles might
+		  ;; get moved from /new to /cur and further marks
+		  ;; could then not be set)
+		  (dolist (cur ogroup)
+		    (setq temp (assoc cur
+				      nnmairix-marks-cache))
+		    (if temp
+			(nconc temp (list (list mid type cmdmarks)))
+		      (push (list cur (list mid type cmdmarks))
+			    nnmairix-marks-cache)))))
+	      (nnheader-message 7 "nnmairix: Setting marks... done")))))))
+
+(deffoo nnmairix-close-group (group &optional server)
+  (when server
+    (nnmairix-open-server server))
+  (let* ((qualgroup (gnus-group-prefixed-name group (list 'nnmairix nnmairix-current-server)))
+	 (propmarks (gnus-group-get-parameter qualgroup 'propmarks))
+	 method)
+    (when (and propmarks
+	       nnmairix-marks-cache)
+      (when (or (eq nnmairix-propagate-marks-upon-close t)
+		(and (eq nnmairix-propagate-marks-upon-close 'ask)
+		     (y-or-n-p "Propagate marks to original articles? ")))
+      (save-excursion
+	(set-buffer gnus-group-buffer)
+	(nnmairix-propagate-marks)
+	;; update mairix group
+	(gnus-group-jump-to-group qualgroup)
+	(gnus-group-get-new-news-this-group))))))
+
+(autoload 'nnimap-request-update-info-internal "nnimap")
+
+(deffoo nnmairix-request-update-info (group info &optional server)
+;; propagate info from underlying IMAP folder to nnmairix group
+;; This is currently experimental and must be explicitly activated
+;; with nnmairix-propagate-marks-to-nnmairix-group
+  (when server
+    (nnmairix-open-server server))
+  (let* ((qualgroup (gnus-group-prefixed-name
+		    group
+		    (list 'nnmairix nnmairix-current-server)))
+	 (readmarks (gnus-group-get-parameter qualgroup 'readmarks))
+	 (propmarks (gnus-group-get-parameter qualgroup 'propmarks))
+	 (folder (nnmairix-get-backend-folder group server))
+	 (corr (nnmairix-get-numcorr group server))
+	 (docorr (and corr (not (zerop (cadr corr)))))
+	 (folderinfo `(,group 1 ((1 . 1))))
+	 readrange marks)
+      (when (and propmarks
+		 nnmairix-propagate-marks-to-nnmairix-groups)
+	;; these groups are not subscribed, so we have to ask the back end directly
+	(if (eq nnmairix-backend 'nnimap)
+	    (nnimap-request-update-info-internal folder folderinfo nnmairix-backend-server)
+	  (nnmairix-call-backend "request-update-info" folder folderinfo nnmairix-backend-server))
+	;; set range of read articles
+	(gnus-info-set-read
+	 info
+	 (if docorr
+	     (nnmairix-map-range
+	      `(lambda (x) (+ x ,(cadr corr)))
+	      (gnus-info-read folderinfo))
+	   (gnus-info-read folderinfo)))
+	;; set other marks
+	(gnus-info-set-marks
+	 info
+	 (if docorr
+	     (mapcar (lambda (cur)
+			 (cons
+			  (car cur)
+			  (nnmairix-map-range
+			   `(lambda (x) (+ x ,(cadr corr)))
+			   (list (cadr cur)))))
+		     (gnus-info-marks folderinfo))
+	   (gnus-info-marks folderinfo))))
+      (when (eq readmarks 'unread)
+	(gnus-info-set-read info nil))
+      (when (eq readmarks 'read)
+	(gnus-info-set-read info (gnus-active qualgroup))))
+  t)
 
 (nnoo-define-skeleton nnmairix)
 
@@ -664,7 +899,6 @@
 			(list 'nnmairix-hidden-folders hidden)
 			(list 'nnmairix-default-group defaultgroup)))))
 
-
 (defun nnmairix-group-change-query-this-group (&optional query)
   "Set QUERY for group under cursor."
   (interactive)
@@ -690,19 +924,59 @@
 If THREADS is a positive number, set threads parameter to t.
 If THREADS is a negative number, set it to nil."
   (interactive)
-  (let* ((group (gnus-group-group-name))
-	 (method (gnus-find-method-for-group group))
-	 (getthreads (or threads
-			(not (gnus-group-get-parameter group 'threads)))))
+  (let ((group (gnus-group-group-name)))
+    (when (nnmairix-group-toggle-parameter
+	   group 'threads "Threads" threads)
+      (nnmairix-update-and-clear-marks group))))
+
+(defun nnmairix-group-toggle-propmarks-this-group (&optional propmarks)
+  "Toggle marks propagation for this group.
+If PROPMARKS is a positive number, set parameter to t.
+If PROPMARKS is a negative number, set it to nil."
+  (interactive)
+  (unless (nnmairix-check-mairix-version "maildirpatch")
+    (error "You need a mairix binary with maildir patch to use this feature.  See docs for details"))
+  (let ((group (gnus-group-group-name)))
+    (when (or (not (string= (gnus-group-short-name group)
+			    (cadr (assoc 'nnmairix-default-group
+					(gnus-find-method-for-group group)))))
+	      (y-or-n-p "You should not activate marks propagation for the default \
+search group.  Are you sure? "))
+      (nnmairix-group-toggle-parameter
+       group 'propmarks "Marks propagation" propmarks))))
+
+(defun nnmairix-group-toggle-allowfast-this-group (&optional allowfast)
+  "Toggle fast entering for this group.
+If ALLOWFAST is a positive number, set parameter to t.
+If ALLOWFAST is a negative number, set it to nil."
+  (interactive)
+  (nnmairix-group-toggle-parameter
+   (gnus-group-group-name) 'allow-fast "Fast entering" allowfast))
+
+
+(defun nnmairix-group-toggle-readmarks-this-group (&optional readmarks)
+  "Toggle read/unread marks for this group.
+If READMARKS is a positive number, articles will always be read.
+If READMARKS is a negative number, articles will always be unread.
+If READMARKS is t or zero, marks will stay unchanged."
+  (interactive)
+  (let*  ((group (gnus-group-group-name))
+	  (method (gnus-find-method-for-group group))
+	  (readmarks (or readmarks
+			 (gnus-group-get-parameter group 'readmarks))))
     (if (eq (car method) 'nnmairix)
-	(progn
-	  (when (numberp getthreads)
-	    (setq getthreads (> getthreads 0)))
-	  (gnus-group-set-parameter group 'threads getthreads)
-	  (if getthreads
-	      (message "Threads activated for group %s" group)
-	    (message "Threads deacitavted for group %s" group))
-	  (nnmairix-update-and-clear-marks group))
+	(cond
+	 ((or (and (numberp readmarks) (< readmarks 0))
+	      (eq readmarks 'read))
+	  (gnus-group-set-parameter group 'readmarks 'unread)
+	  (nnheader-message 3 "Articles in %s always unread." group))
+	 ((or (and (numberp readmarks) (> readmarks 0))
+	      (not readmarks))
+	      (gnus-group-set-parameter group 'readmarks 'read)
+	      (nnheader-message 3 "Articles in %s always read." group))
+	 (t
+	  (gnus-group-set-parameter group 'readmarks nil)
+	  (nnheader-message 3 "Read marks in %s stay unchanged." group)))
       (error "This is no nnmairix group"))))
 
 
@@ -732,7 +1006,7 @@
       (when (< threads 0)
 	(gnus-group-set-parameter qualgroup 'threads nil)))
     (nnmairix-update-and-clear-marks qualgroup)
-    (when (not (zerop (gnus-group-unread qualgroup)))
+    (unless (equal (gnus-active qualgroup) '(1 . 0))
       (gnus-group-read-group nil t qualgroup))))
 
 (defun nnmairix-search-thread-this-article ()
@@ -850,139 +1124,130 @@
 	  (set-process-sentinel (apply 'start-process args)
 				'nnmairix-sentinel-mairix-update-finished))))))
 
-;; Silence byte-compiler.
-(defvar gnus-registry-install)
-(autoload 'gnus-registry-fetch-group "gnus-registry")
-
-(defun nnmairix-goto-original-article (&optional no-registry)
-  "Jump to the original group and display article.
-The original group of the article is first determined with the
-registry (if enabled). If the registry is not enabled or did not
-find the article or the prefix NO-REGISTRY is non-nil, this
-function will try to determine the original group form the path
-of the mail file. The path is obtained through another mairix
-search in raw mode."
-  (interactive "P")
-  (when (not (eq (car gnus-current-select-method) 'nnmairix))
-    (let ((method (gnus-find-method-for-group gnus-newsgroup-name)))
-      (if (eq (car method) 'nnmairix)
-	  (nnmairix-open-server (nth 1 method))
-	(error "Not in a nnmairix group"))))
-  (when (not (gnus-buffer-live-p gnus-article-buffer))
-    (error "No article buffer available"))
-  (let ((server (nth 1 gnus-current-select-method))
-	mid rval group allgroups)
-    ;; get message id
-    (save-excursion
-      (set-buffer gnus-article-buffer)
-      (gnus-summary-toggle-header 1)
-      (setq mid (message-fetch-field "Message-ID"))
-      ;; first check the registry (if available)
-      (when (and (boundp 'gnus-registry-install)
-		 gnus-registry-install
-		 (not no-registry))
-	(setq group (gnus-registry-fetch-group mid)))
-      (while (string-match "[<>]" mid)
-	(setq mid (replace-match "" t t mid)))
-      (unless group
-	;; registry was not available or did not find article
-	;; so we search again with mairix in raw mode to get filename
-	(nnmairix-open-server server)
-	(setq rval
-	      (nnmairix-call-mairix-binary-raw
-	       (split-string nnmairix-mairix-command)
-	       (list (concat "m:" mid))))
-	(if (zerop rval)
-	    ;; determine original group(s) from filename
-	    (save-excursion
-	      (set-buffer nnmairix-mairix-output-buffer)
-	      (goto-char (point-min))
-	      (while (looking-at "/")
-		(push (nnmairix-determine-original-group)
-		      allgroups)
-		(forward-line 1))
-	      (if (> (length allgroups) 1)
-		  (setq group
-			(completing-read
-			 "Message exists in more than one group. Choose: "
-			 allgroups nil t))
-		(setq group (car allgroups))))
-	  (error "Mairix could not find original article. See buffer %s for details"
-		 nnmairix-mairix-output-buffer))))
-    (if group
-	;; show article in summary buffer
-	(nnmairix-show-original-article group mid)
-      (message "Couldn't find original article"))))
+(defun nnmairix-group-delete-recreate-this-group ()
+  "Deletes and recreates group on the back end.
+You can use this function on nnmairix groups which continously
+show wrong article counts."
+  (interactive)
+  (let* ((group (gnus-group-group-name))
+	 (method (gnus-find-method-for-group group)))
+    (unless (eq (car method) 'nnmairix)
+      (error "This is not a nnmairix group"))
+    (when (y-or-n-p
+	   (format "Really recreate group %s on the back end? " group))
+      (nnmairix-delete-recreate-group group)
+      (gnus-group-get-new-news-this-group))))
 
-(defun nnmairix-determine-original-group ()
-  "Try to determine to original group from the file path."
-  (let (path filename serverbase group maildirflag allgroups)
-    (re-search-forward "^\\(.*\\)/\\(.*?\\)$")
-    (setq path (expand-file-name (match-string 1)))
-    (setq filename (match-string 2))
-    ;; when we deal with maildir, remove cur/new/tmp from path
-    (setq maildirflag (string-match ".+\\..+\\..+" filename))
-    (when maildirflag
-      (setq path
-	    (replace-regexp-in-string
-	     ".*\\(/cur\\|/new\\|/tmp\\)$" "" path t t 1)))
-    ;; we first check nnml and nnmaildir servers
-    (setq
-     group
-     (catch 'found
-       (dolist (cur gnus-opened-servers)
-	 (when (or (and (not maildirflag)
-			(eq (caar cur) 'nnml))
-		   (and maildirflag
-			(eq (caar cur) 'nnmaildir)))
-	   ;; get base path from server
-	   (if maildirflag
-	       (setq serverbase (cadr (assoc 'directory (car cur))))
-	     (setq serverbase (cadr (assoc 'nnml-directory (car cur))))
-	     (when (not serverbase)
-	       (setq serverbase nnml-directory)))
-	   (setq serverbase (file-name-as-directory
-			     (expand-file-name serverbase)))
-	   (when (string-match (concat serverbase "\\(.*\\)") path)
-	     ;; looks good - rest of the path should be the group
-	     (setq group (match-string 1 path))
-	     (when (string-match "/$" group)
-	       (setq group (replace-match "" t t group)))
-	     (when (not maildirflag)
-	       ;; for nnml: convert slashes to dots
-	       (while (string-match "/" group)
-		 (setq group (replace-match "." t t group))))
-	     (setq group (gnus-group-prefixed-name group (car cur)))
-	     ;; check whether this group actually exists
-	     (when (gnus-group-entry group)
-	       (throw 'found group)))))))
-    (unless group
-      ;; we haven't found it yet --> look for nnimap groups
-      ;; assume last element of the path is the group
-      (string-match "^.*/\\.?\\(.*\\)$" path)
-      (setq group (match-string 1 path))
-      ;; convert dots to slashes (nested group)
-      (while (string-match "\\." group)
-	(setq group (replace-match "/" t t group)))
-      (dolist (cur gnus-opened-servers)
-	(when (eq (caar cur) 'nnimap)
-	  (when (gnus-group-entry
-		 (gnus-group-prefixed-name group (car cur)))
-	    (push
-	     (gnus-group-prefixed-name group (car cur))
-	     allgroups))))
-      (if (> (length allgroups) 1)
-	  (setq group (completing-read
-		       "Group %s exists on more than one IMAP server. Choose: "
-		       allgroups nil t))
-	(setq group (car allgroups))))
-    group))
+(defun nnmairix-propagate-marks (&optional server)
+  "Propagate marks from nnmairix group to original articles.
+Unless SERVER is explicitly specified, will use the last opened
+nnmairix server. Only marks from current session will be set."
+  (interactive)
+  (if server
+      (nnmairix-open-server server)
+    (unless (eq (car gnus-current-select-method) 'nnmairix)
+      (if nnmairix-current-server
+	  (nnmairix-open-server nnmairix-current-server)
+	(error "No opened nnmairix server"))))
+  (if nnmairix-marks-cache
+      (let (number ogroup number-cache method mid-marks temp)
+	;; first we get the article numbers
+	(catch 'problem
+	  (while (setq ogroup (pop nnmairix-marks-cache))
+	    (while (setq mid-marks (pop (cdr ogroup)))
+	      (setq number
+		    (cdr
+		     (gnus-request-head (car mid-marks) (car ogroup))))
+	      (unless number
+		(nnheader-message
+		 3 "Unable to set mark: couldn't determine article number for %s in %s"
+		 (car mid-marks) (car ogroup))
+		(throw 'problem nil))
+	      (setq temp (assoc (car ogroup) number-cache))
+	      (if temp
+		  (catch 'done
+		    (dolist (cur (cdr temp))
+		      (when (equal (cdr cur) (list (nth 1 mid-marks) (nth 2 mid-marks)))
+			(nconc (car cur) (list number))
+			(throw 'done nil)))
+		    (nconc temp (list (list (list number) (nth 1 mid-marks) (nth 2 mid-marks)))))
+		(push (list (car ogroup) (list (list number) (nth 1 mid-marks) (nth 2 mid-marks)))
+		      number-cache)))))
+	;; now we set the marks
+	(save-excursion
+	  (set-buffer gnus-group-buffer)
+	  (nnheader-message 5 "nnmairix: Propagating marks...")
+	  (dolist (cur number-cache)
+	    (setq method (gnus-find-method-for-group (car cur)))
+	    (apply (intern (format "%s-%s"
+				   (symbol-name (car method))
+				   "request-set-mark"))
+		   (gnus-group-short-name (car cur))
+		   (cdr cur)
+		   (list (nth 1 method)))
+	    (gnus-group-jump-to-group (car cur))
+	    (gnus-group-get-new-news-this-group)))
+	(nnheader-message 5 "nnmairix: Propagating marks... done"))
+    (nnheader-message 3 "No marks to propagate.")))
 
+(defun nnmairix-update-groups (servername &optional skipdefault updatedb)
+  "Update all search groups on SERVERNAME.
+If SKIPDEFAULT is t, the default search group will not be
+updated.
+If UPDATEDB is t, database for SERVERNAME will be updated first."
+  (interactive (list (completing-read "Update groups on server: "
+				(nnmairix-get-nnmairix-servers))))
+  (save-excursion
+    (when (string-match ".*:\\(.*\\)" servername)
+      (setq servername (match-string 1 servername)))
+    (if (not (assoc (format "nnmairix:%s" servername)
+		    (nnmairix-get-nnmairix-servers)))
+	(nnheader-message 3 "Server %s not opened" servername)
+      (when updatedb
+	(let ((nnmairix-mairix-synchronous-update t))
+	  (nnmairix-update-database
+	   (list (list (format "nnmairix:%s" servername))))))
+      (let ((groups (nnmairix-get-groups-from-server servername))
+	    default)
+	(when skipdefault
+	  (setq default
+		(format "nnmairix+%s:%s"
+			servername
+			(cadr
+			 (assoc 'nnmairix-default-group
+				(gnus-server-to-method
+				 (format "nnmairix:%s" servername)))))))
+	(dolist (cur groups)
+	  (unless (and skipdefault
+		       (string= (car cur) default))
+	    (gnus-group-jump-to-group (car cur))
+	    (gnus-group-get-new-news-this-group)))))))
+
+(defun nnmairix-remove-tick-mark-original-article ()
+  "Remove tick mark from original article.
+Marks propagation has to be enabled for this to work."
+  (interactive)
+  (unless (eq (car gnus-current-select-method) 'nnmairix)
+    (error "Not in a nnmairix group"))
+  (save-excursion
+    (let ((mid (mail-header-message-id (gnus-summary-article-header)))
+	  groups cur)
+      (when mid
+	(setq groups (nnmairix-determine-original-group-from-registry mid))
+	(unless (or groups
+		    nnmairix-only-use-registry)
+	  (setq groups
+		(nnmairix-determine-original-group-from-path mid nnmairix-current-server)))
+	(unless groups
+	  (error "Couldn't find original article"))
+	(dolist (cur groups)
+	  (push `(,cur (,mid del (tick))) nnmairix-marks-cache))
+	(nnheader-message 5 "Will remove tick mark for %s upon closing." mid)))))
 
 ;;; ==== Helper functions
 
 (defun nnmairix-request-group-with-article-number-correction (folder qualgroup)
-  "Request FOLDER on backend for nnmairix QUALGROUP and article number correction."
+  "Request FOLDER on back end for nnmairix QUALGROUP and article number correction."
   (save-excursion
     (nnmairix-call-backend "request-group" folder nnmairix-backend-server)
     (set-buffer nnmairix-mairix-output-buffer)
@@ -1024,8 +1289,8 @@
 	   'nnmairix "Error calling back end on group %s" folder)
 	  nil)))))
 
-(defun nnmairix-call-mairix-binary (command folder query threads)
-  "Call mairix binary with COMMAND, using FOLDER and QUERY.
+(defun nnmairix-call-mairix-binary (command folder searchquery threads)
+  "Call mairix binary with COMMAND, using FOLDER and SEARCHQUERY.
 If THREADS is non-nil, enable full threads."
   (let ((args (cons (car command) '(nil t nil))))
     (save-excursion
@@ -1034,10 +1299,15 @@
       (erase-buffer)
       (when (> (length command) 1)
 	(setq args (append args (cdr command))))
+      (when nnmairix-mairix-search-options
+	(setq args (append args nnmairix-mairix-search-options)))
+      ;; If we have a patched mairix binary, call it with "-c"
+      (when (nnmairix-check-mairix-version "maildirpatch")
+	(setq args (append args '("-c"))))
       (when threads
 	(setq args (append args '("-t"))))
       (apply 'call-process
-	     (append args (list "-o" folder) query)))))
+	     (append args (list "-o" folder) searchquery)))))
 
 (defun nnmairix-call-mairix-binary-raw (command query)
   "Call mairix binary with COMMAND and QUERY in raw mode."
@@ -1086,9 +1356,8 @@
 	(push (list server) openedserver)))
     openedserver))
 
-
 (defun nnmairix-get-valid-servers ()
-  "Return list of valid backend servers for nnmairix groups."
+  "Return list of valid back end servers for nnmairix groups."
   (let ((alist gnus-opened-servers)
 	(mairixservers (nnmairix-get-nnmairix-servers t))
 	server mserver openedserver occ cur)
@@ -1123,6 +1392,16 @@
 	 openedserver)))
     openedserver))
 
+(defun nnmairix-get-groups-from-server (servername)
+  "Return all groups for nnmairix server SERVERNAME."
+  (let ((searchstring (format "nnmairix\\+%s:" servername))
+	groups)
+    (dolist (cur gnus-newsrc-alist)
+      (when (string-match searchstring
+			  (car cur))
+	(push (list (car cur)) groups)))
+    groups))
+
 (defun nnmairix-call-backend (func &rest args)
   "Call a function FUNC on backend with ARGS."
   (apply (intern (format "%s-%s" (symbol-name nnmairix-backend) func)) args))
@@ -1250,43 +1529,50 @@
       ;; If there is just one (or none) nnmairix server:
       (gnus-server-to-method (caar allservers)))))
 
+
+(defun nnmairix-delete-recreate-group (group)
+  "Delete and recreate folder from GROUP on the back end."
+  (when (member nnmairix-backend nnmairix-delete-and-create-on-change)
+    (let ((folder (gnus-group-get-parameter group 'folder)))
+      (if (string-match nnmairix-group-regexp folder)
+	  (progn
+	    (nnmairix-call-backend "open-server"
+				   nnmairix-backend-server)
+	    (nnmairix-call-backend "request-delete-group"
+				   folder t nnmairix-backend-server)
+	    (nnmairix-call-backend "request-create-group"
+				   folder nnmairix-backend-server))
+	(error "`nnmairix-delete-recreate-group' called on \
+non-mairix group.  Check folder parameter")))))
+
 (defun nnmairix-update-and-clear-marks (group &optional method)
   "Update group and clear all marks from GROUP using METHOD."
-  (when method
-    (setq group (gnus-group-prefixed-name group method)))
   (let ((method (or method
 		    (gnus-find-method-for-group group)))
-	(folder (gnus-group-get-parameter group 'folder))
 	(corr (gnus-group-get-parameter group 'numcorr t))
 	info)
+    (unless (or (gnus-group-prefixed-p group)
+		(not method))
+      (setq group (gnus-group-prefixed-name group method)))
     (if (eq (nth 0 method) 'nnmairix)
 	(save-excursion
 	  (nnmairix-open-server (nth 1 method))
 	  (set-buffer gnus-group-buffer)
+	  ;; (gnus-group-set-parameter group 'propmarks nil)
 	  (setq info (gnus-get-info group))
 	  ;; Clear active and info
 	  (gnus-set-active group nil)
 	  (gnus-info-clear-data info)
 	  ;; Delete and re-create group if needed
+	  (nnmairix-delete-recreate-group group)
+	  ;; set flag that group has changed for article number correction
 	  (when (member nnmairix-backend nnmairix-delete-and-create-on-change)
-	    (if (string-match nnmairix-group-regexp folder)
-		(progn
-		  (nnmairix-call-backend "open-server"
-					 nnmairix-backend-server)
-		  (nnmairix-call-backend "request-delete-group"
-					 folder t nnmairix-backend-server)
-		  (nnmairix-call-backend "request-create-group"
-					 folder nnmairix-backend-server)
-		  ;; set flag that group has changed for article number correction
-		  (when corr
-		    (setcar corr t)
-		    (gnus-group-set-parameter group 'numcorr corr)))
-	      (error "Nnmairix-update-and-clear-marks - delete/create with\
- non-mairix group!! - check folder parameter")))
-	  (when (gnus-group-jump-to-group group)
-	    (gnus-group-get-new-news-this-group)))
-      (error "Nnmairix-update-and-clear-marks - Called with non-nnmairix group"))))
-
+	    (when corr
+	      (setcar corr t)
+	      (gnus-group-set-parameter group 'numcorr corr)))
+	  (gnus-group-jump-to-group group)
+	  (gnus-group-get-new-news-this-group))
+      (error "`nnmairix-update-and-clear-marks' called with non-nnmairix group"))))
 
 (defun nnmairix-sentinel-mairix-update-finished (proc status)
   "Sentinel for mairix update process PROC with STATUS."
@@ -1315,20 +1601,240 @@
       (setq header (replace-match "," t t header)))
   header))
 
+(defun nnmairix-group-toggle-parameter (group parameter description &optional par)
+  "Toggle on GROUP a certain PARAMETER.
+DESCRIPTION will be shown to the user with the activation
+status.  If PAR is a positive number, the group parameter will be
+set to t and to nil otherwise."
+  (let* ((method (gnus-find-method-for-group group))
+	 (par (or par
+		  (not (gnus-group-get-parameter group parameter)))))
+    (if (eq (car method) 'nnmairix)
+	(progn
+	  (when (numberp par)
+	    (setq par (> par 0)))
+	  (gnus-group-set-parameter group parameter par)
+	  (if par
+	      (message "%s activated for group %s" description group)
+	    (message "%s deactivated for group %s" description group))
+	  t)
+      (error "This is no nnmairix group")
+      nil)))
+
+;; Search for original article helper functions
+
+(defun nnmairix-goto-original-article (&optional no-registry)
+  "Jump to the original group and display article.
+The original group of the article is first determined with the
+registry (if enabled).  If the registry is not enabled or did not
+find the article or the prefix NO-REGISTRY is non-nil, this
+function will try to determine the original group form the path
+of the mail file.  The path is obtained through another mairix
+search in raw mode."
+  (interactive "P")
+  (when (not (eq (car gnus-current-select-method) 'nnmairix))
+    (let ((method (gnus-find-method-for-group gnus-newsgroup-name)))
+      (if (eq (car method) 'nnmairix)
+	  (nnmairix-open-server (nth 1 method))
+	(error "Not in a nnmairix group"))))
+  (when (not (gnus-buffer-live-p gnus-article-buffer))
+    (error "No article buffer available"))
+  (let ((server (nth 1 gnus-current-select-method))
+	mid rval group allgroups)
+    ;; get message id
+    (save-excursion
+      (set-buffer gnus-article-buffer)
+      (gnus-summary-toggle-header 1)
+      (setq mid (message-fetch-field "Message-ID"))
+      ;; first check the registry (if available)
+      (unless no-registry
+	(setq allgroups (nnmairix-determine-original-group-from-registry mid)))
+      (unless (or allgroups
+		  nnmairix-only-use-registry)
+	;; registry was not available or did not find article
+	;; so we search again with mairix in raw mode to get filename
+	(setq allgroups
+	      (nnmairix-determine-original-group-from-path mid server))
+	;; if available and allowed, add this entry to the registry
+	(when (and (not no-registry)
+		   (boundp 'gnus-registry-install)
+		   gnus-registry-install)
+	  (dolist (cur allgroups)
+	    (unless (gnus-parameter-registry-ignore cur)
+	      (gnus-registry-add-group mid cur)))))
+      (if (> (length allgroups) 1)
+	  (setq group
+		(completing-read
+		 "Message exists in more than one group. Choose: "
+		 allgroups nil t))
+	(setq group (car allgroups))))
+    (if group
+	;; show article in summary buffer
+	(nnmairix-show-original-article group mid)
+      (nnheader-message 3 "Couldn't find original article"))))
+
+(defun nnmairix-determine-original-group-from-registry (mid)
+  "Try to determinale original group for message-id MID from the registry."
+  (when (and (boundp 'gnus-registry-install)
+	     gnus-registry-install)
+    (unless (string-match "^<" mid)
+      (set mid (concat "<" mid)))
+    (unless (string-match ">$" mid)
+      (set mid (concat mid ">")))
+    (gnus-registry-fetch-groups mid)))
+
+(defun nnmairix-determine-original-group-from-path (mid server)
+  "Determine original group(s) for message-id MID from the file path.
+The file path is obtained through a mairix search for the id on
+SERVER."
+  (nnmairix-open-server server)
+  (while (string-match "[<>]" mid)
+    (setq mid (replace-match "" t t mid)))
+  (let (allgroups)
+    (if (zerop (nnmairix-call-mairix-binary-raw
+		(split-string nnmairix-mairix-command)
+		(list (concat "m:" mid))))
+	(save-excursion
+	  (set-buffer nnmairix-mairix-output-buffer)
+	  (goto-char (point-min))
+	  (while (re-search-forward "^/.*$" nil t)
+	    (push (nnmairix-get-group-from-file-path (match-string 0))
+		  allgroups)
+	    (forward-line 1)))
+      (error "Mairix could not find original article.  See buffer %s for details"
+	     nnmairix-mairix-output-buffer))
+    allgroups))
+
+(defun nnmairix-get-group-from-file-path (file)
+  "Get group by parsing the message location FILE."
+  (let (path filename serverbase group maildirflag allgroups)
+    (string-match "^\\(.*\\)/\\(.*?\\)$" file)
+    (setq path (expand-file-name (match-string 1 file)))
+    (setq filename (match-string 2 file))
+    ;; when we deal with maildir, remove cur/new/tmp from path
+    (setq maildirflag (string-match ".+\\..+\\..+" filename))
+    (when maildirflag
+      (setq path
+	    (replace-regexp-in-string
+	     ".*\\(/cur\\|/new\\|/tmp\\)$" "" path t t 1)))
+    ;; we first check nnml and nnmaildir servers
+    (setq
+     group
+     (catch 'found
+       (dolist (cur gnus-opened-servers)
+	 (when (or (and (not maildirflag)
+			(eq (caar cur) 'nnml))
+		   (and maildirflag
+			(eq (caar cur) 'nnmaildir)))
+	   ;; get base path from server
+	   (if maildirflag
+	       (setq serverbase (cadr (assoc 'directory (car cur))))
+	     (setq serverbase (cadr (assoc 'nnml-directory (car cur))))
+	     (unless serverbase
+	       (setq serverbase nnml-directory)))
+	   (setq serverbase (file-name-as-directory
+			     (expand-file-name serverbase)))
+	   (when (string-match (concat serverbase "\\(.*\\)") path)
+	     ;; looks good - rest of the path should be the group
+	     (setq group (match-string 1 path))
+	     (when (string-match "/$" group)
+	       (setq group (replace-match "" t t group)))
+	     (unless maildirflag
+	       ;; for nnml: convert slashes to dots
+	       (while (string-match "/" group)
+		 (setq group (replace-match "." t t group))))
+	     (setq group (gnus-group-prefixed-name group (car cur)))
+	     ;; check whether this group actually exists
+	     (when (gnus-group-entry group)
+	       (throw 'found group)))))))
+    (unless group
+      ;; we haven't found it yet --> look for nnimap groups. Assume
+      ;; last element of the path is the group. This might fail since
+      ;; IMAP servers may present groups to the client in arbitrary
+      ;; ways...
+      (string-match "^.*/\\.?\\(.*\\)$" path)
+      (setq group (match-string 1 path))
+      ;; convert dots to slashes (nested group)
+      (while (string-match "\\." group)
+	(setq group (replace-match "/" t t group)))
+      (dolist (cur gnus-opened-servers)
+	(when (eq (caar cur) 'nnimap)
+	  (when (gnus-group-entry
+		 (gnus-group-prefixed-name group (car cur)))
+	    (push
+	     (gnus-group-prefixed-name group (car cur))
+	     allgroups))))
+      (if (> (length allgroups) 1)
+	  (setq group (completing-read
+		       "Group %s exists on more than one IMAP server. Choose: "
+		       allgroups nil t))
+	(setq group (car allgroups))))
+    group))
+
 (defun nnmairix-show-original-article (group mid)
   "Switch to GROUP and display Article with message-id MID."
+  (unless (string-match "^<" mid)
+    (set mid (concat "<" mid)))
+  (unless (string-match ">$" mid)
+    (set mid (concat mid ">")))
   (when (string-match "Summary" (buffer-name (current-buffer)))
     (gnus-summary-exit))
   (pop-to-buffer gnus-group-buffer)
   (gnus-group-jump-to-group group)
   (gnus-summary-read-group group 1 t)
   (gnus-summary-refer-article mid)
-  (gnus-summary-limit-to-headers (format "message-id: <%s>" mid))
+  (gnus-summary-limit-to-headers (format "message-id: %s" mid))
   (gnus-summary-select-article)
   ;; Force redisplay
   (gnus-summary-show-article)
   (nnheader-message 5 "Switched to group %s." group))
 
+(defun nnmairix-map-range (func range)
+  "Map function FUNC on all members of RANGE."
+  (cond
+   ((numberp range)
+    (funcall func range))
+   (t
+    (mapcar (lambda (cur)
+	      (cond
+	       ((listp cur)
+		(cons
+		 (funcall func (car cur))
+		 (funcall func (cdr cur))))
+	       ((numberp cur)
+		(funcall func cur))))
+	    range))))
+
+(defun nnmairix-check-mairix-version (version &optional server)
+  "Check mairix VERSION on SERVER.
+If VERSION is a number: specifies the minimum version.
+If VERSION is a string: must be contained in mairix version output."
+  (unless server
+    (setq server nnmairix-current-server))
+  (let ((versionstring (cadr (assoc server nnmairix-version-output))))
+    (unless versionstring
+      ;; call "mairix -V" to get the version string
+      (with-temp-buffer
+	(setq versionstring
+	      (let* ((commandsplit (split-string nnmairix-mairix-command))
+		     (args (append (list (car commandsplit))
+				  `(nil t nil) (cdr commandsplit) '("-V"))))
+	      (apply 'call-process args)
+	      (goto-char (point-min))
+	      (re-search-forward "mairix.*")
+	      (match-string 0))))
+      ;; save version string for current session
+      (setq nnmairix-version-output
+	    (append nnmairix-version-output
+		    (list (list server versionstring)))))
+    (cond
+     ((stringp version)
+      (string-match version versionstring))
+     ((numberp version)
+      (<= version (string-to-number
+		   (progn
+		     (string-match "mairix \\([0-9\\.]+\\)" versionstring)
+		     (match-string 1 versionstring))))))))
 
 ;; ==== Widget stuff
 
@@ -1341,7 +1847,6 @@
   (nnmairix-widget-search
    (nnmairix-widget-get-values)))
 
-
 (defun nnmairix-widget-get-values ()
   "Create values for editable fields from current article."
   (if (not (gnus-buffer-live-p gnus-article-buffer))
@@ -1499,7 +2004,6 @@
       (nnmairix-widget-add "Threads" 'checkbox nil))
       (widget-insert " Show full threads\n\n")))
 
-
 (defun nnmairix-widget-build-editable-fields (values)
   "Build editable field widgets in `nnmairix-widget-fields-list'.
 VALUES may contain values for editable fields from current article."
@@ -1543,7 +2047,7 @@
    nnmairix-widgets))
 
 (defun nnmairix-widget-toggle-activate (widget)
-  "Toggle activation status of WIDGET dependent on corresponding checkbox value."
+  "Toggle activation status of WIDGET depending on corresponding checkbox value."
   (let ((field (widget-get widget :tag)))
     (if (widget-value widget)
 	(widget-apply