From d9acfbd471403a4f11ad050665633d3311a462d9 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sun, 10 May 2015 15:18:39 +0200 Subject: options: mark nonfunctional &termencoding option as hidden. #2631 Remove related dead code and references in the docs. Helped-By: Michael Reed Helped-By: Shougo Matsushita --- runtime/doc/mbyte.txt | 69 +--------------------- runtime/doc/options.txt | 35 +---------- runtime/doc/quickref.txt | 1 - runtime/doc/usr_45.txt | 27 +-------- runtime/doc/vim_diff.txt | 1 + runtime/optwin.vim | 2 - runtime/syntax/vim.vim | 4 +- src/nvim/globals.h | 5 -- src/nvim/mbyte.c | 18 +----- src/nvim/option.c | 12 +--- src/nvim/option_defs.h | 1 - src/nvim/po/zh_TW.UTF-8.po | 1 - src/nvim/po/zh_TW.po | 1 - .../legacy/044_099_regexp_multibyte_magic_spec.lua | 2 +- 14 files changed, 14 insertions(+), 165 deletions(-) diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt index 2a5ccc626e..8189ec5b38 100644 --- a/runtime/doc/mbyte.txt +++ b/runtime/doc/mbyte.txt @@ -100,8 +100,7 @@ See 'fileencoding', 'fileencodings' and |++enc|. DISPLAY AND FONTS If you are working in a terminal (emulator) you must make sure it accepts the -same encoding as which Vim is working with. If this is not the case, you can -use the 'termencoding' option to make Vim convert text automatically. +same encoding as which Vim is working with. For the GUI you must select fonts that work with the current 'encoding'. This is the difficult part. It depends on the system you are using, the locale and @@ -379,62 +378,11 @@ or when conversion is not possible: cp932, shift-jis, sjis cp936, euc-cn - *encoding-table* -Normally 'encoding' is equal to your current locale and 'termencoding' is -empty. This means that your keyboard and display work with characters encoded -in your current locale, and Vim uses the same characters internally. - -You can make Vim use characters in a different encoding by setting the -'encoding' option to a different value. Since the keyboard and display still -use the current locale, conversion needs to be done. The 'termencoding' then -takes over the value of the current locale, so Vim converts between 'encoding' -and 'termencoding'. Example: > - :let &termencoding = &encoding - :set encoding=utf-8 - -However, not all combinations of values are possible. The table below tells -you how each of the nine combinations works. This is further restricted by -not all conversions being possible, iconv() being present, etc. Since this -depends on the system used, no detailed list can be given. - -('tenc' is the short name for 'termencoding' and 'enc' short for 'encoding') - -'tenc' 'enc' remark ~ - - 8bit 8bit Works. When 'termencoding' is different from - 'encoding' typing and displaying may be wrong for some - characters, Vim does NOT perform conversion (set - 'encoding' to "utf-8" to get this). - 8bit 2byte MS-Windows: works for all codepages installed on your - system; you can only type 8bit characters; - Other systems: does NOT work. - 8bit Unicode Works, but only 8bit characters can be typed directly - (others through digraphs, keymaps, etc.); in a - terminal you can only see 8bit characters; the GUI can - show all characters that the 'guifont' supports. - - 2byte 8bit Works, but typing non-ASCII characters might - be a problem. - 2byte 2byte MS-Windows: works for all codepages installed on your - system; typing characters might be a problem when - locale is different from 'encoding'. - Other systems: Only works when 'termencoding' is equal - to 'encoding', you might as well leave it empty. - 2byte Unicode works, Vim will translate typed characters. - - Unicode 8bit works (unusual) - Unicode 2byte does NOT work - Unicode Unicode works very well (leaving 'termencoding' empty works - the same way, because all Unicode is handled - internally as UTF-8) - CONVERSION *charset-conversion* Vim will automatically convert from one to another encoding in several places: - When reading a file and 'fileencoding' is different from 'encoding' - When writing a file and 'fileencoding' is different from 'encoding' -- When displaying characters and 'termencoding' is different from 'encoding' -- When reading input and 'termencoding' is different from 'encoding' - When displaying messages and the encoding used for LC_MESSAGES differs from 'encoding' (requires a gettext version that supports this). - When reading a Vim script where |:scriptencoding| is different from @@ -507,17 +455,6 @@ For example, you can run Vim in a xterm with added multi-byte support and/or |XIM|. Examples are kterm (Kanji term) and hanterm (for Korean), Eterm (Enlightened terminal) and rxvt. -If your terminal does not support the right encoding, you can set the -'termencoding' option. Vim will then convert the typed characters from -'termencoding' to 'encoding'. And displayed text will be converted from -'encoding' to 'termencoding'. If the encoding supported by the terminal -doesn't include all the characters that Vim uses, this leads to lost -characters. This may mess up the display. If you use a terminal that -supports Unicode, such as the xterm mentioned below, it should work just fine, -since nearly every character set can be converted to Unicode without loss of -information. - - UTF-8 IN XFREE86 XTERM *UTF8-xterm* This is a short explanation of how to use UTF-8 character encoding in the @@ -1368,10 +1305,6 @@ If your system does not provide support for typing utf-8, you can use the 'keymap' feature. This allows writing a keymap file, which defines a utf-8 character as a sequence of ASCII characters. See |mbyte-keymap|. -Another method is to set the current locale to the language you want to use -and for which you have a XIM available. Then set 'termencoding' to that -language and Vim will convert the typed characters to 'encoding' for you. - If everything else fails, you can type any character as four hex bytes: > CTRL-V u 1234 diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 9aeeaec46a..46f93d4ea0 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2323,9 +2323,7 @@ A jump table for the options with a short description can be found at |Q_op|. if has("multi_byte_encoding") < Normally 'encoding' will be equal to your current locale. This will - be the default if Vim recognizes your environment settings. If - 'encoding' is not set to the current locale, 'termencoding' must be - set to convert typed and displayed text. See |encoding-table|. + be the default if Vim recognizes your environment settings. When you set this option, it fires the |EncodingChanged| autocommand event so that you can set up fonts if necessary. @@ -6569,36 +6567,7 @@ A jump table for the options with a short description can be found at |Q_op|. For further details see |arabic.txt|. *'termencoding'* *'tenc'* -'termencoding' 'tenc' string (default ""; with GTK+ 2 GUI: "utf-8"; with - Macintosh GUI: "macroman") - global - {only available when compiled with the |+multi_byte| - feature} - Encoding used for the terminal. This specifies what character - encoding the keyboard produces and the display will understand. For - the GUI it only applies to the keyboard ( 'encoding' is used for the - display). - In the Win32 console version the default value is the console codepage - when it differs from the ANSI codepage. - *E617* - Note: This does not apply to the GTK+ 2 GUI. After the GUI has been - successfully initialized, 'termencoding' is forcibly set to "utf-8". - Any attempts to set a different value will be rejected, and an error - message is shown. - For the Win32 GUI 'termencoding' is not used for typed characters, - because the Win32 system always passes Unicode characters. - When empty, the same encoding is used as for the 'encoding' option. - This is the normal value. - Not all combinations for 'termencoding' and 'encoding' are valid. See - |encoding-table|. - The value for this option must be supported by internal conversions or - iconv(). When this is not possible no conversion will be done and you - will probably experience problems with non-ASCII characters. - Example: You are working with the locale set to euc-jp (Japanese) and - want to edit a UTF-8 file: > - :let &termencoding = &encoding - :set encoding=utf-8 -< You need to do this when your system has no locale support for UTF-8. +'termencoding' 'tenc' Removed. |vim-differences| {Nvim} *'terse'* *'noterse'* 'terse' boolean (default off) diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index 0e53099c5d..5daeb15c00 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -888,7 +888,6 @@ Short explanation of each option: *option-list* 'tagstack' 'tgst' push tags onto the tag stack 'term' name of the terminal 'termbidi' 'tbidi' terminal takes care of bi-directionality -'termencoding' 'tenc' character encoding used by the terminal 'terse' shorten some messages 'textwidth' 'tw' maximum width of text that is being inserted 'thesaurus' 'tsr' list of thesaurus files for keyword completion diff --git a/runtime/doc/usr_45.txt b/runtime/doc/usr_45.txt index 828ea6fe2d..3ba2d47cd0 100644 --- a/runtime/doc/usr_45.txt +++ b/runtime/doc/usr_45.txt @@ -198,19 +198,7 @@ you can find it here: http://www.microsoft.com/typography/fonts/default.aspx ~ Now you have told Vim to use Unicode internally and display text with a -Unicode font. Typed characters still arrive in the encoding of your original -language. This requires converting them to Unicode. Tell Vim the language -from which to convert with the 'termencoding' option. You can do it like -this: > - - :let &termencoding = &encoding - :set encoding=utf-8 - -This assigns the old value of 'encoding' to 'termencoding' before setting -'encoding' to utf-8. You will have to try out if this really works for your -setup. It should work especially well when using an input method for an Asian -language, and you want to edit Unicode text. - +Unicode font. USING UNICODE IN A UNICODE TERMINAL @@ -232,18 +220,9 @@ USING UNICODE IN AN ORDINARY TERMINAL Suppose you want to work with Unicode files, but don't have a terminal with Unicode support. You can do this with Vim, although characters that are not supported by the terminal will not be displayed. The layout of the text -will be preserved. > - - :let &termencoding = &encoding - :set encoding=utf-8 +will be preserved. -This is the same as what was used for the GUI. But it works differently: Vim -will convert the displayed text before sending it to the terminal. That -avoids that the display is messed up with strange characters. - For this to work the conversion between 'termencoding' and 'encoding' must -be possible. Vim will convert from latin1 to Unicode, thus that always works. -For other conversions the |+iconv| feature is required. - Try editing a file with Unicode characters in it. You will notice that Vim +Try editing a file with Unicode characters in it. You will notice that Vim will put a question mark (or underscore or some other character) in places where a character should be that the terminal can't display. Move the cursor to a question mark and use this command: > diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 20653f03bc..ac32c9d52c 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -115,6 +115,7 @@ Other options: 'macatsui' 'shortname' 'shelltype' + 'termencoding' 'textauto' 'textmode' diff --git a/runtime/optwin.vim b/runtime/optwin.vim index 8a9fb72f3d..986d445b30 100644 --- a/runtime/optwin.vim +++ b/runtime/optwin.vim @@ -1180,8 +1180,6 @@ if has("multi_byte") call OptionL("fenc") call append("$", "fileencodings\tautomatically detected character encodings") call OptionG("fencs", &fencs) - call append("$", "termencoding\tcharacter encoding used by the terminal") - call OptionG("tenc", &tenc) call append("$", "charconvert\texpression used for character encoding conversion") call OptionG("ccv", &ccv) call append("$", "delcombine\tdelete combining (composing) characters on their own") diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 3e5bf5ff59..57a609e917 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -27,11 +27,11 @@ syn match vimCommand contained "\