Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Separate signature files for email and groups
@ 2008-02-15  3:25 Sam Peterson
  2008-02-15  4:03 ` Allan
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Sam Peterson @ 2008-02-15  3:25 UTC (permalink / raw)
  To: info-gnus-english

Hello, I know about gnus-posting-styles, but I'm at a bit of a loss as
to how to customize this variable so that it uses a different
signature for email messages and newsgroup messages.  I've looked
around but haven't had any luck finding a solution.  All advice is
greatly appreciated.
-- 
Sam Peterson
skpeterson At nospam ucdavis.edu
"if programmers were paid to remove code instead of adding it,
software would be much better" -- unknown

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Separate signature files for email and groups
  2008-02-15  3:25 Separate signature files for email and groups Sam Peterson
@ 2008-02-15  4:03 ` Allan
  2008-02-15  7:58 ` Tassilo Horn
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Allan @ 2008-02-15  4:03 UTC (permalink / raw)
  To: info-gnus-english

Sam Peterson <skpeterson@nospam.please.ucdavis.edu> writes:

> Hello, I know about gnus-posting-styles, but I'm at a bit of a loss as
> to how to customize this variable so that it uses a different
> signature for email messages and newsgroup messages.  I've looked
> around but haven't had any luck finding a solution.  All advice is
> greatly appreciated.
> -- 
> Sam Peterson
> skpeterson At nospam ucdavis.edu
> "if programmers were paid to remove code instead of adding it,
> software would be much better" -- unknown
You can create a separate message signature file, which is what I have
done in my .emacs init file:
(setq message-signature nil)
(setq message-signature-file `"c:\\documents and
settings\\xxxxxx\\application data\\_msg-sig") . The reason I have a
full path name is that it did not work properly before on a Windows XP system.
There is no need for gnus-posting-styles just to have a different
message signature from your email signature.

-- 
Allan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Separate signature files for email and groups
  2008-02-15  3:25 Separate signature files for email and groups Sam Peterson
  2008-02-15  4:03 ` Allan
@ 2008-02-15  7:58 ` Tassilo Horn
       [not found] ` <mailman.7431.1203062304.18990.info-gnus-english@gnu.org>
  2008-02-15 15:59 ` Tobias Brink
  3 siblings, 0 replies; 12+ messages in thread
From: Tassilo Horn @ 2008-02-15  7:58 UTC (permalink / raw)
  To: info-gnus-english

Sam Peterson <skpeterson@nospam.please.ucdavis.edu> writes:

Hi Sam,

> Hello, I know about gnus-posting-styles, but I'm at a bit of a loss as
> to how to customize this variable so that it uses a different
> signature for email messages and newsgroup messages.  I've looked
> around but haven't had any luck finding a solution.  All advice is
> greatly appreciated.

You can use something like that:

