From: yamaoka Date: Sun, 14 Dec 2003 23:01:23 +0000 (+0000) Subject: merge from flim-1_14 branch. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=ed6a5cd204a38dfdff2dc54257ffc206c1dcf421;p=elisp%2Fflim.git merge from flim-1_14 branch. --- diff --git a/ChangeLog b/ChangeLog index da932c4..50e9448 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2003-12-14 MORIOKA Tomohiko + + * mime-def.el (mime-header-accept-quoted-encoded-words): Change + default value to nil. + +2003-03-10 MORIOKA Tomohiko + + * eword-decode.el (eword-analyze-quoted-string): Decode + quoted-encoded-words when + `mime-header-accept-quoted-encoded-words' is not nil. + + * mime.el (mime-entity-filename): Decode quoted-encoded-words when + `mime-header-accept-quoted-encoded-words' is not nil. + + * mime-def.el (mime-header-accept-quoted-encoded-words): New user + option. + 2003-12-14 Tatsuya Kinoshita * eword-encode.el (mime-header-charset-encoding-alist): Add diff --git a/VERSION b/VERSION index 745aab0..67f4fd5 100644 --- a/VERSION +++ b/VERSION @@ -57,9 +57,10 @@ ;;------------------------------------------------------------------------- ;; Keihan Electric Railway $(B5~:eEE5$E4F;(B http://www.keihan.co.jp/ -;; $(B3{El@~(B +;; -DÒtò-A Line $(B3{El@~(B ;;------------------------------------------------------------------------- 1.14.5 Demachiyanagi $(B=PD.Lx(B ; <=> $(B1CEE(B +1.14.6 Marutamachi $(B4]B@D.(B [Chao Version names] @@ -125,7 +126,7 @@ 1.14.3 Terai-Nishikuchi $B;{0f@>8}(B 1.14.4 Jid-Dò-Asha-Renraku $B<+F0 ;; MORIOKA Tomohiko @@ -581,15 +581,17 @@ returns nil, next function is used. Otherwise the return value will be the result.") (defun eword-analyze-quoted-string (string start &optional must-unfold) - (let ((p (std11-check-enclosure string ?\" ?\" nil start))) - (if p - (cons (cons 'quoted-string - (decode-mime-charset-string - (std11-strip-quoted-pair - (substring string (1+ start) (1- p))) - default-mime-charset)) - ;;(substring string p)) - p)))) + (let ((p (std11-check-enclosure string ?\" ?\" nil start)) + ret) + (when p + (setq ret (decode-mime-charset-string + (std11-strip-quoted-pair + (substring string (1+ start) (1- p))) + default-mime-charset)) + (if mime-header-accept-quoted-encoded-words + (setq ret (eword-decode-string ret))) + (cons (cons 'quoted-string ret) + p)))) (defun eword-analyze-domain-literal (string start &optional must-unfold) (std11-analyze-domain-literal string start)) diff --git a/mime-def.el b/mime-def.el index efa1f50..c0bd527 100644 --- a/mime-def.el +++ b/mime-def.el @@ -1,6 +1,7 @@ ;;; mime-def.el --- definition module about MIME -*- coding: iso-2022-jp; -*- -;; Copyright (C) 1995,96,97,98,99,2000,2001,2002 Free Software Foundation, Inc. +;; Copyright (C) 1995,96,97,98,99,2000,2001,2002,2003 +;; Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko ;; Shuhei KOBAYASHI @@ -34,7 +35,7 @@ (eval-when-compile (require 'luna)) ; luna-arglist-to-arguments (eval-and-compile - (defconst mime-library-product ["CLIME" (1 14 5) "$BK\;{0f(B"] + (defconst mime-library-product ["CLIME" (1 14 6) "$BKv?.5mEg(B"] "Product name, version number and code name of MIME-library package.")) (defmacro mime-product-name (product) @@ -84,6 +85,12 @@ :type '(choice (integer :tag "Limit (bytes)") (const :tag "Don't limit" nil))) +(defcustom mime-header-accept-quoted-encoded-words nil + "*Accept encoded-words in quoted-strings." + :group 'mime-header + :type 'boolean) + + ;;; @@@ encoding ;;; diff --git a/mime.el b/mime.el index bcb49dc..d83aaf5 100644 --- a/mime.el +++ b/mime.el @@ -1,6 +1,6 @@ ;;; mime.el --- MIME library module -;; Copyright (C) 1998,1999,2000 Free Software Foundation, Inc. +;; Copyright (C) 1998,1999,2000,2001,2003 Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko ;; Keywords: MIME, multimedia, mail, news @@ -396,13 +396,16 @@ default value." (defun mime-entity-filename (entity) "Return filename of ENTITY." (or (mime-entity-uu-filename entity) - (mime-content-disposition-filename - (mime-entity-content-disposition entity)) + (let ((ret (mime-content-disposition-filename + (mime-entity-content-disposition entity)))) + (if (and mime-header-accept-quoted-encoded-words + ret) + (eword-decode-string ret) + ret)) (cdr (let ((param (mime-content-type-parameters (mime-entity-content-type entity)))) (or (assoc "name" param) - (assoc "x-name" param)) - )))) + (assoc "x-name" param)))))) (defsubst mime-entity-media-type (entity)