Show
Ignore:
Timestamp:
05/13/06 11:31:18 (3 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/gnus/gnus-art.el

    r4073 r4079  
    43184318(defun gnus-mime-view-part-as-type-internal () 
    43194319  (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)))))) 
    43234326         (def-type (and name (mm-default-file-encoding name)))) 
    43244327    (and def-type (cons def-type 0)))) 
    43254328 
    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. 
     4331If non-nil, PRED is a predicate to use during completion to limit the 
     4332available media-types." 
    43284333  (interactive) 
    43294334  (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))))) 
    43354343  (gnus-article-check-buffer) 
    43364344  (let ((handle (get-text-property (point) 'gnus-data))) 
     
    45124520         (mail-parse-charset gnus-newsgroup-charset) 
    45134521         (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)))))) 
    45204534 
    45214535(defun gnus-mime-view-part-internally (&optional handle) 
     
    45294543         (mail-parse-charset gnus-newsgroup-charset) 
    45304544         (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)) 
    45334547         (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)))))) 
    45384555 
    45394556(defun gnus-mime-action-on-part (&optional action)