(mime-calist::field-match-method-ignore-case):
[elisp/semi.git] / mime-edit.el
index 7c6c134..0e79ba6 100644 (file)
@@ -24,8 +24,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -1792,6 +1792,13 @@ Parameter must be '(PROMPT CHOICE1 (CHOICE2...))."
 
 (defvar mime-edit-pgp-user-id nil)
 
+(defun mime-edit-delete-trailing-whitespace ()
+  (save-match-data
+    (save-excursion
+      (goto-char (point-min))
+      (while (re-search-forward "[ \t]+$" nil t)
+       (delete-region (match-beginning 0) (match-end 0))))))
+
 (defun mime-edit-sign-pgp-mime (beg end boundary)
   (save-excursion
     (save-restriction
@@ -1803,6 +1810,7 @@ Parameter must be '(PROMPT CHOICE1 (CHOICE2...))."
             (encoding (nth 1 ret))
             (pgp-boundary (concat "pgp-sign-" boundary))
             micalg)
+       (mime-edit-delete-trailing-whitespace) ; RFC3156
        (goto-char beg)
        (insert (format "Content-Type: %s\n" ctype))
        (if encoding
@@ -1813,7 +1821,8 @@ Parameter must be '(PROMPT CHOICE1 (CHOICE2...))."
                   (or mime-edit-pgp-user-id
                       (if from 
                           (nth 1 (std11-extract-address-components from))
-                        pgg-default-user-id))))
+                        pgg-default-user-id)))
+                 (pgg-text-mode t))
              (pgg-sign-region (point-min)(point-max)))
            (throw 'mime-edit-error 'pgp-error)
            )
@@ -1904,7 +1913,8 @@ Content-Transfer-Encoding: 7bit
                     (or mime-edit-pgp-user-id
                         (if from 
                             (nth 1 (std11-extract-address-components from))
-                          pgg-default-user-id))))                   
+                          pgg-default-user-id)))
+                   (pgg-text-mode t))
                (pgg-encrypt-region 
                 (point-min) (point-max) 
                 (mapcar (lambda (recipient)
@@ -2733,6 +2743,7 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n"
 ;;;
 
 (defvar mime-edit-buffer nil) ; buffer local variable
+(defvar mime-edit-temp-message-buffer nil) ; buffer local variable
 
 (defun mime-edit-preview-message ()
   "preview editing MIME message."