Changeset 4079 for trunk/lisp/gnus/gnus-art.el
- Timestamp:
- 05/13/06 11:31:18 (3 years ago)
- Files:
-
- trunk/lisp/gnus/gnus-art.el (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/gnus/gnus-art.el
r4073 r4079 4318 4318 (defun gnus-mime-view-part-as-type-internal () 4319 4319 (gnus-article-check-buffer) 4320 (let* ((name (mail-content-type-get 4321 (mm-handle-type (get-text-property (point) 'gnus-data)) 4322 'name)) 4320 (let* ((handle (get-text-property (point) 'gnus-data)) 4321 (name (or 4322 ;; Content-Type: foo/bar; name=... 4323 (mail-content-type-get (mm-handle-type handle) 'name) 4324 ;; Content-Disposition: attachment; filename=... 4325 (cdr (assq 'filename (cdr (mm-handle-disposition handle)))))) 4323 4326 (def-type (and name (mm-default-file-encoding name)))) 4324 4327 (and def-type (cons def-type 0)))) 4325 4328 4326 (defun gnus-mime-view-part-as-type (&optional mime-type) 4327 "Choose a MIME media type, and view the part as such." 4329 (defun gnus-mime-view-part-as-type (&optional mime-type pred) 4330 "Choose a MIME media type, and view the part as such. 4331 If non-nil, PRED is a predicate to use during completion to limit the 4332 available media-types." 4328 4333 (interactive) 4329 4334 (unless mime-type 4330 (setq mime-type (completing-read 4331 "View as MIME type: " 4332 (mapcar #'list (mailcap-mime-types)) 4333 nil nil 4334 (gnus-mime-view-part-as-type-internal)))) 4335 (setq mime-type 4336 (let ((default (gnus-mime-view-part-as-type-internal))) 4337 (completing-read 4338 (format "View as MIME type (default %s): " 4339 (car default)) 4340 (mapcar #'list (mailcap-mime-types)) 4341 pred nil nil nil 4342 (car default))))) 4335 4343 (gnus-article-check-buffer) 4336 4344 (let ((handle (get-text-property (point) 'gnus-data))) … … 4512 4520 (mail-parse-charset gnus-newsgroup-charset) 4513 4521 (mail-parse-ignored-charsets 4514 (save-excursion (set-buffer gnus-summary-buffer) 4515 gnus-newsgroup-ignored-charsets))) 4516 (when handle 4517 (if (mm-handle-undisplayer handle) 4518 (mm-remove-part handle) 4519 (mm-display-part handle))))) 4522 (with-current-buffer gnus-summary-buffer 4523 gnus-newsgroup-ignored-charsets)) 4524 (type (mm-handle-media-type handle)) 4525 (method (mailcap-mime-info type)) 4526 (mm-enable-external t)) 4527 (if (not (stringp method)) 4528 (gnus-mime-view-part-as-type 4529 nil (lambda (type) (stringp (mailcap-mime-info type)))) 4530 (when handle 4531 (if (mm-handle-undisplayer handle) 4532 (mm-remove-part handle) 4533 (mm-display-part handle)))))) 4520 4534 4521 4535 (defun gnus-mime-view-part-internally (&optional handle) … … 4529 4543 (mail-parse-charset gnus-newsgroup-charset) 4530 4544 (mail-parse-ignored-charsets 4531 ( save-excursion (set-buffer gnus-summary-buffer)4532 gnus-newsgroup-ignored-charsets))4545 (with-current-buffer gnus-summary-buffer 4546 gnus-newsgroup-ignored-charsets)) 4533 4547 (inhibit-read-only t)) 4534 (when handle 4535 (if (mm-handle-undisplayer handle) 4536 (mm-remove-part handle) 4537 (mm-display-part handle))))) 4548 (if (not (mm-inlinable-p handle)) 4549 (gnus-mime-view-part-as-type 4550 nil (lambda (type) (mm-inlinable-p handle type))) 4551 (when handle 4552 (if (mm-handle-undisplayer handle) 4553 (mm-remove-part handle) 4554 (mm-display-part handle)))))) 4538 4555 4539 4556 (defun gnus-mime-action-on-part (&optional action)
