diff options
author | Michael Olson <mwolson@gnu.org> | 2007-04-09 05:19:00 +0000 |
---|---|---|
committer | Michael Olson <mwolson@gnu.org> | 2007-04-09 05:19:00 +0000 |
commit | 5495e8c0655a1e5137ceaf0cc8331433cdae54bf (patch) | |
tree | 4bc0054cc203869403169fea9456d86c8cdf9dab /emms-url.el | |
parent | 8652257258a7306505f24360b54284cca6308d3c (diff) |
emms-player-mpd: Fix erroneous extra message and be more careful about the current buffer
darcs-hash:20070409051913-1bfb2-c965d42ac45f6510003919c6cba7783164028ea3.gz
Diffstat (limited to 'emms-url.el')
-rw-r--r-- | emms-url.el | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/emms-url.el b/emms-url.el index 3b5ccee..b3841c2 100644 --- a/emms-url.el +++ b/emms-url.el @@ -55,16 +55,17 @@ variable." url-http-content-type) (intern-soft (downcase (match-string 1 url-http-content-type))))) -(defun emms-http-decode-buffer () +(defun emms-http-decode-buffer (&optional buffer) "Recode the buffer with `url-retrieve's contents. Else the buffer would contain multibyte chars like \\123\\456." - (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))) + (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)))) (provide 'emms-url) ;;; emms-url.el ends here |