;;; mm-url.el --- a wrapper of url functions/commands for Gnus
-;; Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
(defcustom mm-url-program
(cond
((exec-installed-p "wget") 'wget)
- ((executable-find "w3m") 'w3m)
+ ((exec-installed-p "w3m") 'w3m)
((exec-installed-p "lynx") 'lynx)
((exec-installed-p "curl") 'curl)
(t "GET"))
- "The url grab program."
+ "The url grab program.
+Likely values are `wget', `w3m', `lynx' and `curl'."
:type '(choice
(symbol :tag "wget" wget)
(symbol :tag "w3m" w3m)
(defun mm-url-insert-file-contents (url)
(if mm-url-use-external
- (if (string-match "^file:/+" url)
- (insert-file-contents (substring url (1- (match-end 0))))
- (mm-url-insert-file-contents-external url))
+ (progn
+ (if (string-match "^file:/+" url)
+ (insert-file-contents (substring url (1- (match-end 0))))
+ (mm-url-insert-file-contents-external url))
+ (goto-char (point-min))
+ (list url (buffer-size)))
(mm-url-load-url)
(let ((name buffer-file-name)
(url-package-name (or mm-url-package-name
(encode-coding-string chunk
(if (fboundp 'find-coding-systems-string)
(car (find-coding-systems-string chunk))
- buffer-file-coding-system))
+ (static-if (boundp 'MULE)
+ file-coding-system
+ buffer-file-coding-system)))
chunk)
""))