(setq gnus-posting-styles
      `((".*"
         (signature-file "~/.my-mail-sig.txt"))
        ("^nntp"
         (signature "Foo Bar Baz"))))

This will use the text of the file ~/.my-mail-sig.txt for every posting,
except it's in a group starting with nntp (= newsgroup).  There it will
use the string "Foo Bar Baz" as signature.

Bye,
Tassilo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Separate signature files for email and groups
       [not found] ` <mailman.7431.1203062304.18990.info-gnus-english@gnu.org>
@ 2008-02-15 10:03   ` Sam Peterson
  2008-02-15 14:04   ` Sam Peterson
  1 sibling, 0 replies; 12+ messages in thread
From: Sam Peterson @ 2008-02-15 10:03 UTC (permalink / raw)
  To: info-gnus-english

Tassilo Horn <tassilo@member.fsf.org> on Fri, 15 Feb 2008 08:58:09
+0100 didst step forth and proclaim thus:

> Sam Peterson <skpeterson@nospam.please.ucdavis.edu> writes:
>
> Hi Sam,
>
>> Hello, I know about gnus-posting-styles, but I'm at a bit of a loss as
>> to how to customize this variable so that it uses a different
>> signature for email messages and newsgroup messages.  I've looked
>> around but haven't had any luck finding a solution.  All advice is
>> greatly appreciated.
>
> You can use something like that:
>
> (setq gnus-posting-styles
>       `((".*"
>          (signature-file "~/.my-mail-sig.txt"))
>         ("^nntp"
>          (signature "Foo Bar Baz"))))
>
> This will use the text of the file ~/.my-mail-sig.txt for every posting,
> except it's in a group starting with nntp (= newsgroup).  There it will
> use the string "Foo Bar Baz" as signature.
>

Thank you very much!  That worked a treat!

-- 
Sam Peterson
peabodyenator@gmail.com
"if programmers were paid to remove code instead of adding it,
software would be much better" -- unknown

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Separate signature files for email and groups
       [not found] ` <mailman.7431.1203062304.18990.info-gnus-english@gnu.org>
  2008-02-15 10:03   ` Sam Peterson
@ 2008-02-15 14:04   ` Sam Peterson
  2008-02-15 19:04     ` Tassilo Horn
  1 sibling, 1 reply; 12+ messages in thread
From: Sam Peterson @ 2008-02-15 14:04 UTC (permalink / raw)
  To: info-gnus-english

Tassilo Horn <tassilo@member.fsf.org> on Fri, 15 Feb 2008 08:58:09
+0100 didst step forth and proclaim thus:

> Sam Peterson <skpeterson@nospam.please.ucdavis.edu> writes:
>
> Hi Sam,
>
>> Hello, I know about gnus-posting-styles, but I'm at a bit of a loss as
>> to how to customize this variable so that it uses a different
>> signature for email messages and newsgroup messages.  I've looked
>> around but haven't had any luck finding a solution.  All advice is
>> greatly appreciated.
>
> You can use something like that:
>
> (setq gnus-posting-styles
>       `((".*"
>          (signature-file "~/.my-mail-sig.txt"))
>         ("^nntp"
>          (signature "Foo Bar Baz"))))
>
> This will use the text of the file ~/.my-mail-sig.txt for every posting,
> except it's in a group starting with nntp (= newsgroup).  There it will
> use the string "Foo Bar Baz" as signature.
>
> Bye,
> Tassilo

Actually, I take that back...this *seemed* like it worked, but it
stopped working mysteriously, I think I may have got my wires crossed.
"^nntp" pattern doesn't seem to match any newsgroups unfortunately.

I settled on using a regex of "^nn.+:" for mail groups.  I have to be
in one of my mail groups for it to work but that's okay by me.

-- 
Sam Peterson
skpeterson At nospam ucdavis.edu
"if programmers were paid to remove code instead of adding it,
software would be much better" -- unknown

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Separate signature files for email and groups
  2008-02-15  3:25 Separate signature files for email and groups Sam Peterson
                   ` (2 preceding siblings ...)
       [not found] ` <mailman.7431.1203062304.18990.info-gnus-english@gnu.org>
@ 2008-02-15 15:59 ` Tobias Brink
  2008-02-15 19:17   ` Tassilo Horn
       [not found]   ` <mailman.7456.1203103088.18990.info-gnus-english@gnu.org>
  3 siblings, 2 replies; 12+ messages in thread
From: Tobias Brink @ 2008-02-15 15:59 UTC (permalink / raw)
  To: info-gnus-english

Sam Peterson <skpeterson@nospam.please.ucdavis.edu> writes:

> Hello, I know about gnus-posting-styles, but I'm at a bit of a loss as
> to how to customize this variable so that it uses a different
> signature for email messages and newsgroup messages.  I've looked
> around but haven't had any luck finding a solution.  All advice is
> greatly appreciated.

How about the following?

(setq gnus-posting-styles
  '(((message-news-p)
     (signature "This is my news sig")
     )

    ((message-mail-p)
     (signature "This is my mail sig")
     )))

Greetings,
Tobias

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Separate signature files for email and groups
  2008-02-15 14:04   ` Sam Peterson
@ 2008-02-15 19:04     ` Tassilo Horn
  0 siblings, 0 replies; 12+ messages in thread
From: Tassilo Horn @ 2008-02-15 19:04 UTC (permalink / raw)
  To: info-gnus-english

Sam Peterson <skpeterson@nospam.please.ucdavis.edu> writes:

Hi Sam,

>> (setq gnus-posting-styles
>>       `((".*"
>>          (signature-file "~/.my-mail-sig.txt"))
>>         ("^nntp"
>>          (signature "Foo Bar Baz"))))
>>
>> This will use the text of the file ~/.my-mail-sig.txt for every
>> posting, except it's in a group starting with nntp (= newsgroup).
>> There it will use the string "Foo Bar Baz" as signature.
>
> Actually, I take that back...this *seemed* like it worked, but it
> stopped working mysteriously, I think I may have got my wires crossed.
> "^nntp" pattern doesn't seem to match any newsgroups unfortunately.

