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-view.el


From: ShengHuo ZHU
Subject: [Emacs-diffs] Changes to emacs/lisp/gnus/mm-view.el
Date: Thu, 07 Feb 2002 10:55:05 -0500

Index: emacs/lisp/gnus/mm-view.el
diff -c emacs/lisp/gnus/mm-view.el:1.5 emacs/lisp/gnus/mm-view.el:1.6
*** emacs/lisp/gnus/mm-view.el:1.5      Wed Aug  1 09:44:45 2001
--- emacs/lisp/gnus/mm-view.el  Wed Dec  5 14:27:45 2001
***************
*** 50,59 ****
       `(lambda () (remove-images ,b (1+ ,b))))))
  
  (defun mm-inline-image-xemacs (handle)
    (let ((b (point))
        (annot (make-annotation (mm-get-image handle) nil 'text))
        buffer-read-only)
-     (insert "\n")
      (mm-handle-set-undisplayer
       handle
       `(lambda ()
--- 50,60 ----
       `(lambda () (remove-images ,b (1+ ,b))))))
  
  (defun mm-inline-image-xemacs (handle)
+   (insert "\n")
+   (forward-char -1)
    (let ((b (point))
        (annot (make-annotation (mm-get-image handle) nil 'text))
        buffer-read-only)
      (mm-handle-set-undisplayer
       handle
       `(lambda ()
***************
*** 104,114 ****
                    (and (boundp 'w3-meta-charset-content-type-regexp)
                         (re-search-forward
                          w3-meta-charset-content-type-regexp nil t)))
!               (setq charset (or (w3-coding-system-for-mime-charset 
!                                  (buffer-substring-no-properties 
!                                   (match-beginning 2) 
!                                   (match-end 2)))
!                                 charset)))
            (delete-region (point-min) (point-max))
            (insert (mm-decode-string text charset))
            (save-window-excursion
--- 105,118 ----
                    (and (boundp 'w3-meta-charset-content-type-regexp)
                         (re-search-forward
                          w3-meta-charset-content-type-regexp nil t)))
!               (setq charset
!                     (or (let ((bsubstr (buffer-substring-no-properties
!                                         (match-beginning 2)
!                                         (match-end 2))))
!                           (if (fboundp 'w3-coding-system-for-mime-charset)
!                               (w3-coding-system-for-mime-charset bsubstr)
!                             (mm-charset-to-coding-system bsubstr)))
!                         charset)))
            (delete-region (point-min) (point-max))
            (insert (mm-decode-string text charset))
            (save-window-excursion
***************
*** 120,126 ****
                      (url-standalone-mode t))
                  (condition-case var
                      (w3-region (point-min) (point-max))
!                   (error)))))
            (mm-handle-set-undisplayer
             handle
             `(lambda ()
--- 124,144 ----
                      (url-standalone-mode t))
                  (condition-case var
                      (w3-region (point-min) (point-max))
!                   (error
!                    (delete-region (point-min) (point-max))
!                    (let ((b (point))
!                          (charset (mail-content-type-get
!                                    (mm-handle-type handle) 'charset)))
!                      (if (or (eq charset 'gnus-decoded)
!                              (eq mail-parse-charset 'gnus-decoded))
!                          (save-restriction
!                            (narrow-to-region (point) (point))
!                            (mm-insert-part handle)
!                            (goto-char (point-max)))
!                        (insert (mm-decode-string (mm-get-part handle)
!                                                  charset))))
!                    (message
!                     "Error while rendering html; showing as text/plain"))))))
            (mm-handle-set-undisplayer
             handle
             `(lambda ()
***************
*** 133,165 ****
                              '(background background-pixmap foreground)))
                  (delete-region ,(point-min-marker)
                                 ,(point-max-marker)))))))))
