* gnus-sum.el (gnus-summary-expire-articles): Save excursion.
[gnus] / lisp / mm-decode.el
index 5893a70..786a3be 100644 (file)
 
 (eval-and-compile
   (autoload 'mm-inline-partial "mm-partial")
-  (autoload 'mm-inline-external-body "mm-extern"))
+  (autoload 'mm-inline-external-body "mm-extern")
+  (autoload 'mm-insert-inline "mm-view"))
 
 (defgroup mime-display ()
   "Display of MIME in mail and news articles."
   :link '(custom-manual "(emacs-mime)Customization")
+  :version "21.1"
   :group 'mail
   :group 'news
   :group 'multimedia)
@@ -250,7 +252,7 @@ to:
     ("application/x-pkcs7-signature" mml-smime-verify "S/MIME" 
      mml-smime-verify-test)))
 
-(defcustom mm-verify-option nil
+(defcustom mm-verify-option 'never
   "Option of verifying signed parts.
 `never', not verify; `always', always verify; 
 `known', only verify known protocols. Otherwise, ask user."
@@ -287,6 +289,15 @@ to:
 ;; Should we bind other key to minibuffer-complete-word?
 (define-key mm-viewer-completion-map " " 'self-insert-command) 
 
+(defvar mm-viewer-completion-map
+  (let ((map (make-sparse-keymap 'mm-viewer-completion-map)))
+    (set-keymap-parent map minibuffer-local-completion-map)
+    map)
+  "Keymap for input viewer with completion.")
+
+;; Should we bind other key to minibuffer-complete-word?
+(define-key mm-viewer-completion-map " " 'self-insert-command) 
+
 ;;; The functions.
 
 (defun mm-alist-to-plist (alist)
@@ -397,7 +408,7 @@ The original alist is not modified.  See also `destructive-alist-to-plist'."
                    (match-beginning 0)
                  (point-max)))))
     (setq boundary (concat (regexp-quote boundary) "[ \t]*$"))
-    (while (re-search-forward boundary end t)
+    (while (and (< (point) end) (re-search-forward boundary end t))
       (goto-char (match-beginning 0))
       (when start
        (save-excursion
@@ -406,7 +417,7 @@ The original alist is not modified.  See also `destructive-alist-to-plist'."
            (setq parts (nconc (list (mm-dissect-buffer t)) parts)))))
       (forward-line 2)
       (setq start (point)))
-    (when start
+    (when (and start (< start end))
       (save-excursion
        (save-restriction
          (narrow-to-region start end)
@@ -1008,6 +1019,7 @@ If RECURSIVE, search recursively."
     result))
 
 (defvar mm-security-handle nil)
+(defvar mm-security-from nil)
 
 (defsubst mm-set-handle-multipart-parameter (handle parameter value)
   ;; HANDLE could be a CTL.
@@ -1018,6 +1030,11 @@ If RECURSIVE, search recursively."
 (defun mm-possibly-verify-or-decrypt (parts ctl)
   (let ((subtype (cadr (split-string (car ctl) "/")))
        (mm-security-handle ctl) ;; (car CTL) is the type.
+       (mm-security-from
+        (save-restriction
+          (mail-narrow-to-head)
+          (cadr (mail-extract-address-components 
+                 (or (mail-fetch-field "from") "")))))
        protocol func functest)
     (cond 
      ((equal subtype "signed")