Article View: gnu.emacs.vm.bug
Article #9469auto-signature and vm-forward crud removal patch
From: J. Chris Coppick
Date: Wed, 28 Aug 1991 21:13
Date: Wed, 28 Aug 1991 21:13
118 lines
4715 bytes
4715 bytes
Here's a patch for VM 5.31 (vm-vars.el and vm-reply.el) which
does two things:
1) Adds a vm-auto-sign variable which controls whether or not
your signature file gets included automatically when you
send a message using C-c C-c. See the variable documentation
for details.
2) Adds a quick hack to remove the X-VM-V5-Data: header from
messages that you forward. I'm not seriously "into" the
VM code, so I have no idea whether or not this has been
done in the most favorable way or even whether or not this
breaks anything else. It's just two extra lines of code and
it seems to work.
-- Chris
################################################
*** vm-vars.el.orig Wed Aug 7 10:02:16 1991
--- vm-vars.el Wed Aug 28 17:08:22 1991
***************
*** 15,20 ****
--- 15,28 ----
;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ ;;; 08/07/91 - Automatic signature modifications added by
+ ;;; J. Chris Coppick, Mitre Corp.
+
+ (defvar vm-auto-sign nil
+ "*If true, then automatically append ~/.signature when message
+ is sent using C-c C-c. If set to a string (i.e. '~/Mail/.sig') then
+ try appending that file instead of ~/.signature.")
+
(defvar vm-primary-inbox "~/INBOX"
"*Mail is moved from the system mailbox to this file for reading.")
*** vm-reply.el.orig Wed Aug 7 14:18:50 1991
--- vm-reply.el Wed Aug 28 16:56:33 1991
***************
*** 15,20 ****
--- 15,27 ----
;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ ;;; 08/07/91 - Automatic signature modifications added by
+ ;;; J. Chris Coppick, The Mitre Corporation
+
+ ;;; 08/28/91 - Modified vm-forward to remove the ugly X-VM-V5-Data header
+ ;;; from forwarded mail.
+ ;;; J. Chris Coppick, The Mitre Corporation
+
(require 'vm)
(defun vm-do-reply (to-all include-text count)
***************
*** 108,113 ****
--- 115,121 ----
(local-set-key "\C-cy" 'vm-yank-message-other-folder)
(local-set-key "\C-c\C-s" 'vm-mail-send)
(local-set-key "\C-c\C-c" 'vm-mail-send-and-exit)
+ (local-set-key "\C-c\C-w" 'vm-mail-signature)
(local-set-key "\C-c\C-v" vm-mode-map)
(make-local-variable 'vm-reply-list)
(setq vm-mail-buffer mail-buffer
***************
*** 258,263 ****
--- 266,280 ----
as having been replied to, if appropriate."
(interactive "P")
(let ((reply-buf (current-buffer)))
+ ; Maybe sign the letter...
+ (if vm-auto-sign
+ (let ()
+ (interactive)
+ (save-excursion
+ (goto-char (point-max))
+ (if (stringp vm-auto-sign)
+ (insert-file-contents (expand-file-name vm-auto-sign))
+ (insert-file-contents (expand-file-name "~/.signature"))))))
(mail-send-and-exit arg)
(save-excursion
(set-buffer reply-buf)
***************
*** 288,293 ****
--- 305,320 ----
((eq vm-system-state 'forwarding)
(vm-mark-forwarded))))
+ (defun vm-mail-signature ()
+ "Just like mail-signature except check vm-auto-sign var for alternative
+ signature file."
+ (interactive)
+ (save-excursion
+ (goto-char (point-max))
+ (if (stringp vm-auto-sign)
+ (insert-file-contents (expand-file-name vm-auto-sign))
+ (insert-file-contents (expand-file-name "~/.signature")))))
+
(defun vm-rename-current-mail-buffer ()
(if (not (string-match "^sent " (buffer-name)))
(let (prefix name n)
***************
*** 438,443 ****
--- 465,475 ----
(if vm-rfc934-forwarding
(vm-rfc934-char-stuff-region start (point)))
(insert "------- End of forwarded message -------\n")
+
+ ; remove X-VM-... header junk from forwarded message
+ (goto-char (point-min))
+ (delete-matching-lines vm-attributes-header-regexp)
+
(goto-char (point-min))
(end-of-line)))))
Technical Details
Message-ID:
<jcc.683413981@starbase>Path:
arc1-ca.pugleaf.net!gmdzi!unido!math.fu-berlin.de!iraun1.ira.uka.de!sol.ctr.columbia.edu!spool.mu.edu!agate!linus!linus!starbase!jccShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f6829,54fbd95d133e8792,start X-Google-Attributes: gidf6829,public X-Google-ArrivalTime: 1991-08-28 22:02:17 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!math.fu-berlin.de!iraun1.ira.uka.de!sol.ctr.columbia.edu!spool.mu.edu!agate!linus!linus!starbase!jcc From: jcc@mungo.mitre.org (J. Chris Coppick) Newsgroups: gnu.emacs.vm.bug Subject: auto-signature and vm-forward crud removal patch Message-ID: <jcc.683413981@starbase> Date: 28 Aug 91 21:13:01 GMT Sender: news@linus.mitre.org (News Service) Distribution: gnu Organization: The MITRE Corporation Lines: 118 Nntp-Posting-Host: mungo.mitre.org