diff options
| author | Stefan Monnier | 2015-03-26 15:17:51 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2015-03-26 15:17:51 -0400 |
| commit | 118b6a92f51f7ac10f83f7b0210afd31fbd694f4 (patch) | |
| tree | 198f8bb3d1337b4840910b4eb0b862673f4cb6fa /lisp | |
| parent | 5e0314f6fabca1af214240177a28d3822d6ef3e5 (diff) | |
| download | emacs-118b6a92f51f7ac10f83f7b0210afd31fbd694f4.tar.gz emacs-118b6a92f51f7ac10f83f7b0210afd31fbd694f4.zip | |
(url-insert-file-contents): Set buffer-file-coding-system
Fixes: debbugs:20010
* lisp/url/url-handlers.el (url-insert-file-contents): Call
after-insert-file-set-coding like insert-file-contents, to set
buffer-file-coding-system. [Backport]
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/url/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/url/url-handlers.el | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 6e0c157e39c..c26b080c050 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2015-03-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * url-handlers.el (url-insert-file-contents): Call | ||
| 4 | after-insert-file-set-coding like insert-file-contents, to set | ||
| 5 | buffer-file-coding-system (bug#20010). [Backport] | ||
| 6 | |||
| 1 | 2014-10-20 Glenn Morris <rgm@gnu.org> | 7 | 2014-10-20 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * url-vars.el (url-bug-address): Make into an obsolete alias. | 9 | * url-vars.el (url-bug-address): Make into an obsolete alias. |
diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el index 9c16cffd4af..e42f552c416 100644 --- a/lisp/url/url-handlers.el +++ b/lisp/url/url-handlers.el | |||
| @@ -324,8 +324,13 @@ They count bytes from the beginning of the body." | |||
| 324 | (unless (cadr size-and-charset) | 324 | (unless (cadr size-and-charset) |
| 325 | ;; If the headers don't specify any particular charset, use the | 325 | ;; If the headers don't specify any particular charset, use the |
| 326 | ;; usual heuristic/rules that we apply to files. | 326 | ;; usual heuristic/rules that we apply to files. |
| 327 | (decode-coding-inserted-region start (point) url visit beg end replace)) | 327 | (decode-coding-inserted-region start (point) url |
| 328 | (list url (car size-and-charset)))))) | 328 | visit beg end replace)) |
| 329 | (let ((inserted (car size-and-charset))) | ||
| 330 | (when (fboundp 'after-insert-file-set-coding) | ||
| 331 | (let ((insval (after-insert-file-set-coding inserted visit))) | ||
| 332 | (if insval (setq inserted insval)))) | ||
| 333 | (list url inserted)))))) | ||
| 329 | 334 | ||
| 330 | (put 'insert-file-contents 'url-file-handlers 'url-insert-file-contents) | 335 | (put 'insert-file-contents 'url-file-handlers 'url-insert-file-contents) |
| 331 | 336 | ||