Gnus development mailing list
 help / color / mirror / Atom feed
* header-action.el related.
@ 2001-06-22  1:47 Jinhyok Heo
  2001-06-22  3:07 ` William M. Perry
  2001-06-23  6:54 ` Jinhyok Heo
  0 siblings, 2 replies; 3+ messages in thread
From: Jinhyok Heo @ 2001-06-22  1:47 UTC (permalink / raw)


Hi,

I want to use different signature depending on some header, e.g. To or
From. And I found header-action.el would satisfy me. But I got some
problem with regexp. Help me!

I wanted to use '.signature' with the addresses containing 'abc.com'
and 'def.com'. And I want to use '.signature_2' otherwise.

I cannot express that with lisp regexp. I thought it would be
'[^(abc.com)]|[^(def.com)]' with some back slashes. I tried many
possible combinations, but it failed.

My configuration is similar with the following:

;;; my header-action setting
(setq header-action-list
      '(
	("\\(From\\|To\\|Cc\\|Reply-to\\):"
	 ("\\(abc\\.com\\|def\\.com\\)"
	  (lambda ()
	    ;; change signature
	    (make-variable-buffer-local 'mail-signature-file)
	    (setq mail-signature-file "~/.signature-hihome")
	    (mail-signature)
	    ;; change user-mail-address
	    (make-variable-buffer-local 'user-mail-address)
	    (setq user-mail-address "novembre@biz.hihome.com")
	    (message "Sending hihome Mail!"))))
	("\\(From\\|To\\|Cc\\|Reply-to\\):"
	 ("\\[^\\(abc.com\\)\\]\\|\\[^\\(def\\.com\\)\\]"
	  (lambda ()
	    ;; change signature
	    (make-variable-buffer-local 'mail-signature-file)
	    (setq mail-signature-file "~/.signature")
	    (mail-signature)
	    (message "Sending Mail!"))))
	)
      )

-- 
|  Jinhyok Heo            mailto : novembre @ournature.org
|                         whoami : <http://ournature.org/~novembre/>
|  "We are still reaching for the sky. In the developed countries people
|  are coming back down, saying, `It's empty up there.'" --- a Ladakhi monk

-- 
|  Jinhyok Heo            mailto : novembre @ournature.org
|                         whoami : <http://ournature.org/~novembre/>
|  "We are still reaching for the sky. In the developed countries people
|  are coming back down, saying, `It's empty up there.'" --- a Ladakhi monk


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

* Re: header-action.el related.
  2001-06-22  1:47 header-action.el related Jinhyok Heo
@ 2001-06-22  3:07 ` William M. Perry
  2001-06-23  6:54 ` Jinhyok Heo
  1 sibling, 0 replies; 3+ messages in thread
From: William M. Perry @ 2001-06-22  3:07 UTC (permalink / raw)
  Cc: ding

Jinhyok Heo <novembre@ournature.org> writes:

> I want to use different signature depending on some header, e.g. To or
> From. And I found header-action.el would satisfy me. But I got some
> problem with regexp. Help me!

> I wanted to use '.signature' with the addresses containing 'abc.com' and
> 'def.com'. And I want to use '.signature_2' otherwise.
> 
> I cannot express that with lisp regexp. I thought it would be
> '[^(abc.com)]|[^(def.com)]' with some back slashes. I tried many
> possible combinations, but it failed.
>
> My configuration is similar with the following:
> 
> ;;; my header-action setting
> (setq header-action-list
>       '(
> 	("\\(From\\|To\\|Cc\\|Reply-to\\):"
> 	 ("\\(abc\\.com\\|def\\.com\\)"

The problem is that header-action sticks the \\( and \\) around your
regular expression for you, so you end up with:

^\\(From\\|To\\|Cc\\|Reply-to\\):\\s-*.*\\(\\(abc\\.com\\|def\\.com\\)\\)$

The extra () grouping shouldn't be too big of a problem, but that $
might... If you are replying to someone and their email address looks like:

To: William M. Perry <wmperry@abc.com>

It won't match because of the '>' at the end of the line.  If you sent to
just wmperry@abc.com it would probably work.

It looks like you need to construct your regular expression so that it
includes things _after_ the email address as well.

What if you use:

\\(abc\\|def\\)\\.com.*

This is all just from a quick perusal of the header-action.el code -
don't sue me if I'm wrong. :)

-bp
-- 
Ceterum censeo vi esse delendam


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

* Re: header-action.el related.
  2001-06-22  1:47 header-action.el related Jinhyok Heo
  2001-06-22  3:07 ` William M. Perry
@ 2001-06-23  6:54 ` Jinhyok Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Jinhyok Heo @ 2001-06-23  6:54 UTC (permalink / raw)


>>>>> "JH" == Jinhyok Heo <novembre@ournature.org> writes:

    JH> Hi,
    JH> I want to use different signature depending on some header,
    JH> e.g. To or From. And I found header-action.el would satisfy
    JH> me. But I got some problem with regexp. Help me!

I solve the problem with socha's .gnus (http://gnus.socha.net/dotgnus.html).
"Posting Styles" and "signatures by Jonas Luser" parts helped me out.
I can now use different signatures depending on some conditions.

Recently, I got falling in love with amazing gnus... :-)

Bye,

-- 
|  Jinhyok Heo            mailto : novembre @ournature.org
|                         whoami : <http://ournature.org/~novembre/>
|  "We are still reaching for the sky. In the developed countries people
|  are coming back down, saying, `It's empty up there.'" --- a Ladakhi monk


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

end of thread, other threads:[~2001-06-23  6:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-22  1:47 header-action.el related Jinhyok Heo
2001-06-22  3:07 ` William M. Perry
2001-06-23  6:54 ` Jinhyok Heo

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).