T-gnus 6.15.16 (quimby) revision 00.
[elisp/gnus.git-] / lisp / mm-url.el
index 919cdb1..aa3cfda 100644 (file)
@@ -1,5 +1,5 @@
 ;;; 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)
@@ -270,9 +271,12 @@ This is taken from RFC 2396.")
 
 (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
@@ -310,7 +314,6 @@ If FOLLOW-REFRESH is non-nil, redirect refresh url in META."
        (done nil)
        (first t)
        result)
-    (message "%s" url)
     (while (and (not (zerop (decf times)))
                (not done))
       (with-timeout (mm-url-timeout)
@@ -379,7 +382,9 @@ spaces.  Die Die Die."
        (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)
    ""))