emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/gnus/mm-bodies.el


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/gnus/mm-bodies.el
Date: Fri, 04 Apr 2003 01:22:14 -0500

Index: emacs/lisp/gnus/mm-bodies.el
diff -c emacs/lisp/gnus/mm-bodies.el:1.6 emacs/lisp/gnus/mm-bodies.el:1.7
*** emacs/lisp/gnus/mm-bodies.el:1.6    Sun Jul 15 13:42:53 2001
--- emacs/lisp/gnus/mm-bodies.el        Fri Oct 18 06:55:38 2002
***************
*** 1,5 ****
  ;;; mm-bodies.el --- functions for decoding MIME things
! ;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
  
  ;; Author: Lars Magne Ingebrigtsen <address@hidden>
  ;;    MORIOKA Tomohiko <address@hidden>
--- 1,5 ----
  ;;; mm-bodies.el --- functions for decoding MIME things
! ;; Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
  
  ;; Author: Lars Magne Ingebrigtsen <address@hidden>
  ;;    MORIOKA Tomohiko <address@hidden>
***************
*** 56,63 ****
  (defun mm-encode-body ()
    "Encode a body.
  Should be called narrowed to the body that is to be encoded.
! If there is more than one non-ASCII MULE charset, then list of found
! MULE charsets are returned.
  If successful, the MIME charset is returned.
  If no encoding was done, nil is returned."
    (if (not (mm-multibyte-p))
--- 56,63 ----
  (defun mm-encode-body ()
    "Encode a body.
  Should be called narrowed to the body that is to be encoded.
! If there is more than one non-ASCII Mule charset, then the list of found
! Mule charsets is returned.
  If successful, the MIME charset is returned.
  If no encoding was done, nil is returned."
    (if (not (mm-multibyte-p))
***************
*** 73,80 ****
          nil))
      (save-excursion
        (goto-char (point-min))
!       (let ((charsets (mm-find-mime-charset-region (point-min) (point-max)))
!           charset)
        (cond
         ;; No encoding.
         ((null charsets)
--- 73,79 ----
          nil))
      (save-excursion
        (goto-char (point-min))
!       (let ((charsets (mm-find-mime-charset-region (point-min) (point-max))))
        (cond
         ;; No encoding.
         ((null charsets)
***************
*** 84,112 ****
          charsets)
         ;; We encode.
         (t
!         (let ((charset (car charsets))
!               start)
!           (when (or t
!                     ;; We always decode.
!                     (not (mm-coding-system-equal
!                           charset buffer-file-coding-system)))
!             (while (not (eobp))
!               (if (eq (mm-charset-after) 'ascii)
!                   (when start
!                     (save-restriction
!                       (narrow-to-region start (point))
!                       (mm-encode-coding-region
!                        start (point) (mm-charset-to-coding-system charset))
!                       (goto-char (point-max)))
!                     (setq start nil))
!                 (unless start
!                   (setq start (point))))
!               (forward-char 1))
!             (when start
!               (mm-encode-coding-region start (point)
!                                        (mm-charset-to-coding-system charset))
!               (setq start nil)))
!           charset)))))))
  
  (eval-when-compile (defvar message-posting-charset))
  
--- 83,92 ----
          charsets)
         ;; We encode.
         (t
!         (mm-encode-coding-region (point-min) (point-max)
!                                  (mm-charset-to-coding-system
!                                   (car charsets)))
!         (car charsets)))))))
  
  (eval-when-compile (defvar message-posting-charset))
  
***************
*** 133,159 ****
  
  (defun mm-body-7-or-8 ()
    "Say whether the body is 7bit or 8bit."
!   (cond
!    ((not (featurep 'mule))
!     (if (save-excursion
!         (goto-char (point-min))
!         (skip-chars-forward mm-7bit-chars)
!         (eobp))
!       '7bit
!       '8bit))
!    (t
!     ;; Mule version
!     (if (and (null (delq 'ascii
!                        (mm-find-charset-region (point-min) (point-max))))
!            ;;!!!The following is necessary because the function
!            ;;!!!above seems to return the wrong result under
!            ;;!!!Emacs 20.3.  Sometimes.
!            (save-excursion
!              (goto-char (point-min))
!              (skip-chars-forward mm-7bit-chars)
!              (eobp)))
!       '7bit
!       '8bit))))
  
  ;;;
  ;;; Functions for decoding
--- 113,124 ----
  
  (defun mm-body-7-or-8 ()
    "Say whether the body is 7bit or 8bit."
!   (if (save-excursion
!       (goto-char (point-min))
!       (skip-chars-forward mm-7bit-chars)
!       (eobp))
!       '7bit
!     '8bit))
  
  ;;;
  ;;; Functions for decoding
***************
*** 213,219 ****
  The characters in CHARSET should then be decoded."
    (if (stringp charset)
        (setq charset (intern (downcase charset))))
!   (if (or (not charset) 
          (eq 'gnus-all mail-parse-ignored-charsets)
          (memq 'gnus-all mail-parse-ignored-charsets)
          (memq charset mail-parse-ignored-charsets))
--- 178,184 ----
  The characters in CHARSET should then be decoded."
    (if (stringp charset)
        (setq charset (intern (downcase charset))))
!   (if (or (not charset)
          (eq 'gnus-all mail-parse-ignored-charsets)
          (memq 'gnus-all mail-parse-ignored-charsets)
          (memq charset mail-parse-ignored-charsets))
***************
*** 226,232 ****
        (if (and (not coding-system)
                 (listp mail-parse-ignored-charsets)
                 (memq 'gnus-unknown mail-parse-ignored-charsets))
!           (setq coding-system 
                  (mm-charset-to-coding-system mail-parse-charset)))
        (when (and charset coding-system
                   ;; buffer-file-coding-system
--- 191,197 ----
        (if (and (not coding-system)
                 (listp mail-parse-ignored-charsets)
                 (memq 'gnus-unknown mail-parse-ignored-charsets))
!           (setq coding-system
                  (mm-charset-to-coding-system mail-parse-charset)))
        (when (and charset coding-system
                   ;; buffer-file-coding-system
***************
*** 242,248 ****
    "Decode STRING with CHARSET."
    (when (stringp charset)
      (setq charset (intern (downcase charset))))
!   (when (or (not charset) 
            (eq 'gnus-all mail-parse-ignored-charsets)
            (memq 'gnus-all mail-parse-ignored-charsets)
            (memq charset mail-parse-ignored-charsets))
--- 207,213 ----
    "Decode STRING with CHARSET."
    (when (stringp charset)
      (setq charset (intern (downcase charset))))
!   (when (or (not charset)
            (eq 'gnus-all mail-parse-ignored-charsets)
            (memq 'gnus-all mail-parse-ignored-charsets)
            (memq charset mail-parse-ignored-charsets))
***************
*** 253,259 ****
         (if (and (not coding-system)
                (listp mail-parse-ignored-charsets)
                (memq 'gnus-unknown mail-parse-ignored-charsets))
!          (setq coding-system 
                 (mm-charset-to-coding-system mail-parse-charset)))
         (when (and charset coding-system
                  (mm-multibyte-p)
--- 218,224 ----
         (if (and (not coding-system)
                (listp mail-parse-ignored-charsets)
                (memq 'gnus-unknown mail-parse-ignored-charsets))
!          (setq coding-system
                 (mm-charset-to-coding-system mail-parse-charset)))
         (when (and charset coding-system
                  (mm-multibyte-p)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]