Ah, sorry.  I use nnnil as gnus-select-method and add all news and mail
servers as gnus-secondary-select-methods.  Those do always have a
backend+name prefix, but the one and only gnus-select-method doesn't.

Bye,
Tassilo
-- 
In an average living room there are 1,242 objects RMS could use to write
an OS, including the room itself.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Separate signature files for email and groups
  2008-02-15 15:59 ` Tobias Brink
@ 2008-02-15 19:17   ` Tassilo Horn
  2008-02-16  0:55     ` Reiner Steib
       [not found]   ` <mailman.7456.1203103088.18990.info-gnus-english@gnu.org>
  1 sibling, 1 reply; 12+ messages in thread
From: Tassilo Horn @ 2008-02-15 19:17 UTC (permalink / raw)
  To: info-gnus-english

Tobias Brink <tobias.brinkNO.SPAM@gmail.com> writes:

Hi Tobias,

> How about the following?
>
> (setq gnus-posting-styles
>   '(((message-news-p)
>      (signature "This is my news sig")
>      )
>
>     ((message-mail-p)
>      (signature "This is my mail sig")
>      )))

That won't work.  The regexps of posting styles are matched against
group names.  But you could use those functions to add a signature, too.

Untested:

(defun insert-sig ()
  (let ((message-signature (if (message-mail-p)
                               "My mail sig"
                             "My news sig")))
    (message-insert-signature)))

(add-hook 'message-send-hook 'insert-sig)

Or instead of the `if' in the function above you could use
`message-send-news-hook' and `message-send-mail-hook'.

Bye,
Tassilo
-- 
Richard  Stallman  needs  neither  mouse  nor keyboard  to  operate  his
computer. He just stares it down until it does what he wants.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Separate signature files for email and groups
       [not found]   ` <mailman.7456.1203103088.18990.info-gnus-english@gnu.org>
@ 2008-02-15 19:49     ` Tobias Brink
  2008-02-15 21:01       ` Tassilo Horn
  2008-02-15 22:24       ` Sam Peterson
  0 siblings, 2 replies; 12+ messages in thread
From: Tobias Brink @ 2008-02-15 19:49 UTC (permalink / raw)
  To: info-gnus-english

Tassilo Horn <tassilo@member.fsf.org> writes:

> Tobias Brink <tobias.brinkNO.SPAM@gmail.com> writes:
>
> Hi Tobias,
>
>> How about the following?
>>
>> (setq gnus-posting-styles
>>   '(((message-news-p)
>>      (signature "This is my news sig")
>>      )
>>
>>     ((message-mail-p)
>>      (signature "This is my mail sig")
>>      )))
>
> That won't work.  The regexps of posting styles are matched against
> group names.  But you could use those functions to add a signature, too.

I tested it and it worked.  As soon as I started a new e-mail it
attached the signature for mail.  For news see the sig in this post,
it was automatically created.  I'm using Gnus v5.11 with GNU Emacs
22.1.1 if this makes any difference.

Did I misunderstand the requirements of the OP?

HTH, nonetheless,
Tobias

