]> git.eshelyaron.com Git - emacs.git/commitdiff
Use Enriched mode in etc/HELLO to keep charset information
authorEli Zaretskii <eliz@gnu.org>
Sat, 19 May 2018 15:17:38 +0000 (18:17 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 19 May 2018 15:17:38 +0000 (18:17 +0300)
This allows to encode HELLO in UTF-8, thus supporting the entire
repertory of Unicode, while still keeping the charset info where
that is important.  Suggested by Michael Welsh Duggan <mwd@md5i.com>.
* lisp/textmodes/enriched.el (enriched-translations): Add
translations for 'charset'.
(enriched-decode-charset, enriched-handle-charset-prop): New
functions.
* lisp/facemenu.el (facemenu-special-menu): Add sub-menu for
'charset' property.
(facemenu-set-charset): New function.
(facemenu-remove-special): Remove the 'charset' property as well.

* etc/NEWS: Announce the new feature of Enriched mode.
* etc/HELLO: Recode in UTF-8 and place under Enriched mode.

* doc/emacs/text.texi (Enriched Properties): Mention the support
for 'charset'.

doc/emacs/text.texi
etc/HELLO
etc/NEWS
etc/enriched.txt
lisp/facemenu.el
lisp/textmodes/enriched.el

index 6a5fc7c6f6351adb4be8b6504c9726a18822edd3..1e96163105b64eedf5e848f2c87496e3069ec095 100644 (file)
@@ -2416,11 +2416,13 @@ to the commands above.
 @subsection Setting Other Text Properties
 
   The Special Properties submenu of Text Properties has entries for
-adding or removing three other text properties: @code{read-only},
+adding or removing four other text properties: @code{read-only},
 (which disallows alteration of the text), @code{invisible} (which
-hides text), and @code{intangible} (which disallows moving point
-within the text).  The @samp{Remove Special} menu item removes all of
-these special properties from the text in the region.
+hides text), @code{intangible} (which disallows moving point within
+the text), and @code{charset} (which is important for selecting a
+proper font to display a character).  The @samp{Remove Special} menu
+item removes all of these special properties from the text in the
+region.
 
   The @code{invisible} and @code{intangible} properties are not saved.
 
index 2c95e211369b25490025729038968817cfd0ff3d..f415ec088bf1082c665ac62b49ec264cdb837fbc 100644 (file)
--- a/etc/HELLO
+++ b/etc/HELLO
+Content-Type: text/enriched
+Text-Width: 70
+
 This is a list of ways to say hello in various languages.
 It is not intended to be comprehensive, but to demonstrate
 some of the character sets that Emacs supports.
 
+
 Non-ASCII examples:
-  Europe: \e,A!\e(BHola!, Gr\e,A|_\e(B Gott, Hyv\e,Add\e(B p\e,Ad\e(Biv\e,Add\e(B, Tere \e,Au\e(Bhtust, Bon\e,Cu\e(Bu
-          Cze\e,B6f\e(B!, Dobr\e,B}\e(B den, \e,L7T`PRabRcYbU\e(B!, \e,FCei\\e(B \e,Fsar\e(B, \e$,1J2J0J;J0J@JOJ=J1J0\e(B
-  Africa: \e$(3!A!,!>\e(B
-  Middle/Near East: \e,Hylem\e(B, \e$,1-g.$-s.1.$-g.%\e(B \e$,1-y.$.*.#.%\e(B
-  South Asia: \e$,19h9n9x:-9d:'\e(B, \e$,15h5n5x6-5d6'\e(B, \e$,1?(?.?8?M>u?>?0\e(B, \e$,1@H@N@X@m@5@^@P@"\e(B, \e$,1;6;A;#;?;,;G\e(B,
-              \e$,1AFAzB4AvB=B AqB*\e(B, \e$,1<U<C<5<m<5<N<m\e(B, \e$,1=h=n=x>-=U=~=p=B\e(B, \e$(7"7"!#C!;"E"S"G!;"7"2"[!;"D"["#"G!>\e(B
-  South East Asia: \e$,1\'\f\:\V\4\?\]\:\e(B, \e(1JP:R-4U\e(B, \e$,1H9H$HZHYH"H<HLH5HK\e(B, \e,TJGQJ4U$CQ:\e(B, Ch\e,1`\e(Bo b\e,1U\e(Bn
-  East Asia: \e$ADc:C\e(B, \e$(0*/=(\e(B, \e$B$3$s$K$A$O\e(B, \e$(C>H3gGO<<?d\e(B
-  Misc: E\e,C6\e(Bo\e,C~\e(Ban\e,Cx\e(Bo \e,Cf\e(Biu\e,C<\e(Ba\e,C}\e(Bde, \e$,2(3(1('('(5\e(B, \e$,1x \e(B p \e$,1x(\e(B world \e$,1s"\e(B hello p  \e$,2!a\e(B
-  CJK variety: GB(\e$AT*Fx\e(B,\e$A?*7"\e(B), BIG5(\e$(0&x86\e(B,\e$(0DeBv\e(B), JIS(\e$B855$\e(B,\e$B3+H/\e(B), KSC(\e$(Cj*Q(\e(B,\e$(CKR[!\e(B)
-  Unicode charset: E\e$,1 E\e(Bo\e$,1 }\e(Ban\e$,1 =\e(Bo \e$,1 )\e(Biu\e$,1 U\e(Ba\e$,1!-\e(Bde, \e$,1&s'5'9',\e(B \e$,1'C'1'B\e(B, \e$,1-),|,u,}\e(B, \e$,1(7(T(`(P(R(a(b(R(c(Y(b(U\e(B!
+  Europe: <x-charset><param>latin-iso8859-1</param>¡Hola!, Grüß Gott, Hyvää päivää, Tere õhtust, Bon</x-charset><x-charset><param>latin-iso8859-3</param>ġu
+          Cze</x-charset><x-charset><param>latin-iso8859-2</param>ść!, Dobrý den, </x-charset><x-charset><param>cyrillic-iso8859-5</param>Здравствуйте!, </x-charset><x-charset><param>greek-iso8859-7</param>Γειά σας, </x-charset><x-charset><param>mule-unicode-0100-24ff</param>გამარჯობა
+  Africa: </x-charset><x-charset><param>ethiopic</param>ሠላም
+  Middle/Near East: </x-charset><x-charset><param>hebrew-iso8859-8</param>שלום, </x-charset><x-charset><param>mule-unicode-0100-24ff</param>السّلام عليكم
+  South Asia: નમસ્તે, नमस्ते, ನಮಸ್ಕಾರ, നമസ്കാരം, ଶୁଣିବେ,
+              ආයුබෝවන්, வணக்கம், నమస్కారం, </x-charset><x-charset><param>tibetan</param>བཀྲ་ཤིས་བདེ་ལེགས༎
+  South East Asia: </x-charset><x-charset><param>mule-unicode-0100-24ff</param>ជំរាបសួរ, </x-charset><x-charset><param>lao</param>ສະບາຍດີ, </x-charset><x-charset><param>mule-unicode-0100-24ff</param>မင်္ဂလာပါ, </x-charset><x-charset><param>thai-tis620</param>สวัสดีครับ, Ch</x-charset><x-charset><param>vietnamese-viscii-lower</param>ào bạn
+  East Asia: </x-charset><x-charset><param>chinese-gb2312</param>你好, </x-charset><x-charset><param>chinese-big5-1</param>早晨, </x-charset><x-charset><param>japanese-jisx0208</param>こんにちは, </x-charset><x-charset><param>korean-ksc5601</param>안녕하세요
+  Misc: E</x-charset><x-charset><param>latin-iso8859-3</param>ĥoŝanĝo ĉiuĵaŭde, </x-charset><x-charset><param>mule-unicode-2500-33ff</param>⠓⠑⠇⠇⠕, </x-charset><x-charset><param>mule-unicode-0100-24ff</param>∀ p ∈ world • hello p  </x-charset><x-charset><param>mule-unicode-2500-33ff</param>□
+  CJK variety: GB(</x-charset><x-charset><param>chinese-gb2312</param>元气,开发), BIG5(</x-charset><x-charset><param>chinese-big5-1</param>元氣,開發), JIS(</x-charset><x-charset><param>japanese-jisx0208</param>元気,開発), KSC(</x-charset><x-charset><param>korean-ksc5601</param>元氣,開發)
+  Unicode charset: E</x-charset><x-charset><param>mule-unicode-0100-24ff</param>ĥoŝanĝo ĉiuĵaŭde, Γειά σας, שלום, Здравствуйте!
+
 
 LANGUAGE (NATIVE NAME) HELLO
 ---------------------- -----
-Amharic (\e$,1O M[MmN{\e(B)      \e$,1M`MKM]\e(B
-Arabic (\e$,1-g.$-y-q-h.*.1-i\e(B)       \e$,1-g.$-s.1.$-g.%\e(B \e$,1-y.$.*.#.%\e(B
-Armenian (\e$,1+p+a+u+e, +e+v\e(B)       \e$,1+2+a, ,'\e(B \e$,1+q+e+f\e(B
-Bengali (\e$,17,7>6b727>\e(B)    \e$,17(7.787M6u7>70\e(B
-Braille        \e$,2(3(1('('(5\e(B
-Burmese (\e$,1H9H\H4HZH9HL\e(B)  \e$,1H9H$HZHYH"H<HLH5HK\e(B
+Amharic (አማርኛ) ሠላም
+Arabic (العربيّة)      السّلام عليكم
+Armenian (հայերեն)      Բարև ձեզ
+Bengali (বাংলা)      নমস্কার
+Braille        </x-charset><x-charset><param>mule-unicode-2500-33ff</param>⠓⠑⠇⠇⠕
+Burmese (</x-charset><x-charset><param>mule-unicode-0100-24ff</param>မြန်မာ)       မင်္ဂလာပါ
 C      printf ("Hello, world!\n");
-Czech (\e,Bh\e(Be\e,B9\e(Btina)    Dobr\e,A}\e(B den
-Danish (dansk) Hej / Goddag / Hall\e,Ax\e(Bj
+Czech (</x-charset><x-charset><param>latin-iso8859-2</param>čeština) Dobr</x-charset><x-charset><param>latin-iso8859-1</param>ý den
+Danish (dansk) Hej / Goddag / Halløj
 Dutch (Nederlands)     Hallo / Dag
 Emacs  emacs --no-splash -f view-hello-file
-English /\e$(O+S\e,0!\e,D?\e$(O*y\e(Bl\e,0!\e$(O*h\e(B/        Hello
-Esperanto      Saluton (E\e,C6\e(Bo\e,C~\e(Ban\e,Cx\e(Bo \e,Cf\e(Biu\e,C<\e(Ba\e,C}\e(Bde)
-Estonian (eesti keel)  Tere p\e,Ad\e(Bevast / Tere \e,Au\e(Bhtust
-Finnish (suomi)        Hei / Hyv\e,Add\e(B p\e,Ad\e(Biv\e,Add\e(B
-French (fran\e,Ag\e(Bais)        Bonjour / Salut
-Georgian (\e$,1JEJ0J@J7J5J4J:J8\e(B)     \e$,1J2J0J;J0J@JOJ=J1J0\e(B
-German (Deutsch)       Guten Tag / Gr\e,A|_\e(B Gott
-Greek (\e,Fekkgmij\\e(B) \e,FCei\\e(B \e,Fsar\e(B
-Greek, ancient (\e$,1p1\e,Fkkgmij^\e(B)   \e,FO\e$,1pv\e,Fk]\e(B \e,Fte\e(B \e,Fja\e$,1q6\e(B \e,Fl]ca\e(B \e,Fwa\e$,1r6\e,Fqe\e(B
-Gujarati (\e$,19W:!9\9p9~9d: \e(B)       \e$,19h9n9x:-9d:'\e(B
-Hebrew (\e$,1-",q-(,y-*\e(B)     \e,Hylem\e(B
-Hungarian (magyar)     Sz\e,Bi\e(Bp j\e,Bs\e(B napot!
-Hindi (\e$,15y5\7f5B5f6 \e(B)      \e$,15h5n5x6-5d6'\e(B / \e$,15h5n5x6-5U5~5p\e(B \e$,16D\e(B
+
+Emoji  </x-charset><x-charset><param>unicode</param>👋
+</x-charset><x-charset><param>latin-iso8859-1</param>English /</x-charset><x-charset><param>japanese-jisx0213-1</param>ˈ</x-charset><x-charset><param>ipa</param>ɪ</x-charset><x-charset><param>latin-iso8859-4</param>ŋ</x-charset><x-charset><param>japanese-jisx0213-1</param>ɡl</x-charset><x-charset><param>ipa</param>ɪ</x-charset><x-charset><param>japanese-jisx0213-1</param>ʃ/ Hello
+Esperanto      Saluton (E</x-charset><x-charset><param>latin-iso8859-3</param>ĥoŝanĝo ĉiuĵaŭde)
+Estonian (eesti keel)  Tere p</x-charset><x-charset><param>latin-iso8859-1</param>äevast / Tere õhtust
+Finnish (suomi)        Hei / Hyvää päivää
+French (français)     Bonjour / Salut
+Georgian (</x-charset><x-charset><param>mule-unicode-0100-24ff</param>ქართველი)        გამარჯობა
+German (Deutsch)       Guten Tag / Gr</x-charset><x-charset><param>latin-iso8859-1</param>üß Gott
+Greek (</x-charset><x-charset><param>greek-iso8859-7</param>ελληνικά)  Γειά σας
+Greek, ancient (</x-charset><x-charset><param>mule-unicode-0100-24ff</param>ἑ</x-charset><x-charset><param>greek-iso8859-7</param>λληνική)    Ο</x-charset><x-charset><param>mule-unicode-0100-24ff</param>ὖ</x-charset><x-charset><param>greek-iso8859-7</param>λέ τε κα</x-charset><x-charset><param>mule-unicode-0100-24ff</param>ὶ </x-charset><x-charset><param>greek-iso8859-7</param>μέγα χα</x-charset><x-charset><param>mule-unicode-0100-24ff</param>ῖ</x-charset><x-charset><param>greek-iso8859-7</param>ρε
+Gujarati (</x-charset><x-charset><param>mule-unicode-0100-24ff</param>ગુજરાતી)   નમસ્તે
+Hebrew </x-charset><x-charset><param>hebrew-iso8859-8</param>(עברית)</x-charset><x-charset><param>mule-unicode-0100-24ff</param>  </x-charset><x-charset><param>hebrew-iso8859-8</param>שלום
+Hungarian (magyar)     Sz</x-charset><x-charset><param>latin-iso8859-2</param>ép jó napot!
+Hindi (</x-charset><x-charset><param>mule-unicode-0100-24ff</param>हिंदी)    नमस्ते / नमस्कार ।
 Italian (italiano)     Ciao / Buon giorno
 Javanese (Jawa)        System.out.println("Sugeng siang!");
-Kannada (\e$,1>u?(?M?(?!\e(B)    \e$,1?(?.?8?M>u?>?0\e(B
-Khmer (\e$,1\7\V\?\V\!\r\8\b\:\e(B)      \e$,1\'\f\:\V\4\?\]\:\e(B
-Lao (\e(1>RJRERG\e(B)    \e(1JP:R-4U\e(B / \e(1"mcKib*!4U\e(B
-Malayalam (\e$,1@N@R@O@^@S@"\e(B)        \e$,1@H@N@X@m@5@^@P@"\e(B
-Maltese (il-Malti)     Bon\e,Cu\e(Bu / Sa\e,C11\e(Ba
-Mathematics    \e$,1x \e(B p \e$,1x(\e(B world \e$,1s"\e(B hello p  \e$,2!a\e(B
-Mongolian (\e,L\^]S^[\e(B \e,Lem[\e(B)     \e,LAPY]\e(B \e,LQPY]P\e(B \e,Lcc\e(B?
+Kannada (ಕನ್ನಡ)      ನಮಸ್ಕಾರ
+Khmer (ភាសាខ្មែរ)    ជំរាបសួរ
+Lao (</x-charset><x-charset><param>lao</param>ພາສາລາວ)   ສະບາຍດີ / ຂໍໃຫ້ໂຊກດີ
+Malayalam (</x-charset><x-charset><param>mule-unicode-0100-24ff</param>മലയാളം)     നമസ്കാരം
+Maltese (il-Malti)     Bon</x-charset><x-charset><param>latin-iso8859-3</param>ġu / Saħħa
+Mathematics    </x-charset><x-charset><param>mule-unicode-0100-24ff</param>∀ p ∈ world • hello p  </x-charset><x-charset><param>mule-unicode-2500-33ff</param>□
+Mongolian (</x-charset><x-charset><param>cyrillic-iso8859-5</param>монгол хэл)        Сайн байна уу?
 Norwegian (norsk)      Hei / God dag
-Oriya (\e$,1:s;\;?:f\e(B)        \e$,1;6;A;#;?;,;G\e(B
-Polish  (j\e,Bj\e(Bzyk polski)   Dzie\e,Bq\e(B dobry! / Cze\e,B6f\e(B!
-Russian (\e,L`caaZXY\e(B)        \e,L7T`P\e$(O+Z\e,LRabRcYbU\e(B!
-Sinhala (\e$,1B#B2ABB$A}\e(B)    \e$,1AFAzB4AvB=B AqB*\e(B
-Slovak (sloven\e,Bh\e(Bina)      Dobr\e,A}\e(B de\e,Br\e(B
-Slovenian (sloven\e,B9h\e(Bina)  Pozdravljeni!
-Spanish (espa\e,Aq\e(Bol)        \e,A!\e(BHola!
-Swedish (svenska)      Hej / Goddag / Hall\e,Ae\e(B
-Tamil (\e$,1<D<N<_<T<m\e(B)      \e$,1<U<C<5<m<5<N<m\e(B
-Telugu (\e$,1=d>&=r>!=W>!\e(B)   \e$,1=h=n=x>-=U=~=p=B\e(B
-Thai (\e,T@RIRd7B\e(B)   \e,TJGQJ4U$CQ:\e(B / \e,TJGQJ4U$hP\e(B
-Tibetan (\e$(7"7"]"2!;"G#!"2!;\e(B)      \e$(7"7"!#C!;"E"S"G!;"7"2"[!;"D"["#"G!>\e(B
-Tigrigna (\e$,1NUP-MmN{\e(B)     \e$,1MpMKM[NU\e(B
-Turkish (T\e,A|\e(Brk\e,Ag\e(Be)   Merhaba
-Ukrainian (\e,LcZ`Pw]alZP\e(B)   \e,L2vbPn\e(B
-Vietnamese (ti\e,1*\e(Bng Vi\e,1.\e(Bt)    Ch\e,A`\e(Bo b\e,1U\e(Bn
-
-Japanese (\e$BF|K\8l\e(B)        \e$B$3$s$K$A$O\e(B / \e(I:]FAJ\e(B
-Chinese (\e$AVPND\e(B,\e$AFUM(;0\e(B,\e$A::So\e(B)   \e$ADc:C\e(B
-Cantonese (\e$(0GnM$\e(B,\e$(0N]0*Hd\e(B)  \e$(0*/=(\e(B, \e$(0+$)p\e(B
-Korean (\e$(CGQ1[\e(B)   \e$(C>H3gGO<<?d\e(B / \e$(C>H3gGO=J4O1n\e(B
-
-\f
+Oriya (</x-charset><x-charset><param>mule-unicode-0100-24ff</param>ଓଡ଼ିଆ)       ଶୁଣିବେ
+Polish  (j</x-charset><x-charset><param>latin-iso8859-2</param>ęzyk polski)   Dzień dobry! / Cześć!
+Russian (</x-charset><x-charset><param>cyrillic-iso8859-5</param>русский)       Здра</x-charset><x-charset><param>japanese-jisx0213-1</param>́</x-charset><x-charset><param>cyrillic-iso8859-5</param>вствуйте!
+Sinhala (</x-charset><x-charset><param>mule-unicode-0100-24ff</param>සිංහල)  ආයුබෝවන්
+Slovak (sloven</x-charset><x-charset><param>latin-iso8859-2</param>čina)      Dobr</x-charset><x-charset><param>latin-iso8859-1</param>ý de</x-charset><x-charset><param>latin-iso8859-2</param>ň
+Slovenian (slovenščina)      Pozdravljeni!
+Spanish (espa</x-charset><x-charset><param>latin-iso8859-1</param>ñol)        ¡Hola!
+Swedish (svenska)      Hej / Goddag / Hallå
+Tamil (</x-charset><x-charset><param>mule-unicode-0100-24ff</param>தமிழ்)    வணக்கம்
+Telugu (తెలుగు)    నమస్కారం
+Thai (</x-charset><x-charset><param>thai-tis620</param>ภาษาไทย)  สวัสดีครับ / สวัสดีค่ะ
+Tibetan (</x-charset><x-charset><param>tibetan</param>བོད་སྐད་)        བཀྲ་ཤིས་བདེ་ལེགས༎
+Tigrigna (</x-charset><x-charset><param>mule-unicode-0100-24ff</param>ትግርኛ)    ሰላማት
+Turkish (T</x-charset><x-charset><param>latin-iso8859-1</param>ürkçe)        Merhaba
+Ukrainian (</x-charset><x-charset><param>cyrillic-iso8859-5</param>українська)       Вітаю
+Vietnamese (ti</x-charset><x-charset><param>vietnamese-viscii-lower</param>ếng Việt)       Ch</x-charset><x-charset><param>latin-iso8859-1</param>ào b</x-charset><x-charset><param>vietnamese-viscii-lower</param>ạn
+
+
+Japanese (</x-charset><x-charset><param>japanese-jisx0208</param>日本語)    こんにちは / </x-charset><x-charset><param>katakana-jisx0201</param>コンニチハ
+Chinese (</x-charset><x-charset><param>chinese-gb2312</param>中文,普通话,汉语)  你好
+Cantonese (</x-charset><x-charset><param>chinese-big5-1</param>粵語,廣東話)       早晨, 你好
+Korean (</x-charset><x-charset><param>korean-ksc5601</param>한글)    안녕하세요 / 안녕하십니까
+
+
+</x-charset><x-charset><param>unicode</param>\f
+
 
 Copyright (C) 2001-2018 Free Software Foundation, Inc.
 
+
 This file is part of GNU Emacs.
 
+
 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 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
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
+
 You should have received a copy of the GNU General Public License
-along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
+along with GNU Emacs.  If not, see <<https://www.gnu.org/licenses/>.
+
 
 ;;; Local Variables:
 ;;; tab-width: 32
 ;;; bidi-display-reordering: t
-;;; coding: iso-2022-7bit
-;;; End:
+;;; coding: utf-8
+;;; End:</x-charset>
index c7ffb17ad3a1ce06c9a4ffcc9423c0e50c8b3411..ae8a366f4bfec5d74d7df0567c16952694b6f581 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -233,13 +233,20 @@ and its value has been changed to Duck Duck Go.
 'shr-selected-link' face to give the user feedback that the command
 has been executed.
 
-
 ** Htmlfontify
 *** The functions 'hfy-color', 'hfy-color-vals' and
 'hfy-fallback-color-values' and the variables 'hfy-fallback-color-map'
 and 'hfy-rgb-txt-color-map' have been renamed from names that used
 'colour' instead of 'color'.
 
++++
+** Enriched mode supports the 'charset' text property.
+You can add or modify the 'charset' text properties of text using the
+Edit->Text Properties->Special Properties menu, or by invoking the
+'facemenu-set-charset' command.  Documents in Enriched mode will be
+saved with the charset properties, and those properties will be
+restored when the file is visited.
+
 ** Smtpmail
 Authentication mechanisms can be added via external packages, by
 defining new cl-defmethod of smtpmail-try-auth-method.
index 773fa619f2f211eec07620dbe173d972b78042e0..bf3e91a8376c4cfdb7c86feb5202ad0e8b74fb19 100644 (file)
@@ -64,7 +64,11 @@ the right margin, fully justified, centered, or left alone).</indent>
 
 <bold>Excerpts:</bold><indent> <excerpt>"For quoted material."</excerpt></indent>
 
-<bold>Read-only</bold> regions.
+<bold>Read-only, Invisible, and Intangible</bold> regions.
+
+<bold>Charset</bold> properties.
+
+<bold>Display</bold> properties.
 
 </indent>
 
@@ -158,6 +162,16 @@ parts of other people's email messages and the like.  It is just a
 face, which is the same as the 'italic' face by default.</indent></excerpt>
 
 
+<x-bg-color><param>blue</param><x-color><param>white</param><bold>CHARSET</bold></x-color></x-bg-color>
+
+
+<indent>You can add character set information to stretches of text; this
+is important for selecting the font that will display that text.
+Users of various charsets, especially in East Asian cultures,
+prefer the same characters to be rendered differently depending on
+the language/charset context.</indent>
+
+
 <x-bg-color><param>blue</param><x-color><param>white</param><bold>THE FILE FORMAT</bold></x-color></x-bg-color>
 
 
@@ -175,7 +189,7 @@ as possible.
 
 
 The text/enriched standard is defined in </indent>Internet<indent> RFC 1896
-(<<http://www.ietf.org/rfc/rfc1896.txt>).</indent></indent>
+(<<http://www.ietf.org/rfc/rfc1896.txt>).</indent>
 
 
 <x-bg-color><param>blue</param><x-color><param>white</param><bold>CUSTOMIZATION</bold></x-color></x-bg-color><bold>
@@ -192,9 +206,9 @@ requires you to name your annotation starting<italic> "x-" </italic>(as in
 <italic>"x-read-only"</italic>).  Please report any such additions that you
 think might be of general interest using <fixed>M-x report-emacs-bug</fixed>.</indent>
 
-</indent>
+</indent><bold>
 
-<x-bg-color><param>blue</param><x-color><param>white</param><bold>TODO LIST</bold></x-color></x-bg-color>
+<x-bg-color><param>blue</param><x-color><param>white</param>TODO LIST</x-color></x-bg-color></bold>
 
 
 <italic><indent>[Feel free to work on these and send us the results!]</indent></italic><indent>
@@ -235,7 +249,7 @@ it.</indent>
 <x-bg-color><param>blue</param><x-color><param>white</param><bold>Original Author:</bold></x-color></x-bg-color>
 
 
-<bold><x-color><param>white</param><x-bg-color><param>blue</param>Boris Goldowsky</x-bg-color></x-color><x-color><param>light blue</param> </x-color></bold><x-color><param>light blue</param><fixed><<boris@gnu.ai.mit.edu></fixed></x-color><x-color><param>blue</param>
+<bold><x-color><param>white</param><x-bg-color><param>blue</param>Boris Goldowsky</x-bg-color></x-color><x-color><param>light blue</param> </x-color></bold><x-color><param>light blue</param><fixed><<boris@gnu.ai.mit.edu></fixed></x-color>
 
 
 \f
index be5a18c8cc7aee3745114137a7d60f4c97e79525..a4f675b8c11fe1f4c15ac781e3596c55e74e25c3 100644 (file)
@@ -188,6 +188,8 @@ it will remove any faces not explicitly in the list."
   (let ((map (make-sparse-keymap "Special")))
     (define-key map [?s] (cons (purecopy "Remove Special")
                               'facemenu-remove-special))
+    (define-key map [?c] (cons (purecopy "Charset")
+                              'facemenu-set-charset))
     (define-key map [?t] (cons (purecopy "Intangible")
                               'facemenu-set-intangible))
     (define-key map [?v] (cons (purecopy "Invisible")
@@ -433,6 +435,28 @@ This sets the `read-only' text property; it can be undone with
   (interactive "r")
   (add-text-properties start end '(read-only t)))
 
+(defun facemenu-set-charset (cset &optional start end)
+  "Apply CHARSET text property to the region or next character typed.
+
+If the region is active (normally true except in Transient
+Mark mode) and nonempty, and there is no prefix argument,
+this command adds CHARSET property to the region.  Otherwise, it
+sets the CHARSET property of the character at point."
+  (interactive (list (progn
+                      (barf-if-buffer-read-only)
+                      (read-charset
+                        (format "Use charset (default %s): " (charset-after))
+                        (charset-after)))
+                    (if (and mark-active (not current-prefix-arg))
+                        (region-beginning))
+                    (if (and mark-active (not current-prefix-arg))
+                        (region-end))))
+  (or start
+      (setq start (min (point) (1- (point-max)))
+            end (1+ start)))
+  (remove-text-properties start end '(charset nil))
+  (put-text-property start end 'charset cset))
+
 (defun facemenu-remove-face-props (start end)
   "Remove `face' and `mouse-face' text properties."
   (interactive "*r") ; error if buffer is read-only despite the next line.
@@ -452,7 +476,7 @@ These special properties include `invisible', `intangible' and `read-only'."
   (interactive "*r") ; error if buffer is read-only despite the next line.
   (let ((inhibit-read-only t))
     (remove-text-properties
-     start end '(invisible nil intangible nil read-only nil))))
+     start end '(invisible nil intangible nil read-only nil charset nil))))
 \f
 (defalias 'facemenu-read-color 'read-color)
 
index b9d247132dc720a5a32057e1fc69a31d395ae455..6b4c44a39e74e6c495cd78eb2c9fcc5168123c42 100644 (file)
@@ -120,9 +120,11 @@ expression, which is evaluated to get the string to insert.")
     ;; The following are not part of the standard:
     (FUNCTION      (enriched-decode-foreground "x-color")
                   (enriched-decode-background "x-bg-color")
-                  (enriched-decode-display-prop "x-display"))
+                  (enriched-decode-display-prop "x-display")
+                   (enriched-decode-charset "x-charset"))
     (read-only     (t           "x-read-only"))
     (display      (nil         enriched-handle-display-prop))
+    (charset       (nil         enriched-handle-charset-prop))
     (unknown       (nil         format-annotate-value))
 ;   (font-size     (2           "bigger")       ; unimplemented
 ;                 (-2          "smaller"))
@@ -492,6 +494,21 @@ Return value is \(begin end name positive-p), or nil if none was found."
       (list from to 'face (list ':background color))
     (message "Warning: no color specified for <x-bg-color>")
     nil))
+
+(defun enriched-decode-charset (from to &optional cset)
+  (let ((cs (when (stringp cset)
+              (condition-case ()
+                  (car (read-from-string cset))
+                (error nil)))))
+    (unless cs
+      (message "Warning: invalid <x-charset> parameter %s" cset))
+    (list from to 'charset cs)))
+
+(defun enriched-handle-charset-prop (old new)
+  "Return a list of annotations for a change in the `charset' property."
+  (cons (and old (list (list "x-charset" (symbol-name old))))
+        (and new (list (list "x-charset" (symbol-name new))))))
+
 \f
 ;;; Handling the `display' property.