-      ((or (equal type "enriched")
-         (equal type "richtext"))
-       (save-excursion
-       (mm-with-unibyte-buffer
-         (mm-insert-part handle)
-         (save-window-excursion
-           (enriched-decode (point-min) (point-max))
-           (setq text (buffer-string)))))
-       (mm-insert-inline handle text))
       ((equal type "x-vcard")
        (mm-insert-inline
         handle
         (concat "\n-- \n"
!              (if (fboundp 'vcard-pretty-print)
!                  (vcard-pretty-print (mm-get-part handle))
!                (vcard-format-string
!                 (vcard-parse-string (mm-get-part handle)
!                                     'vcard-standard-filter))))))
       (t
        (let ((b (point))
            (charset (mail-content-type-get
                      (mm-handle-type handle) 'charset)))
        (if (or (eq charset 'gnus-decoded)
                ;; This is probably not entirely correct, but
!               ;; makes rfc822 parts with embedded multiparts work. 
                (eq mail-parse-charset 'gnus-decoded))
!           (mm-insert-part handle)
          (insert (mm-decode-string (mm-get-part handle) charset)))
        (when (and (equal type "plain")
                   (equal (cdr (assoc 'format (mm-handle-type handle)))
--- 151,178 ----
                              '(background background-pixmap foreground)))
                  (delete-region ,(point-min-marker)
                                 ,(point-max-marker)))))))))
       ((equal type "x-vcard")
        (mm-insert-inline
         handle
         (concat "\n-- \n"
!              (ignore-errors
!                (if (fboundp 'vcard-pretty-print)
!                    (vcard-pretty-print (mm-get-part handle))
!                  (vcard-format-string
!                   (vcard-parse-string (mm-get-part handle)
!                                       'vcard-standard-filter)))))))
       (t
        (let ((b (point))
            (charset (mail-content-type-get
                      (mm-handle-type handle) 'charset)))
        (if (or (eq charset 'gnus-decoded)
                ;; This is probably not entirely correct, but
!               ;; makes rfc822 parts with embedded multiparts work.
                (eq mail-parse-charset 'gnus-decoded))
!           (save-restriction
!             (narrow-to-region (point) (point))
!             (mm-insert-part handle)
!             (goto-char (point-max)))
          (insert (mm-decode-string (mm-get-part handle) charset)))
        (when (and (equal type "plain")
                   (equal (cdr (assoc 'format (mm-handle-type handle)))
***************
*** 172,177 ****
--- 185,193 ----
        (save-restriction
          (narrow-to-region b (point))
          (set-text-properties (point-min) (point-max) nil)
+         (when (or (equal type "enriched")
+                   (equal type "richtext"))
+           (enriched-decode (point-min) (point-max)))
          (mm-handle-set-undisplayer
           handle
           `(lambda ()
***************
*** 219,224 ****
--- 235,241 ----
  
  (defun mm-inline-message (handle)
    (let ((b (point))
+       (bolp (bolp))
        (charset (mail-content-type-get
                  (mm-handle-type handle) 'charset))
        gnus-displaying-mime handles)
***************
*** 232,244 ****
        (narrow-to-region b b)
        (mm-insert-part handle)
        (let (gnus-article-mime-handles
!             ;; disable prepare hook 
!             gnus-article-prepare-hook  
              (gnus-newsgroup-charset
               (or charset gnus-newsgroup-charset)))
          (run-hooks 'gnus-article-decode-hook)
          (gnus-article-prepare-display)
          (setq handles gnus-article-mime-handles))
        (goto-char (point-max))
        (unless (bolp)
          (insert "\n"))
--- 249,264 ----
        (narrow-to-region b b)
        (mm-insert-part handle)
        (let (gnus-article-mime-handles
!             ;; disable prepare hook
!             gnus-article-prepare-hook
              (gnus-newsgroup-charset
               (or charset gnus-newsgroup-charset)))
          (run-hooks 'gnus-article-decode-hook)
          (gnus-article-prepare-display)
          (setq handles gnus-article-mime-handles))
+       (goto-char (point-min))
+       (unless bolp
+         (insert "\n"))
        (goto-char (point-max))
        (unless (bolp)
          (insert "\n"))



reply via email to

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