+2007-08-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-art.el (gnus-article-edit-part): Don't jump to nonexistent part.
+ (gnus-mime-view-part-as-type-internal): Default to text/plain for text
+ parts, or application/octet-stream as a last resort.
+ (gnus-mime-view-part-as-type): Don't toggle display.
+ (gnus-mime-view-part-as-charset): Don't turn off display before
+ querying charset.
+
+ * mm-view.el (mm-inline-text-html-render-with-w3): Don't add XEmacs
+ stuff to undisplayer function in Emacs.
+ (mm-inline-text-html-render-with-w3m): Remove Emacs/W3 stuff.
+
+ * mml.el (mml-generate-mime-1): Prefer utf-8 when encoding
+ text/calendar parts.
+
2007-08-23 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-art.el (gnus-mime-display-single): Use utf-8 by default for
(gnus-summary-show-article)
(when (and current-id (integerp gnus-auto-select-part))
(gnus-article-jump-to-part
- (+ current-id gnus-auto-select-part)))))
+ (if (text-property-any (point-min) (point-max)
+ 'gnus-part (+ current-id gnus-auto-select-part))
+ (+ current-id gnus-auto-select-part)
+ (with-current-buffer gnus-article-buffer
+ (length gnus-article-mime-handle-alist)))))))
(defun gnus-mime-replace-part (file)
"Replace MIME part under point with an external body."
;; Content-Disposition: attachment; filename=...
(cdr (assq 'filename (cdr (mm-handle-disposition handle))))))
(def-type (and name (mm-default-file-encoding name))))
- (and def-type (cons def-type 0))))
+ (or (and def-type (cons def-type 0))
+ (and handle
+ (equal (mm-handle-media-supertype handle) "text")
+ '("text/plain" . 0))
+ '("application/octet-stream" . 0))))
(defun gnus-mime-view-part-as-type (&optional mime-type pred)
"Choose a MIME media type, and view the part as such.
(mm-handle-id handle)))
(setq gnus-article-mime-handles
(mm-merge-handles gnus-article-mime-handles handle))
+ (when (mm-handle-displayed-p handle)
+ (mm-remove-part handle))
(gnus-mm-display-part handle))))
(defun gnus-mime-copy-part (&optional handle arg)
(gnus-newsgroup-ignored-charsets 'gnus-all)
gnus-newsgroup-charset form preferred parts)
(when handle
- (if (mm-handle-undisplayer handle)
- (mm-remove-part handle))
- (when fun
- (setq gnus-newsgroup-charset
- (or (cdr (assq arg gnus-summary-show-article-charset-alist))
- (mm-read-coding-system "Charset: ")))
+ (when (prog1
+ (and fun
+ (setq gnus-newsgroup-charset
+ (or (cdr (assq
+ arg
+ gnus-summary-show-article-charset-alist))
+ (mm-read-coding-system "Charset: "))))
+ (if (mm-handle-undisplayer handle)
+ (mm-remove-part handle)))
(gnus-mime-strip-charset-parameters handle)
(when (and (consp (setq form (cdr-safe fun)))
(setq form (ignore-errors
handle
`(lambda ()
(let (buffer-read-only)
- (if (functionp 'remove-specifier)
- (mapcar (lambda (prop)
- (remove-specifier
- (face-property 'default prop)
- (current-buffer)))
- '(background background-pixmap foreground)))
+ ,@(if (functionp 'remove-specifier)
+ '((mapcar (lambda (prop)
+ (remove-specifier
+ (face-property 'default prop)
+ (current-buffer)))
+ '(background background-pixmap foreground))))
(delete-region ,(point-min-marker)
,(point-max-marker)))))))))
(mm-handle-set-undisplayer
handle
`(lambda ()
- (let (buffer-read-only)
- (if (functionp 'remove-specifier)
- (mapcar (lambda (prop)
- (remove-specifier
- (face-property 'default prop)
- (current-buffer)))
- '(background background-pixmap foreground)))
+ (let ((inhibit-read-only t))
(delete-region ,(point-min-marker)
,(point-max-marker)))))))))
;; insert a "; format=flowed" string unless the
;; user has already specified it.
(setq flowed (null (assq 'format cont)))))
- (setq charset (mm-encode-body charset))
+ ;; Prefer `utf-8' for text/calendar parts.
+ (if (or charset
+ (not (string= type "text/calendar")))
+ (setq charset (mm-encode-body charset))
+ (let ((mm-coding-system-priorities
+ (cons 'utf-8 mm-coding-system-priorities)))
+ (setq charset (mm-encode-body))))
(setq encoding (mm-body-encoding
charset (cdr (assq 'encoding cont))))))
(setq coded (buffer-string)))