Merge from emacs-23
[bpt/emacs.git] / lisp / international / mule-conf.el
index 3e26989..c0a3932 100644 (file)
@@ -1,8 +1,8 @@
 ;;; mule-conf.el --- configure multilingual environment
 
 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-;;   2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
-;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+;;   2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011  Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
 ;;   Registration Number H14PRO021
 ;; Copyright (C) 2003
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -24,9 +24,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
 ;;   :ascii-compatible-p t
 ;;   :code-offset 0)
 ;;
+;; (define-charset 'emacs
+;;   ""
+;;   :dimension 3
+;;   :code-space [0 255 0 255 0 63]
+;;   :ascii-compatible-p t
+;;   :supplementary-p t
+;;   :code-offset 0)
+;;
 ;; (define-charset 'eight-bit
 ;;   ""
 ;;   :dimension 1
  'unicode :short-name "Unicode")
 (put-charset-property
  'unicode :long-name "Unicode (ISO10646)")
-(put-charset-property 'eight-bit :docstring "Raw bytes 0-255")
+(put-charset-property
+ 'emacs :docstring "Full Emacs charset (excluding eight bit chars)")
+(put-charset-property
+ 'emacs :short-name "Emacs")
+(put-charset-property
+ 'emacs :long-name "Emacs")
+
+(put-charset-property 'eight-bit :docstring "Raw bytes 128-255")
 (put-charset-property 'eight-bit :short-name "Raw bytes")
 
 (define-charset-alias 'ucs 'unicode)
 
-(define-charset 'emacs
-  "Full Emacs characters"
-  :ascii-compatible-p t
-  :code-space [ 0 255 0 255 0 63 ]
-  :code-offset 0
-  :supplementary-p t)
-
 (define-charset 'latin-iso8859-1
   "Right-Hand Part of ISO/IEC 8859/1 (Latin-1): ISO-IR-100"
   :short-name "RHP of Latin-1"
   :code-offset #x27c218                        ; ... #x280839
   :unify-map "BIG5-HKSCS")
 
-;; Fixme: Korean cp949/UHC
+(define-charset 'cp949-2-byte
+  "2-byte part of CP949"
+  :dimension 2
+  :map "CP949-2BYTE"
+  :code-space [#x41 #xFE #x81 #xFD]
+  :supplementary-p t)
+
+(define-charset 'cp949
+  "CP949 (Korean)"
+  :short-name "CP949"
+  :long-name  "CP949 (Korean)"
+  :code-space [#x00 #xFE #x00 #xFD]
+  :superset '(ascii cp949-2-byte))
 
 (define-charset 'chinese-sisheng
   "SiSheng characters for PinYin/ZhuYin"
   "Raw text, which means text contains random 8-bit codes.
 Encoding text with this coding system produces the actual byte
 sequence of the text in buffers and strings.  An exception is made for
-eight-bit-control characters.  Each of them is encoded into a single
-byte.
+characters from the `eight-bit' character set.  Each of them is encoded
+into a single byte.
 
 When you visit a file with this coding, the file is read into a
 unibyte buffer as is (except for EOL format), thus each byte of a file
@@ -1227,7 +1245,7 @@ is treated as a character."
   :coding-type 'raw-text
   :eol-type 'unix
   :mnemonic ?=)
-  
+
 (define-coding-system 'iso-latin-1
   "ISO 2022 based 8-bit encoding for Latin-1 (MIME:ISO-8859-1)."
   :coding-type 'charset
@@ -1247,12 +1265,26 @@ is treated as a character."
  :mnemonic ?M)
 
 (define-coding-system 'utf-8
-  "UTF-8."
+  "UTF-8 (no signature (BOM))"
   :coding-type 'utf-8
   :mnemonic ?U
   :charset-list '(unicode)
   :mime-charset 'utf-8)
 
+(define-coding-system 'utf-8-with-signature
+  "UTF-8 (with signature (BOM))"
+  :coding-type 'utf-8
+  :mnemonic ?U
+  :charset-list '(unicode)
+  :bom t)
+
+(define-coding-system 'utf-8-auto
+  "UTF-8 (auto-detect signature (BOM))"
+  :coding-type 'utf-8
+  :mnemonic ?U
+  :charset-list '(unicode)
+  :bom '(utf-8-with-signature . utf-8))
+
 (define-coding-system-alias 'mule-utf-8 'utf-8)
 
 (define-coding-system 'utf-8-emacs
@@ -1261,6 +1293,11 @@ is treated as a character."
   :mnemonic ?U
   :charset-list '(emacs))
 
+;; The encoding used internally.  This encoding is meant to be able to save
+;; any multibyte buffer without losing information.  It can change between
+;; Emacs releases, tho, so should only be used for internal files.
+(define-coding-system-alias 'emacs-internal 'utf-8-emacs-unix)
+
 (define-coding-system 'utf-16le
   "UTF-16LE (little endian, no signature (BOM))."
   :coding-type 'utf-16
@@ -1290,7 +1327,7 @@ is treated as a character."
   :mime-charset 'utf-16)
 
 (define-coding-system 'utf-16be-with-signature
-  "UTF-16 (big endian, with signature)."
+  "UTF-16 (big endian, with signature (BOM))."
   :coding-type 'utf-16
   :mnemonic ?U
   :charset-list '(unicode)
@@ -1373,9 +1410,10 @@ is treated as a character."
   :flags '(ascii-at-eol ascii-at-cntl designation single-shift composition))
 
 (define-coding-system 'compound-text
-  "Compound text based generic encoding for decoding unknown messages.
-
-This coding system does not support extended segments of CTEXT."
+  "Compound text based generic encoding.
+This coding system is an extension of X's \"Compound Text Encoding\".
+It encodes many characters using the normal ISO-2022 designation sequences,
+but it doesn't support extended segments of CTEXT."
   :coding-type 'iso-2022
   :mnemonic ?x
   :charset-list 'iso-2022
@@ -1395,7 +1433,7 @@ This coding system does not support extended segments of CTEXT."
 ;; not have a mime-charset property, to prevent it from showing up
 ;; close to the beginning of coding systems ordered by priority.
 (define-coding-system 'ctext-no-compositions
- "Compound text based generic encoding for decoding unknown messages.
+ "Compound text based generic encoding.
 
 Like `compound-text', but does not produce escape sequences for compositions."
   :coding-type 'iso-2022
@@ -1408,8 +1446,9 @@ Like `compound-text', but does not produce escape sequences for compositions."
 (define-coding-system 'compound-text-with-extensions
  "Compound text encoding with ICCCM Extended Segment extensions.
 
-See the variable `ctext-non-standard-encodings-alist' for the
-detail about how extended segments are handled.
+See the variables `ctext-standard-encodings' and
+`ctext-non-standard-encodings-alist' for the detail about how
+extended segments are handled.
 
 This coding system should be used only for X selections.  It is inappropriate
 for decoding and encoding files, process I/O, etc."
@@ -1467,6 +1506,7 @@ for decoding and encoding files, process I/O, etc."
 ;; Tar files are not decoded at all, but we treat them as raw bytes.
 
 (setq file-coding-system-alist
+      (mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg)))
       '(("\\.elc\\'" . utf-8-emacs)
        ("\\.utf\\(-8\\)?\\'" . utf-8)
        ("\\.xml\\'" . xml-find-file-coding-system)
@@ -1479,7 +1519,7 @@ for decoding and encoding files, process I/O, etc."
        ("\\.tar\\'" . (no-conversion . no-conversion))
        ( "\\.po[tx]?\\'\\|\\.po\\." . po-find-file-coding-system)
        ("\\.\\(tex\\|ltx\\|dtx\\|drv\\)\\'" . latexenc-find-file-coding-system)
-       ("" . (undecided . nil))))
+       ("" . (undecided . nil)))))
 
 \f
 ;;; Setting coding categories and their priorities.
@@ -1515,9 +1555,5 @@ for decoding and encoding files, process I/O, etc."
 ;; code.
 (provide 'code-pages)
 
-;; Local variables:
-;; no-byte-compile: t
-;; End:
-
 ;; arch-tag: 7d5fed55-b6df-42f6-8d3d-0011190551f5
 ;;; mule-conf.el ends here