Function: gnus-article-browse-html-save-cid-content

gnus-article-browse-html-save-cid-content is a byte-compiled function defined in gnus-art.el.gz.

Signature

(gnus-article-browse-html-save-cid-content CID HANDLES DIRECTORY)

Documentation

Find CID content in HANDLES and save it in a file in DIRECTORY.

Return file name relative to the parent of DIRECTORY.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-art.el.gz
(defun gnus-article-browse-html-save-cid-content (cid handles directory)
  "Find CID content in HANDLES and save it in a file in DIRECTORY.
Return file name relative to the parent of DIRECTORY."
  (save-match-data
    (let (file afile)
      (catch 'found
	(dolist (handle handles)
	  (cond
	   ((not (listp handle)))
	   ;; Exclude broken handles that `gnus-summary-enter-digest-group'
	   ;; may create.
	   ((not (or (bufferp (car handle)) (stringp (car handle)))))
	   ((equal (mm-handle-media-supertype handle) "multipart")
	    (when (setq file (gnus-article-browse-html-save-cid-content
			      cid handle directory))
	      (throw 'found file)))
	   ((equal (concat "<" cid ">") (mm-handle-id handle))
            ;; Randomize filenames: declared filenames may not be unique.
            (setq file (format "cid-%d-%s"
			       (random 99)
			       (or (mm-handle-filename handle)
				   (concat
				    (make-temp-name "cid")
				    (car (rassoc (car (mm-handle-type handle))
						 mailcap-mime-extensions)))))
                  afile (expand-file-name file directory))
	    (mm-save-part-to-file handle afile)
	    (throw 'found (concat (file-name-nondirectory
				   (directory-file-name directory))
				  "/" file)))))))))