gnus-pers implements personalities for Message mode. It allows you to define a personality with any e-mail address, extra headers and signature you like, either as strings, functions or variables (signatures may also be files). Then it will chose a personality for you based on header info, gnus-newsgroup-name or group parameter. Additionally, you can change a personality in the middle of writing a message. This is intended to be an alternative to gnus-posting-styles, which only sets personalities (posting styles) based on which group you are in. Also, gnus-posting-styles must be defined by editing a your .gnus whereas gnus-pers uses Xemacs customize facility.

in your .gnus file:

    (require 'gnus-pers)

Then just M-x customize-group Personality (this page seems dead)

You can find it in again

Or directly at Debian packages CVS: gnus-pers.el 1.1; probably have to apply 50_gnus-pers.dpatch 1.1

I was having a problem with dueling From headers if I did not set a default personality. In other words. Gnus would insert a From header, then gnus-pers would insert another based on what I chose interactively at the prompt. Here’s my kludge to fix it:

    (setq gnus-posting-styles '((".*" ("From" nil))))

Apparently, when a header is set to nil in gnus-posting-styles, gnus-posting-styles just removes it. Fortunately, gnus-posting-styles runs before gnus-pers.

So, this is ugly, and maybe I’m just missing something. Can anyone point to a better fix?

Sometimes the group name matching rules I have in ‘gnus-personality-electric-headers’ would stop working for no apparent reason. I eventually tracked it down to being caused by invalid “,gnus-newsgroup-name”-regexps being cached in ‘gnus-personality-split-cache’ when gnus-pers was invoked with gnus-newsgroup-name as nil. I fixed it with the following patch:

--- gnus-pers-orig.el	2010-09-15 22:27:17.597372205 +0200
+++ gnus-pers.el	2010-09-16 03:02:43.087877865 +0200
@@ -831,11 +831,10 @@
 	     (retval (nthcdr 2 split))
 	     partial regexp)
 	;; Check to see if it's a "gnus-newsgroup-name" split
-	(if (and gnus-newsgroup-name
-		 (equal ",gnus-newsgroup-name" (cdr (assq field gnus-personality-split-abbrev-alist))))
-	    (let ((groupname gnus-newsgroup-name))
-	      (if (string-match value groupname)
-		  retval))
+	(if (equal ",gnus-newsgroup-name" (cdr (assq field gnus-personality-split-abbrev-alist)))
+        (if (and gnus-newsgroup-name (string-match value gnus-newsgroup-name))
+            retval)
 	    (if (symbolp value)

– Øyvind Stegard

Maybe the patches in Debian’s bugtracker may be useful too, for instance :;filename=patch;att=1;bug=448441

Hope this helps.

– Olivier Berger