-- 
NEWS

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Separate signature files for email and groups
  2008-02-15 19:49     ` Tobias Brink
@ 2008-02-15 21:01       ` Tassilo Horn
  2008-02-15 22:24       ` Sam Peterson
  1 sibling, 0 replies; 12+ messages in thread
From: Tassilo Horn @ 2008-02-15 21:01 UTC (permalink / raw)
  To: info-gnus-english

Tobias Brink <tobias.brinkNO.SPAM@gmail.com> writes:

Hi Tobias,

>>> (setq gnus-posting-styles
>>>   '(((message-news-p)
>>>      (signature "This is my news sig")
>>>      )
>>>
>>>     ((message-mail-p)
>>>      (signature "This is my mail sig")
>>>      )))
>>
>> That won't work.  The regexps of posting styles are matched against
>> group names.  But you could use those functions to add a signature,
>> too.
>
> I tested it and it worked.  As soon as I started a new e-mail it
> attached the signature for mail.  For news see the sig in this post,
> it was automatically created.

Oh, after reading the docs again, you're right.  Shame on me.  I've
always thought I'd know Gnus pretty well...

Bye,
Tassilo
-- 
Richard Stallman called  his operating system GNU because  he created it
before computers existed, when actual Gnus were used for calcuations.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Separate signature files for email and groups
  2008-02-15 19:49     ` Tobias Brink
  2008-02-15 21:01       ` Tassilo Horn
@ 2008-02-15 22:24       ` Sam Peterson
  1 sibling, 0 replies; 12+ messages in thread
From: Sam Peterson @ 2008-02-15 22:24 UTC (permalink / raw)
  To: info-gnus-english

Tobias Brink <tobias.brinkNO.SPAM@gmail.com> on Fri, 15 Feb 2008
20:49:06 +0100 didst step forth and proclaim thus:

> Tassilo Horn <tassilo@member.fsf.org> writes:
>
>> Tobias Brink <tobias.brinkNO.SPAM@gmail.com> writes:
>>
>> Hi Tobias,
>>
>>> How about the following?
>>>
>>> (setq gnus-posting-styles
>>>   '(((message-news-p)
>>>      (signature "This is my news sig")
>>>      )
>>>
>>>     ((message-mail-p)
>>>      (signature "This is my mail sig")
>>>      )))
>>
>> That won't work.  The regexps of posting styles are matched against
>> group names.  But you could use those functions to add a signature, too.
>
> I tested it and it worked.  As soon as I started a new e-mail it
> attached the signature for mail.  For news see the sig in this post,
> it was automatically created.  I'm using Gnus v5.11 with GNU Emacs
> 22.1.1 if this makes any difference.
>
> Did I misunderstand the requirements of the OP?
>
> HTH, nonetheless,
> Tobias

Thanks!  This worked nicely.

-- 
Sam Peterson
skpeterson At nospam ucdavis.edu
"if programmers were paid to remove code instead of adding it,
software would be much better" -- unknown

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Separate signature files for email and groups
  2008-02-15 19:17   ` Tassilo Horn
@ 2008-02-16  0:55     ` Reiner Steib
  0 siblings, 0 replies; 12+ messages in thread
From: Reiner Steib @ 2008-02-16  0:55 UTC (permalink / raw)
  To: info-gnus-english

On Fri, Feb 15 2008, Tassilo Horn wrote:

> That won't work.  The regexps of posting styles are matched against
> group names.

Huch?

,----[ (info "(gnus)Posting Styles") ]
|    If you wish to check whether the message you are about to compose is
| meant to be a news article or a mail message, you can check the values
| of the `message-news-p' and `message-mail-p' functions.
| 
|    So here's a new example: [...]
`----

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-02-16  0:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-15  3:25 Separate signature files for email and groups Sam Peterson
2008-02-15  4:03 ` Allan
2008-02-15  7:58 ` Tassilo Horn
     [not found] ` <mailman.7431.1203062304.18990.info-gnus-english@gnu.org>
2008-02-15 10:03   ` Sam Peterson
2008-02-15 14:04   ` Sam Peterson
2008-02-15 19:04     ` Tassilo Horn
2008-02-15 15:59 ` Tobias Brink
2008-02-15 19:17   ` Tassilo Horn
2008-02-16  0:55     ` Reiner Steib
     [not found]   ` <mailman.7456.1203103088.18990.info-gnus-english@gnu.org>
2008-02-15 19:49     ` Tobias Brink
2008-02-15 21:01       ` Tassilo Horn
2008-02-15 22:24       ` Sam Peterson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).