aboutsummaryrefslogtreecommitdiff
path: root/emms-url.el
diff options
context:
space:
mode:
Diffstat (limited to 'emms-url.el')
-rw-r--r--emms-url.el21
1 files changed, 12 insertions, 9 deletions
diff --git a/emms-url.el b/emms-url.el
index b3841c2..d77a382 100644
--- a/emms-url.el
+++ b/emms-url.el
@@ -50,10 +50,12 @@ variable."
(append url nil))))
(defun emms-http-content-coding ()
- (and (boundp 'url-http-content-type)
- (string-match ";\\s-*charset=\\([^;[:space:]]+\\)"
- url-http-content-type)
- (intern-soft (downcase (match-string 1 url-http-content-type)))))
+ (save-match-data
+ (and (boundp 'url-http-content-type)
+ (stringp url-http-content-type)
+ (string-match ";\\s-*charset=\\([^;[:space:]]+\\)"
+ url-http-content-type)
+ (intern-soft (downcase (match-string 1 url-http-content-type))))))
(defun emms-http-decode-buffer (&optional buffer)
"Recode the buffer with `url-retrieve's contents. Else the
@@ -61,11 +63,12 @@ buffer would contain multibyte chars like \\123\\456."
(with-current-buffer (or buffer (current-buffer))
(let* ((default (or (car default-process-coding-system) 'utf-8))
(coding (or (emms-http-content-coding) default)))
- ;; (pop-to-buffer (current-buffer))
- ;; (message "content-type: %s" url-http-content-type)
- ;; (message "coding: %S [default: %S]" coding default)
- (set-buffer-multibyte t)
- (decode-coding-region (point-min) (point-max) coding))))
+ (when coding
+ ;; (pop-to-buffer (current-buffer))
+ ;; (message "content-type: %s" url-http-content-type)
+ ;; (message "coding: %S [default: %S]" coding default)
+ (set-buffer-multibyte t)
+ (decode-coding-region (point-min) (point-max) coding)))))
(provide 'emms-url)
;;; emms-url.el ends here