(condition-case nil
(require 'url)
(error nil)))
- "*If non-nil, use external grab program `mm-url-program'."
+ "If non-nil, use external grab program `mm-url-program'."
:version "22.1"
:type 'boolean
:group 'mm-url)
(insert-file-contents (substring url (1- (match-end 0))))
(mm-url-insert-file-contents-external url))
(goto-char (point-min))
- (if (fboundp 'url-generic-parse-url)
- (setq url-current-object
- (url-generic-parse-url url)))
+ (setq url-current-object (url-generic-parse-url url))
(list url (buffer-size)))
(mm-url-load-url)
(let ((name buffer-file-name)
- (url-request-extra-headers
- ;; ISTM setting a Connection header was a workaround for
- ;; older versions of url included with w3, but it does more
- ;; harm than good with the one shipped with Emacs. --ansel
- (if (not (and (boundp 'url-version)
- (equal url-version "Emacs")))
- (list (cons "Connection" "Close"))))
result)
(setq result (url-insert-file-contents url))
(save-excursion
(while (re-search-forward "\r 1000\r ?" nil t)
(replace-match "")))
(setq buffer-file-name name)
- (if (and (fboundp 'url-generic-parse-url)
- (listp result))
- (setq url-current-object (url-generic-parse-url
- (car result))))
+ (when (listp result)
+ (setq url-current-object
+ (url-generic-parse-url (car result))))
result)))
;;;###autoload
((= char ? ) "+")
((memq char mm-url-unreserved-chars) (char-to-string char))
(t (upcase (format "%%%02x" char)))))
- (encode-coding-string chunk
- (if (fboundp 'find-coding-systems-string)
- (car (find-coding-systems-string chunk))
- buffer-file-coding-system))
+ (encode-coding-string chunk (car (find-coding-systems-string chunk)))
"")))
(defun mm-url-encode-www-form-urlencoded (pairs)