Article View: gnu.emacs.vm.bug
Article #9450Re: a different header
From: Noah Friedman
Date: Fri, 09 Aug 1991 19:44
Date: Fri, 09 Aug 1991 19:44
75 lines
3523 bytes
3523 bytes
In article <9108091912.AA20333@wendy-fate.UU.NET> kyle@uunet.UU.NET (Kyle Jones) writes:
>> In article <9108091624.AA06759@wendy-fate.UU.NET> kyle@uunet.UU.NET (Kyle Jones) writes:
>> From the 5.31 -> 5.32 CHANGES list:
>> * axed the Full-Name header.
>> Why? I thought it was a nice idea. :-(
>
>So did I, but too many people complained about it, and not enough
>spoke up in favor of it. I can add it again as a variable
>option, similar to the vm-mail-header-from variable that VM 5.32
>has, which controls the contents of the From header on outbound
>mail.
IMHO, something this trivial should simply be performed by the
mail-setup-hook. I use the following two functions:
;; From: mike-w@cs.aukuni.ac.nz (Mike Williams)
;; Date: 8 Apr 91 16:20:41 GMT
;;
;; If you want make sure that one (and only one) "Full-Name" field gets
;; added to all your mail, do something like:
;;
;; (setq mail-setup-hook
;; '(lambda ()
;; (mail-add-header "Full-Name" (user-full-name))
;; ;; ... and the rest ...
;; ))
;;
;; And for those of you who are bugged by the header:
;;
;; (setq mail-setup-hook
;; '(lambda ()
;; (mail-remove-header "Full-Name")
;; ;; ... and the rest ...
;; ))
;; ----------
(defun mail-add-header (HEADER CONTENTS &optional REPLACE)
"Add the specified HEADER to the current mail message, with the given
CONTENTS.
If the header already exists, the contents are left unchanged, unless optional
argument REPLACE is non-nil."
(save-excursion
(let ((header-exists (mail-position-on-field HEADER)))
;; Delete old contents if REPLACE is set
(if (and header-exists REPLACE)
(let ((end (point))
(beg (progn
(re-search-backward (concat HEADER ": "))
(goto-char (match-end 0)))))
(delete-region beg end)))
;; Add new contents if REPLACE is set, or this is a new header.
(if (or (not header-exists) REPLACE)
(progn (insert CONTENTS) CONTENTS)))))
;; ----------
(defun mail-remove-header (HEADER)
"Remove the specified HEADER from the current mail message."
(save-excursion
(if (mail-position-on-field HEADER 'soft)
(let ((end (point))
(beg (progn
(re-search-backward (concat HEADER ": "))
(goto-char (match-beginning 0)))))
(delete-region beg (1+ end))))))
People who really want the Full-Name header probably want it in all of
their mail. You could just do
(setq mail-setup-hook
'(lambda ()
(mail-add-header "Full-Name" (user-full-name))))
---
Noah Friedman
friedman@gnu.ai.mit.edu
Technical Details
Message-ID:
<FRIEDMAN.91Aug9154449@nutrimat.gnu.ai.mit.edu>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!dali.cs.montana.edu!mintaka!ai-lab!life.ai.mit.edu!friedmanReferences:
<9108091624.AA06759@wendy-fate.UU.NET> <JAYB.91Aug8171109@qsun.ATT.Com> <JBW.91Aug9123519@maverick.uswest.com> <9108091912.AA20333@wendy-fate.UU.NET>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f6829,b970bc627d1acc62 X-Google-Attributes: gidf6829,public X-Google-ArrivalTime: 1991-08-09 16:06:47 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!dali.cs.montana.edu!mintaka!ai-lab!life.ai.mit.edu!friedman From: friedman@nutrimat.gnu.ai.mit.edu (Noah Friedman) Newsgroups: gnu.emacs.vm.bug Subject: Re: a different header Message-ID: <FRIEDMAN.91Aug9154449@nutrimat.gnu.ai.mit.edu> Date: 9 Aug 91 19:44:49 GMT References: <9108091624.AA06759@wendy-fate.UU.NET> <JAYB.91Aug8171109@qsun.ATT.Com> <JBW.91Aug9123519@maverick.uswest.com> <9108091912.AA20333@wendy-fate.UU.NET> Sender: news@ai.mit.edu Organization: Free Software Foundation, 675 Mass Ave. Cambridge, MA 02139 Lines: 75 In-reply-to: kyle@uunet.UU.NET's message of 9 Aug 91 19:12:08 GMT