X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=mime-setup.el;h=816c70875543af63f21711ec28d57e30612b56fa;hb=30643c84ac4aa5809c1fc63ef8844f1edba7dbff;hp=8936601e41b8f2ffbc9285ba666a06f2b292416c;hpb=381df96561a159ec072dc0b4936134405a5d68cd;p=elisp%2Ftm.git diff --git a/mime-setup.el b/mime-setup.el index 8936601..816c708 100644 --- a/mime-setup.el +++ b/mime-setup.el @@ -1,39 +1,56 @@ ;;; -;;; mime-setup.el --- setup file to use tm and mime.el. +;;; mime-setup.el --- setup file for tm viewer and composer. ;;; ;;; Copyright (C) 1995 Free Software Foundation, Inc. -;;; Copyright (C) 1994,1995 MORIOKA Tomohiko +;;; Copyright (C) 1994 .. 1996 MORIOKA Tomohiko ;;; ;;; Author: MORIOKA Tomohiko ;;; Version: -;;; $Id: mime-setup.el,v 7.9 1995/10/28 06:02:53 morioka Exp $ +;;; $Id: mime-setup.el,v 7.14 1996/02/14 09:15:36 morioka Exp $ ;;; Keywords: mail, news, MIME, multimedia, multilingual, encoded-word ;;; ;;; This file is part of tm (Tools for MIME). ;;; +;;; This program is free software; you can redistribute it and/or +;;; modify it under the terms of the GNU General Public License as +;;; published by the Free Software Foundation; either version 2, or +;;; (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with This program. If not, write to the Free Software +;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;;; +;;; Code: (require 'tm-setup) (autoload 'mime/editor-mode "tm-edit" "Minor mode for editing MIME message." t) - -(add-hook 'mime/editor-mode-hook - (function - (lambda () - (save-excursion - (save-restriction - (goto-char (point-min)) - (narrow-to-region - (point-min) - (if (re-search-forward - (concat "^" (regexp-quote mail-header-separator) "$") - nil t) - (match-beginning 0) - (point-max) - )) - (mime/decode-message-header) - (set-buffer-modified-p nil) - ))))) +(autoload 'mime/decode-message-header "tm-ew-d" + "Decode MIME encoded-words in message header." t) + +(defun mime-setup-decode-message-header () + (save-excursion + (save-restriction + (goto-char (point-min)) + (narrow-to-region + (point-min) + (if (re-search-forward + (concat "^" (regexp-quote mail-header-separator) "$") + nil t) + (match-beginning 0) + (point-max) + )) + (mime/decode-message-header) + (set-buffer-modified-p nil) + ))) + +(add-hook 'mime/editor-mode-hook 'mime-setup-decode-message-header) ;;; @ variables @@ -48,21 +65,18 @@ ;;; @ for signature ;;; +(defun mime-setup-set-signature-key () + (let ((key (or (cdr (assq major-mode mime-setup-signature-key-alist)) + mime-setup-default-signature-key))) + (define-key (current-local-map) key (function insert-signature)) + )) + (if mime-setup-use-signature (progn (autoload 'insert-signature "signature" "Insert signature" t) - (add-hook 'mime/editor-mode-hook - (function - (lambda () - (let ((key (or (cdr - (assq major-mode - mime-setup-signature-key-alist) - ) - mime-setup-default-signature-key))) - (define-key (current-local-map) - key (function insert-signature)) - )))) + (add-hook 'mime/editor-mode-hook 'mime-setup-set-signature-key) (setq gnus-signature-file nil) + (setq mail-signature nil) )) @@ -74,33 +88,32 @@ ) -;;; @ for RMAIL +;;; @ for RMAIL and VM ;;; -(add-hook 'mail-mode-hook 'mime/editor-mode) (add-hook 'mail-setup-hook 'mime/decode-message-header) +(add-hook 'mail-setup-hook 'mime/editor-mode 'append) (add-hook 'mail-send-hook 'mime-editor/maybe-translate) ;;; @ for mh-e ;;; -(add-hook 'mh-letter-mode-hook - (function - (lambda () - (mime/editor-mode) - (make-local-variable 'mail-header-separator) - (setq mail-header-separator "--------") - (save-excursion - (goto-char (point-min)) - (if (re-search-forward "^-*$" nil t) - (progn - (replace-match mail-header-separator) - (set-buffer-modified-p (buffer-modified-p)) - )) - ) - )) t) - +(defun mime-setup-mh-draft-setting () + (mime/editor-mode) + (make-local-variable 'mail-header-separator) + (setq mail-header-separator "--------") + (save-excursion + (goto-char (point-min)) + (setq buffer-read-only nil) + (if (re-search-forward "^-*$" nil t) + (progn + (replace-match mail-header-separator) + (set-buffer-modified-p (buffer-modified-p)) + )) + )) + +(add-hook 'mh-letter-mode-hook 'mime-setup-mh-draft-setting t) (add-hook 'mh-before-send-letter-hook 'mime-editor/maybe-translate) @@ -117,3 +130,5 @@ (provide 'mime-setup) (run-hooks 'mime-setup-load-hook) + +;;; mime-setup.el ends here