From 1b796d6b24b3a7f56a2dffd8d2bbe9c0559a1b80 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 13 Jul 2013 13:55:21 +0300 Subject: [PATCH] Improve the documentation of prefer-utf-8 and related issues. lisp/international/mule.el (define-coding-system): Doc fix. etc/NEWS: Document prefer-utf-8 coding-system and the new attributes :inhibit-null-byte-detection, :inhibit-iso-escape-detection, and :prefer-utf-8. --- etc/ChangeLog | 6 ++++++ etc/NEWS | 29 +++++++++++++++++++++++++++++ lisp/ChangeLog | 2 ++ lisp/international/mule.el | 24 ++++++++++++------------ 4 files changed, 49 insertions(+), 12 deletions(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index 84c5941e33f..02b13e12945 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,9 @@ +2013-07-13 Eli Zaretskii + + * NEWS: Document prefer-utf-8 and the new attributes + :inhibit-null-byte-detection, :inhibit-iso-escape-detection, and + :prefer-utf-8. + 2013-07-13 Leo Liu * NEWS: Mention new value for ido-use-virtual-buffers. diff --git a/etc/NEWS b/etc/NEWS index c3be0dfb9d4..03174a0137f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -599,6 +599,35 @@ Emacs uses `image-default-frame-delay'. *** New functions `image-current-frame' and `image-show-frame' for getting and setting the current frame of a multi-frame image. +** Changes in encoding and decoding of text + +--- +*** New coding-system `prefer-utf-8'. +This is like `undecided' but prefers UTF-8 on decoding if the text to +be decoded does not contain any invalid UTF-8 sequences. On encoding, +any non-ASCII characters are automatically encoded as UTF-8. + +--- +*** New attributes of coding-systems whose type is `undecided'. +Two new attributes, `:inhibit-null-byte-detection' and +`:inhibit-iso-escape-detection', determine how to detect encoding of +text that includes null bytes and ISO-2022 escape sequences, +respectively. Each of these attributes can be either nil, zero, or +t. If it is t, decoding text ignores null bytes and, respectively, +ISO-2022 sequences. If it is nil, null bytes cause text to be decoded +with no-conversion and ISO-2022 sequences cause Emacs to assume the +text is encoded in one of the ISO-2022 encodings, such as +iso-2022-7bit. If the value is zero, Emacs consults the variables +inhibit-null-byte-detection and inhibit-iso-escape-detection, which +see. +The new attribute `:prefer-utf-8', if non-nil, causes Emacs to prefer +UTF-8 encoding and decoding, whenever possible. + +These attributes are only meaningful for coding-systems of type +`undecided'. (The type of a coding-system is determined by its +`:coding-type' attribute and can be accessed by calling the +`coding-system-type' function.) + ** The function `set-visited-file-modtime' now accepts a 0 or -1 argument with the same interpretation as the returned value of `visited-file-modtime'. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4bfc800913a..1c01afd8576 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2013-07-13 Eli Zaretskii + * international/mule.el (define-coding-system): Doc fix. + * simple.el (default-font-height): Don't call font-info if the frame's default font didn't change since the frame was created. (Bug#14838) diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 3577e0e9152..28542835a5f 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -672,7 +672,7 @@ is unsuitable for the top-level media type \"text\". VALUE must be a list of symbols that control the ISO-2022 converter. Each must be a member of the list `coding-system-iso-2022-flags' -\(which see). This attribute has a meaning only when `:coding-type' +\(which see). This attribute is meaningful only when `:coding-type' is `iso-2022'. `:designation' @@ -692,7 +692,7 @@ to GN. If the list contains 96, any charsets whose whose ranges are 96 long can be designated to GN. If the first element is a charset, that charset is initially designated to GN. -This attribute has a meaning only when `:coding-type' is `iso-2022'. +This attribute is meaningful only when `:coding-type' is `iso-2022'. `:bom' @@ -712,7 +712,7 @@ are 0xFF 0xFE, use the cdr part coding system of the value. Otherwise, treat them as bytes for a normal character. On encoding, produce BOM bytes according to the value of `:endian'. -This attribute has a meaning only when `:coding-type' is `utf-16' or +This attribute is meaningful only when `:coding-type' is `utf-16' or `utf-8'. `:endian' @@ -720,37 +720,37 @@ This attribute has a meaning only when `:coding-type' is `utf-16' or VALUE must be `big' or `little' specifying big-endian and little-endian respectively. The default value is `big'. -This attribute has a meaning only when `:coding-type' is `utf-16'. +This attribute is meaningful only when `:coding-type' is `utf-16'. `:ccl-decoder' VALUE is a symbol representing the registered CCL program used for -decoding. This attribute has a meaning only when `:coding-type' is +decoding. This attribute is meaningful only when `:coding-type' is `ccl'. `:ccl-encoder' VALUE is a symbol representing the registered CCL program used for -encoding. This attribute has a meaning only when `:coding-type' is +encoding. This attribute is meaningful only when `:coding-type' is `ccl'. -:inhibit-null-byte-detection +`:inhibit-null-byte-detection' VALUE non-nil means Emacs ignore null bytes on code detection. See the variable `inhibit-null-byte-detection'. This attribute -has a meaning only when `:coding-type' is `undecided'. +is meaningful only when `:coding-type' is `undecided'. -:inhibit-iso-escape-detection +`:inhibit-iso-escape-detection' VALUE non-nil means Emacs ignores ISO-2022 escape sequences on code detection. See the variable `inhibit-iso-escape-detection'. -This attribute has a meaning only when `:coding-type' is +This attribute is meaningful only when `:coding-type' is `undecided'. -:prefer-utf-8 +`:prefer-utf-8' VALUE non-nil means Emacs prefers UTF-8 on code detection for -non-ASCII files. This attribute has a meaning only when +non-ASCII files. This attribute is meaningful only when `:coding-type' is `undecided'." (let* ((common-attrs (mapcar 'list '(:mnemonic -- 2.11.4.GIT