~ubuntu-branches/ubuntu/karmic/emacs-snapshot/karmic

« back to all changes in this revision

Viewing changes to lisp/gnus/mml.el

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2009-04-05 09:14:30 UTC
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: james.westby@ubuntu.com-20090405091430-nw07lynn2arotjbe
Tags: upstream-20090320
ImportĀ upstreamĀ versionĀ 20090320

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
;;; mml.el --- A package for parsing and validating MML documents
2
2
 
3
3
;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
4
 
;;   2007, 2008  Free Software Foundation, Inc.
 
4
;;   2007, 2008, 2009  Free Software Foundation, Inc.
5
5
 
6
6
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
7
7
;; This file is part of GNU Emacs.
482
482
                 (setq charset nil
483
483
                       coding nil))
484
484
                (charset
485
 
                 (setq charset (intern (downcase charset)))))
 
485
                 ;; The value of `charset' might be a bogus alias that
 
486
                 ;; `mm-charset-synonym-alist' provides, like `utf8',
 
487
                 ;; so we prefer the MIME charset that Emacs knows for
 
488
                 ;; the coding system `coding'.
 
489
                 (setq charset (or (mm-coding-system-to-mime-charset coding)
 
490
                                   (intern (downcase charset))))))
486
491
          (if (and (not raw)
487
492
                   (member (car (split-string type "/")) '("text" "message")))
488
493
              (progn
893
898
      (unless (setq textp (equal (mm-handle-media-supertype handle) "text"))
894
899
        (save-excursion
895
900
          (set-buffer (setq buffer (mml-generate-new-buffer " *mml*")))
896
 
          (mm-insert-part handle 'no-cache)
897
 
          (if (setq mmlp (equal (mm-handle-media-type handle)
898
 
                                "message/rfc822"))
899
 
              (mime-to-mml)))))
 
901
          (if (eq (mail-content-type-get (mm-handle-type handle) 'charset)
 
902
                  'gnus-decoded)
 
903
              ;; A part that mm-uu dissected from a non-MIME message
 
904
              ;; because of `gnus-article-emulate-mime'.
 
905
              (progn
 
906
                (mm-enable-multibyte)
 
907
                (insert-buffer-substring (mm-handle-buffer handle)))
 
908
            (mm-insert-part handle 'no-cache)
 
909
            (if (setq mmlp (equal (mm-handle-media-type handle)
 
910
                                  "message/rfc822"))
 
911
                (mime-to-mml))))))
900
912
    (if mmlp
901
913
        (mml-insert-mml-markup handle nil t t)
902
914
      (unless (and no-markup
1284
1296
    (unless (message-in-body-p) (goto-char (point-max)))
1285
1297
    (mml-insert-empty-tag 'part
1286
1298
                          'type type
1287
 
                          'filename file
 
1299
                          ;; icicles redefines read-file-name and returns a
 
1300
                          ;; string w/ text properties :-/
 
1301
                          'filename (mm-substring-no-properties file)
1288
1302
                          'disposition (or disposition "attachment")
1289
1303
                          'description description)))
1290
1304