From: wmperry@gnu.org (William M. Perry)
Cc: ding@gnus.org
Subject: Re: header-action.el related.
Date: 21 Jun 2001 22:07:34 -0500 [thread overview]
Message-ID: <86g0ctkya1.fsf@hel.bp.aventail.com> (raw)
In-Reply-To: <m3hex9l1yw.fsf@ournature.org> (Jinhyok Heo's message of "22 Jun 2001 10:47:51 +0900")
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
next prev parent reply other threads:[~2001-06-22 3:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-22 1:47 Jinhyok Heo
2001-06-22 3:07 ` William M. Perry [this message]
2001-06-23 6:54 ` Jinhyok Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86g0ctkya1.fsf@hel.bp.aventail.com \
--to=wmperry@gnu.org \
--cc=ding@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).