Path: utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!att!cbnewsh!ho5cad!wjc From: wjc@ho5cad.ATT.COM (Bill Carpenter) Newsgroups: gnu.emacs Subject: Re: Annotation of Forwarded messages Message-ID: Date: 29 Jun 89 18:11:00 GMT References: <17978@sequent.UUCP> Sender: bill@cbnewsh.ATT.COM Reply-To: wjc@ho5cad.ATT.COM (Bill Carpenter) Organization: AT&T Bell Laboratories Lines: 32 In article <17978@sequent.UUCP> paulr@sequent.UUCP (Paul Reger) writes: > Does anyone know of a way to have emacs automatically enclose > forwarded messages between a set of 'pre-amble' and 'post-amble' > sections ?? Here is what I used to do back when I was an rmail user: ;; put this line in your rmail-mode-hook (define-key rmail-mode-map "F" 'wjc:rmail-Forward) ;; now, pressing "F" instead of "f" will give you a "surrounded" ;; forwarded mailgram. ;; these functions are the implementation; I'm sure I long ago took ;; this from elsewhere and molded it to my own evil intent, but I no ;; longer know whence. (defun wjc:rmail-Forward () (interactive) (rmail-forward) (wjc:forward-surround)) (defun wjc:forward-surround () (interactive) ; Highlight original message. Wrap "message follows/ends" around it. (save-excursion (save-restriction (re-search-forward (concat "^" (regexp-quote mail-header-separator) "\n")) (narrow-to-region (point) (point-max)) (insert "[\n\n]\n===== Forwarded message follows ===============\n") (goto-char (point-max)) (insert "\n===== End of forwarded message ===============\n\n"))))