X-Git-Url: https://cgit.sxemacs.org/?p=gnus;a=blobdiff_plain;f=lisp%2Fmm-uu.el;h=4197b2aa54ae3b200f714bc52f42d45574ecf799;hp=0cf3730d0955ba70fe6b016669f5996da69b0640;hb=HEAD;hpb=afbf528d6fb2fdb90f56a50212e46178b869a28b diff --git a/lisp/mm-uu.el b/lisp/mm-uu.el index 0cf3730d0..4197b2aa5 100644 --- a/lisp/mm-uu.el +++ b/lisp/mm-uu.el @@ -1,6 +1,6 @@ ;;; mm-uu.el --- Return uu stuff as mm handles -;; Copyright (C) 1998-2012 Free Software Foundation, Inc. +;; Copyright (C) 1998-2016 Free Software Foundation, Inc. ;; Author: Shenghuo Zhu ;; Keywords: postscript uudecode binhex shar forward gnatsweb pgp @@ -118,7 +118,7 @@ This can be either \"inline\" or \"attachment\".") mm-uu-shar-extract) (forward ;; Thanks to Edward J. Sabol and - ;; Peter von der Ah\'e + ;; Peter von der Ahé "^-+ \\(Start of \\)?Forwarded message" "^-+ End \\(of \\)?forwarded message" mm-uu-forward-extract @@ -523,7 +523,8 @@ apply the face `mm-uu-extract'." (when (and mml2015-use (null (mml2015-clear-verify-function))) (mm-set-handle-multipart-parameter mm-security-handle 'gnus-details - (format "Clear verification not supported by `%s'.\n" mml2015-use))) + (gnus-format-message + "Clear verification not supported by `%s'.\n" mml2015-use))) (mml2015-extract-cleartext-signature)) (list (mm-make-handle buf mm-uu-text-plain-type))))) @@ -673,22 +674,34 @@ value of `mm-uu-text-plain-type'." (goto-char text-start) (re-search-forward "." start-point t))) (push - (mm-make-handle (mm-uu-copy-to-buffer text-start start-point) - mm-uu-text-plain-type) + (mm-make-handle + (mm-uu-copy-to-buffer + text-start + ;; A start-separator is likely accompanied by + ;; a leading newline. + (if (and (eq (char-before start-point) ?\n) + (eq (char-before (1- start-point)) ?\n)) + (1- start-point) + start-point)) + mm-uu-text-plain-type) result)) (push (funcall (mm-uu-function-extract entry)) result) (goto-char (setq text-start end-point)))) (when result - (if (and (> (point-max) (1+ text-start)) - (save-excursion - (goto-char text-start) - (re-search-forward "." nil t))) - (push - (mm-make-handle (mm-uu-copy-to-buffer text-start (point-max)) - mm-uu-text-plain-type) - result)) + (goto-char text-start) + (when (re-search-forward "." nil t) + (push (mm-make-handle + (mm-uu-copy-to-buffer + ;; An end-separator is likely accompanied by + ;; a trailing newline. + (if (eq (char-after text-start) ?\n) + (1+ text-start) + text-start) + (point-max)) + mm-uu-text-plain-type) + result)) (setq result (cons "multipart/mixed" (nreverse result)))) result))) @@ -758,4 +771,8 @@ Assume text has been decoded if DECODED is non-nil." (provide 'mm-uu) +;; Local Variables: +;; coding: utf-8 +;; End: + ;;; mm-uu.el ends here