X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fmm-decode.el;h=891843424fd7fcd01bfeb624fa2565123587c843;hb=5beb390633ce1e32cdf319c6ba19926244bbfdf2;hp=03bcaa15ff49ce6d40a05490c6e9339a284ac7f7;hpb=bde91281671310cfab90dfea4efa1202cbf7f25b;p=gnus diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index 03bcaa15f..891843424 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -1,6 +1,6 @@ ;;; mm-decode.el --- Functions for decoding MIME things -;; Copyright (C) 1998-2012 Free Software Foundation, Inc. +;; Copyright (C) 1998-2012 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen ;; MORIOKA Tomohiko @@ -659,6 +659,15 @@ Postpone undisplaying of viewers for types in (if (equal "text/plain" (car ctl)) (assoc 'format ctl) t)) + ;; Guess what the type of application/octet-stream parts should + ;; really be. + (let ((filename (cdr (assq 'filename (cdr cdl))))) + (when (and (equal (car ctl) "application/octet-stream") + filename + (string-match "\\.\\([^.]+\\)$" filename)) + (let ((new-type (mailcap-extension-to-mime (match-string 1 filename)))) + (when new-type + (setcar ctl new-type))))) (let ((handle (mm-make-handle (mm-copy-to-buffer) ctl cte nil cdl description nil id)) @@ -1499,7 +1508,7 @@ be determined." (let ((image (mm-get-image handle))) (or (not image) (if (featurep 'xemacs) - ;; XEmacs' glyphs can actually tell us about their width, so + ;; XEmacs's glyphs can actually tell us about their width, so ;; let's be nice and smart about them. (or mm-inline-large-images (and (<= (glyph-width image) (window-pixel-width)) @@ -1763,6 +1772,10 @@ If RECURSIVE, search recursively." (string-to-number (match-string 2))) mm-extra-numeric-entities))) (replace-match (char-to-string char)))) + ;; Remove "soft hyphens". + (goto-char (point-min)) + (while (search-forward "­" nil t) + (replace-match "" t t)) (libxml-parse-html-region (point-min) (point-max)))) (unless (bobp) (insert "\n"))