From: Hans de Graaff <graaff@xs4all.nl>
Subject: Re: Header dependant headers?
Date: 21 Mar 1998 20:21:11 +0100 [thread overview]
Message-ID: <877m5nyhnc.fsf@graaff.xs4all.nl> (raw)
In-Reply-To: Edvard Majakari's message of "16 Mar 1998 14:16:59 +0200"
Edvard Majakari <ed@a41a.otanner.ton.tut.fi> writes:
> Works fine, yep; but that won't allow me to include custom Reply-To
> header when answering mails in that group. I'd need one for my work,
> so I think I just have to write a hook for that, and call it from
> Group Parameters?
I use the following, which kinda works but also has some problems. I
originally got something like it from the newsgroup, but I forgot to
save the name. Since then I've ripped it apart myself to better suit
what I wanted.
Comments, etc, are welcome. I'm not a lisp hacker by any standard, but
I would like to see some kind of customization of all headers
based on characteristics. (In my case below the group I'm in).
Which reminds me: Lars, there is only an nnml-current-group, but there
is no such thing for nntp groups. Shouldn't there be a
gnus-current-group variable?
Hans
;; JJDG: Got this off of gnu.emacs.gnus, not sure who wrote it...
;; Hacked it so that naming is more safe, ripped out signature stuff,
;; since I don't need it, and also allow outgoing mail to be customized
;; based on To: header.
(setq jjdg-postspecs
'(("mail.forum" .
((headers . "Reply-To: forum@graaff.xs4all.nl\nOrganization: Forum Distribution, Main Branch\n"))
)
("\\(list\\.\\(chi\\.\\|ui-patterns\\).*\\|mail\\.acm\\..*\\)" .
((headers . "From: Hans de Graaff <j.j.degraaff@acm.org>\n")))
(t .
((headers . "From: Hans de Graaff <graaff@xs4all.nl>\n")))
))
(defun jjdg-find-postspec (speclist groups)
(cond ((null speclist) nil)
((null groups) (cdr-safe (assq t speclist)))
(t (let ((spec (car speclist)))
(if (or (eq t (car spec)) (string-match (car spec) groups))
(cdr spec)
(jjdg-find-postspec (cdr speclist) groups))))
))
(defun jjdg-electric-from (header-alist)
; (let* ((groups (or (cdr-safe (assq 'Newsgroups header-alist))
; (cdr-safe (assq 'To header-alist))))
(let* ((groups nnml-current-group)
(postspec (jjdg-find-postspec jjdg-postspecs groups))
(headers (cdr-safe (assq 'headers postspec))))
(if headers
(save-excursion
(goto-char (point-min))
(insert headers)))
))
(add-hook 'message-signature-setup-hook
(lambda () (jjdg-electric-from headers)))
next prev parent reply other threads:[~1998-03-21 19:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-03-13 12:44 Edvard Majakari
1998-03-13 23:21 ` Paul Franklin
1998-03-16 12:16 ` Edvard Majakari
1998-03-21 19:21 ` Hans de Graaff [this message]
1998-03-23 13:23 ` Lars Magne Ingebrigtsen
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=877m5nyhnc.fsf@graaff.xs4all.nl \
--to=graaff@xs4all.nl \
/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).