]> code.delx.au - gnu-emacs/blobdiff - lisp/mh-e/mh-mime.el
Merge from emacs--rel--22
[gnu-emacs] / lisp / mh-e / mh-mime.el
index ffe558d1a62442c0a70bb62ddc39886dd2443915..0e017074ee88e7c53d376339d474a8e86d77bda7 100644 (file)
@@ -1,7 +1,7 @@
 ;;; mh-mime.el --- MH-E MIME support
 
 ;; Copyright (C) 1993, 1995,
-;;  2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;;  2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs 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 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -21,9 +21,7 @@
 ;; GNU General Public License for more details.
 
 ;; 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., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -60,6 +58,9 @@
 (autoload 'mail-decode-encoded-word-string "mail-parse")
 (autoload 'mail-header-parse-content-type "mail-parse")
 (autoload 'mail-header-strip "mail-parse")
+(autoload 'mail-strip-quoted-names "mail-utils")
+(autoload 'message-options-get "message")
+(autoload 'message-options-set "message")
 (autoload 'message-options-set-recipient "message")
 (autoload 'mm-decode-body "mm-bodies")
 (autoload 'mm-uu-dissect "mm-uu")
@@ -1484,7 +1485,7 @@ The effects of this command can be undone by running
                        "mhn"
                        (if extra-args mh-mh-to-mime-args)
                        buffer-file-name)))
-  (revert-buffer t t)
+  (revert-buffer t t t)
   (message "Running %s...done" (if (mh-variant-p 'nmh) "mhbuild" "mhn"))
   (run-hooks 'mh-mh-to-mime-hook))
 
@@ -1530,7 +1531,7 @@ a prefix argument NOCONFIRM."
     (let ((buffer-read-only nil))
       (erase-buffer)
       (insert-file-contents backup-file))
-    (after-find-file nil)))
+    (after-find-file nil nil nil nil t)))
 
 ;; Shush compiler.
 (defvar mh-identity-pgg-default-user-id)
@@ -1618,13 +1619,14 @@ This action can be undone by running \\[undo]."
   (require 'message)
   (when mh-pgp-support-flag
     ;; PGP requires actual e-mail addresses, not aliases.
-    ;; Parse the recipients and sender from the message
+    ;; Parse the recipients and sender from the message.
     (message-options-set-recipient)
-    ;; Do an alias lookup on sender
-    (message-options-set 'message-sender
-                     (mail-strip-quoted-names
-                      (mh-alias-expand
-                       (message-options-get 'message-sender))))
+    ;; Do an alias lookup on sender (if From field is present).
+    (when (message-options-get 'message-sender)
+      (message-options-set 'message-sender
+                           (mail-strip-quoted-names
+                            (mh-alias-expand
+                             (message-options-get 'message-sender)))))
     ;; Do an alias lookup on recipients
     (message-options-set 'message-recipients
                          (mapconcat