;;; 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
;; 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:
(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")
"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))
(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)
(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