diff options
| author | Stefan Monnier | 2009-10-17 03:59:45 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-10-17 03:59:45 +0000 |
| commit | 2df48a87291564f460b159f94f622f88f6c40bfb (patch) | |
| tree | 2d949fe5fe9d6c200813d20f6fd46d47f1ada3f9 | |
| parent | 547776f9b0537d5231f7fc864715961b8d916012 (diff) | |
| download | emacs-2df48a87291564f460b159f94f622f88f6c40bfb.tar.gz emacs-2df48a87291564f460b159f94f622f88f6c40bfb.zip | |
(select-safe-coding-system): If the file
has a coding cookie, use it regardless of any other setting (bug#4712).
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/international/mule-cmds.el | 11 |
2 files changed, 10 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1cf7714e80e..0fcfead46e3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2009-10-17 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * international/mule-cmds.el (select-safe-coding-system): If the file | ||
| 4 | has a coding cookie, use it regardless of any other setting (bug#4712). | ||
| 5 | |||
| 1 | 2009-10-17 Glenn Morris <rgm@gnu.org> | 6 | 2009-10-17 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * cedet/semantic/grammar.el (semantic-grammar--lex-delim-spec): | 8 | * cedet/semantic/grammar.el (semantic-grammar--lex-delim-spec): |
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 9d6f6eb4e96..af813b0172b 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el | |||
| @@ -889,13 +889,12 @@ It is highly recommended to fix it before writing to a file." | |||
| 889 | default-coding-system)) | 889 | default-coding-system)) |
| 890 | 890 | ||
| 891 | (if (and auto-cs (not no-other-defaults)) | 891 | (if (and auto-cs (not no-other-defaults)) |
| 892 | ;; If the file has a coding cookie, try to use it before anything | 892 | ;; If the file has a coding cookie, use it regardless of any |
| 893 | ;; else (i.e. before default-coding-system which will typically come | 893 | ;; other setting. |
| 894 | ;; from file-coding-system-alist). | ||
| 895 | (let ((base (coding-system-base auto-cs))) | 894 | (let ((base (coding-system-base auto-cs))) |
| 896 | (or (memq base '(nil undecided)) | 895 | (unless (memq base '(nil undecided)) |
| 897 | (rassq base default-coding-system) | 896 | (setq default-coding-system (list (cons auto-cs base))) |
| 898 | (push (cons auto-cs base) default-coding-system)))) | 897 | (setq no-other-defaults t)))) |
| 899 | 898 | ||
| 900 | (unless no-other-defaults | 899 | (unless no-other-defaults |
| 901 | ;; If buffer-file-coding-system is not nil nor undecided, append it | 900 | ;; If buffer-file-coding-system is not nil nor undecided, append it |