* Reiner Steib wrote: > JFTR: It failed with "Mail doesn't contain a HTML-part!" on the > following forwarded message: > > | <* mixed> Fwd: RE: Termine > | <1 text> > | <2 rfc822> > | <2.* alternative> RE: Termine > | <2.1 text> > | <2.2 html> Hm, would you mind to forward some look-a-like to me? > I think (when your assignment is completed), It's up to our patience right now. ;) > we should add both functions to `gnus-art.el' and add a key binding > (suggestions?) Well, _I_ use "v", but I guess I won't be able to push that. ;) > As requested, some comments/suggestions on the code: Thanks! >> (defun hs-show-html-list (LIST) > Rename to, say `gnus-article-browse-html-parts'. Other suggestions? > Instead of LIST, you should write list (in lowercase). *done* >> "View all HTML-parts from 'LIST'. > "View all \"text/html\" parts from LIST. *done* >> (let ((showed)) > Maybe "done" instead of "showed"? I'm not sure whether "done" exactly reflects the purpose of "showed". >> ;; Find and show the html-parts. >> (dolist (elt LIST) >> ;; If HTML, show it >> (cond ((and (listp elt) > Maybe rename "elt" to "handle"? *done* I've been lacking imagination in that point. [ Factoring out cond ] Yeah you're right. The routines grew a bit...evolutionary. >> (bufferp (car elt)) > Isn't (car elt) the same as (mm-handle-buffer elt)? Yes...but we don't know exactly whether it's a buffer (look at the second condition), so I guess car is more appropriate here. >> (string-match "text/html" (car (mm-handle-type elt)))) >> (let ((tmp (format "%s-%s.html" > Maybe "file" instead of "tmp"? I went for "tmp-file" if it's okay for you. >> (make-temp-name "/tmp/gnus-html-") >> (user-login-name)))) > > (mm-make-temp-file (expand-file-name "mm" mm-tmp-directory) nil ".html") > Maybe even (convert-standard-filename (mm-make-temp-file ...)) like > in `browse-url-of-buffer' is required? Uhm, so what's your final suggestion here? :) >> (mm-save-part-to-file elt tmp) >> (browse-url tmp) > It would be nice to remove the tmp file after proceeding to the next > article or leaving the summary buffer (maybe similar to > `mm-remove-part'). But it might depend on the browser and the user if > this is desired. Or it could be removed here: > (when (gnus-y-or-n-p "Remove temp file? ") (delete-file tmp)) Yes it would be nice and the only way would be this asking as we can't delete it, before it has been showed... >> (setq showed t))) >> ;; If multipart, recurse >> ((and (listp elt) >> (stringp (car elt)) >> (string-match "multipart/" (substring (car elt) 0 10)) > (string-match "^multipart/" (car elt)) *done* >> (setq showed (or showed (hs-show-html-list elt))))))) >> showed)) >> (defun hs-show-html-mail () > (defun gnus-article-browse-html-article *done* > Other suggestions? I'm fine with it. >> "View HTML-parts of the current Gnus-Article in a graphical browser." > > "View \"text/html\" parts of the current article with a WWW browser." > See `C-h f browse-url RET'. Ehm, for what exactly? >> (message "Mail doesn't contain a HTML-part!")) > Either (gnus-message 3 ...) or even (gnus-error ...) should be used > here, I think. Ok, I wasn't sure about what to use. -hs