aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2013-06-28 23:41:14 +0900
committerKenichi Handa2013-06-28 23:41:14 +0900
commitaa453e89dc7a26c048ecaa2f7b4a45917e574c0d (patch)
treef2df4dae5c873c3debdd13dbb56b85a10fe22c81
parent3e3da660306d977c1fd7090c067c9324ab111c04 (diff)
downloademacs-aa453e89dc7a26c048ecaa2f7b4a45917e574c0d.tar.gz
emacs-aa453e89dc7a26c048ecaa2f7b4a45917e574c0d.zip
mule-conf.el (prefer-utf-8): New coding system.
(file-coding-system-alist): Use prefer-utf-8 as default for Elisp files.
-rw-r--r--lisp/international/mule-conf.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/lisp/international/mule-conf.el b/lisp/international/mule-conf.el
index 48487b850df..a84054b498b 100644
--- a/lisp/international/mule-conf.el
+++ b/lisp/international/mule-conf.el
@@ -1225,6 +1225,18 @@
1225(define-coding-system-alias 'dos 'undecided-dos) 1225(define-coding-system-alias 'dos 'undecided-dos)
1226(define-coding-system-alias 'mac 'undecided-mac) 1226(define-coding-system-alias 'mac 'undecided-mac)
1227 1227
1228(define-coding-system 'prefer-utf-8
1229 "Like `undecided' but prefer UTF-8 when appropriate.
1230On decoding, if the source contains 8-bit codes and they all
1231are valid UTF-8 sequences, detect the source as UTF-8 encoding
1232regardless of the coding priority.
1233On encoding, if the source contains non-ASCII characters, encode them
1234by UTF-8."
1235 :coding-type 'undecided
1236 :mnemonic ?-
1237 :charset-list '(emacs)
1238 :prefer-utf-8 t)
1239
1228(define-coding-system 'raw-text 1240(define-coding-system 'raw-text
1229 "Raw text, which means text contains random 8-bit codes. 1241 "Raw text, which means text contains random 8-bit codes.
1230Encoding text with this coding system produces the actual byte 1242Encoding text with this coding system produces the actual byte
@@ -1508,7 +1520,7 @@ for decoding and encoding files, process I/O, etc."
1508(setq file-coding-system-alist 1520(setq file-coding-system-alist
1509 (mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg))) 1521 (mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg)))
1510 '(("\\.elc\\'" . utf-8-emacs) 1522 '(("\\.elc\\'" . utf-8-emacs)
1511 ("\\.el\\'" . utf-8) 1523 ("\\.el\\'" . prefer-utf-8)
1512 ("\\.utf\\(-8\\)?\\'" . utf-8) 1524 ("\\.utf\\(-8\\)?\\'" . utf-8)
1513 ("\\.xml\\'" . xml-find-file-coding-system) 1525 ("\\.xml\\'" . xml-find-file-coding-system)
1514 ;; We use raw-text for reading loaddefs.el so that if it 1526 ;; We use raw-text for reading loaddefs.el so that if it