Gnus development mailing list
 help / color / mirror / Atom feed
From: David Kagedal <davidk@lysator.liu.se>
Cc: ding@gnus.org
Subject: Posting profiles
Date: 21 Jan 2000 15:55:37 +0100	[thread overview]
Message-ID: <r9puuvfp92.fsf_-_@shs4.idasys.se> (raw)
In-Reply-To: john s jacobs anderson's message of "21 Jan 2000 07:38:26 -0700"

john s jacobs anderson <jacobs@genehack.org> writes:

> * "posting profiles" ideally accessible from a popup menu; allowing
>   choice between predefined profiles of
>   from,name,organization,etc. Example: I'm at home, but need to reply
>   to a work mail; i can hit 'R', then use this command to switch to my
>   'work' profile for purposes of this one reply. (This might already
>   be possible with current Gnus, but I don't think so.)

I use the following.  I read mail at work using to IMAP servers and
constantly send mail from different addresses.  When replying it
guesses the profile, but otherwise it asks who who I want to be this
time.

(defconst message-profiles
  '((idasys
     (user-mail-address . "david.kagedal@idasys.se")
     (message-signature . "David Kågedal, Ida Systems\n"))
    (lysator
     (user-mail-address . "davidk@lysator.liu.se")
     (message-signature . "David Kågedal"))))

(defvar message-profile nil)
    
(defun set-message-profile (profile)
  (let ((profile (cdr (assq profile message-profiles))))
    (if profile
	(progn
	  (mapcar (function (lambda (v)
			      (let ((var (car v))
				    (val (cdr v)))
				(make-local-variable var)
				(set var val))))
		  profile)
	  (make-local-variable 'message-profile)
	  (setq message-profile profile))
      (error "unknown profile: %S" profile))))

(defun read-message-profile (prompt &optional default)
  (let ((table (mapcar (function (lambda (x)
				   (list (symbol-name (car x)))))
		       message-profiles)))
    (intern (completing-read prompt table nil t default))))
					 

(defun dk-select-message-profile ()
  (unless message-profile
    (let ((to (message-fetch-reply-field "to"))
	  profile)
      (set-message-profile (cond ((null to)
				  (read-message-profile "Profile: "))
				 ((string-match "@idasys.se" to)
				  'idasys)
				 ((string-match "@lysator.liu.se" to)
				  'lysator)
				 (t
				  (read-message-profile "Profile: ")))))))

(add-hook 'message-signature-setup-hook 'dk-select-message-profile)


I also use this to add a BCC:

(defun dk-add-bcc ()
  (goto-char (point-max))
  (insert "Bcc: " user-mail-address "\n"))

(add-hook 'message-header-setup-hook 'dk-add-bcc)


-- 
David Kågedal




  reply	other threads:[~2000-01-21 14:55 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <wtnn1pzpw2z.fsf@licia.dtek.chalmers.se>
2000-01-21 12:55 ` Wishlist for oGnus Kai Großjohann
2000-01-21 14:40   ` Editing articles in read-only backends (was: Wishlist for oGnus) Toby Speight
2000-01-21 14:43   ` Wishlist for oGnus David Z. Maze
2000-01-22 15:18     ` Alexandre Oliva
2000-01-23 15:58       ` Group parameters and splitting (Was: Re: Wishlist for oGnus) David Z. Maze
2000-01-21 14:45   ` MML editing improvements (was: " Toby Speight
2000-02-02  2:49   ` Wishlist for oGnus Rob Browning
2000-01-21 14:17 ` Robert Epprecht
2000-01-21 21:27   ` Kai Großjohann
2000-10-29 23:00   ` nnfolder NOV (was: Wishlist for oGnus) ShengHuo ZHU
2000-10-30  2:49     ` Dan Christensen
2000-10-30  3:35       ` ShengHuo ZHU
2000-10-30  4:05         ` Dan Christensen
2000-01-21 14:38 ` Wishlist for oGnus john s jacobs anderson
2000-01-21 14:55   ` David Kagedal [this message]
2000-01-21 15:00     ` Posting profiles john s jacobs anderson
2000-01-21 15:08   ` Wishlist for oGnus Alan Shutko
2000-01-21 15:22   ` Didier Verna
2000-01-21 16:15 ` Karl Kleinpaste
2000-01-21 16:46   ` Alan Shutko
2000-01-21 18:25   ` Michael Cook
2000-01-21 21:33   ` Kai Großjohann
2000-02-02 16:01   ` lconrad
2000-02-09 16:44     ` Alf-Ivar Holm
2000-01-22  2:44 ` Stainless Steel Rat
2000-01-22 15:12   ` Doug Bagley
2000-01-23 23:26   ` John Prevost
2000-01-27 17:42 ` Raja R Harinath
     [not found] ` <wtnu2k7e4by.fsf@licia.dtek.chalmers.se>
2000-01-31  1:45   ` Justin Sheehy
2000-01-31 12:23 ` Steinar Bang
2000-01-31 22:32   ` Andrew J Cosgriff
2000-02-01 11:01   ` Andi Hechtbauer
2000-02-02 21:04 ` Andreas Fuchs
2000-02-04 11:06 ` Steinar Bang
2000-02-04 13:32   ` David Kagedal
2000-02-04 15:31     ` Simon Josefsson
2000-02-04 20:06     ` IMAP server hierarchy as topics Steinar Bang
2000-02-04 22:46       ` David Kagedal
2000-02-05  2:14         ` John Prevost
2000-02-14 16:37     ` Steinar Bang
2000-02-15 10:29       ` David Kagedal
2000-02-15 14:32       ` David Kagedal
2000-02-15 14:43         ` David Kagedal
2000-02-15 18:42         ` Arnd Kohrs
2000-02-16 12:26           ` David Kågedal
2000-02-16 14:56         ` Steinar Bang
2000-02-16 15:42           ` David Kågedal
2000-02-15 15:26       ` Chris Richards
2000-02-15 16:47         ` IMAP extra headers (was: IMAP server hierarchy as topics) Toby Speight
2000-02-19  2:36         ` IMAP server hierarchy as topics Justin Sheehy
2000-02-19  3:58           ` Chris Richards
2000-02-19 12:24             ` Simon Josefsson
2000-02-11 19:31   ` Wishlist for oGnus Anders Melchiorsen
2000-02-11 21:29     ` Kai Großjohann
2000-02-14 12:06       ` Multiple view interface (Re: Wishlist for oGnus) Anders Melchiorsen
2000-05-11 14:50     ` Wishlist for oGnus Kim-Minh Kaplan

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=r9puuvfp92.fsf_-_@shs4.idasys.se \
    --to=davidk@lysator.liu.se \
    --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).