emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 3589c96: Use Enriched mode in etc/HELLO to keep cha


From: Eli Zaretskii
Subject: [Emacs-diffs] master 3589c96: Use Enriched mode in etc/HELLO to keep charset information
Date: Sat, 19 May 2018 11:20:19 -0400 (EDT)

branch: master
commit 3589c966b743850c29b89b83710783d4ea026770
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Use Enriched mode in etc/HELLO to keep charset information
    
    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 <address@hidden>.
    * 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        |  10 ++--
 etc/HELLO                  | 145 +++++++++++++++++++++++++--------------------
 etc/NEWS                   |   9 ++-
 etc/enriched.txt           |  24 ++++++--
 lisp/facemenu.el           |  26 +++++++-
 lisp/textmodes/enriched.el |  19 +++++-
 6 files changed, 156 insertions(+), 77 deletions(-)

diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi
index 6a5fc7c..1e96163 100644
--- a/doc/emacs/text.texi
+++ b/doc/emacs/text.texi
@@ -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.
 
diff --git a/etc/HELLO b/etc/HELLO
index 2c95e21..f415ec0 100644
--- a/etc/HELLO
+++ b/etc/HELLO
@@ -1,99 +1,114 @@
+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: ,A!(BHola!, Gr,A|_(B Gott, Hyv,Add(B p,Ad(Biv,Add(B, Tere 
,Au(Bhtust, Bon,Cu(Bu
-          Cze,B6f(B!, Dobr,B}(B den, ,L7T`PRabRcYbU(B!, ,FCei\(B 
,Fsar(B, $,1J2J0J;address@hidden(B
-  Africa: $(3!A!,!>(B
-  Middle/Near East: ,Hylem(B, $,1-g.$-s.1.$-g.%(B $,1-y.$.*.#.%(B
-  South Asia: $,19h9n9x:-9d:'(B, $,15h5n5x6-5d6'(B, $,1?(?.?8?M>u?>?0(B, 
$,address@hidden@address@hidden@address@hidden@address@hidden@"(B, 
$,1;6;A;#;?;,;G(B,
-              $,1AFAzB4AvB=B AqB*(B, $,1<U<C<5<m<5<N<m(B, 
$,1=h=n=x>-=U=~=p=B(B, $(7"7"!#C!;"E"S"G!;"7"2"[!;"D"["#"G!>(B
-  South East Asia: $,1\'\f\:\V\4\?\]\:(B, (1JP:R-4U(B, 
$,1H9H$HZHYH"H<HLH5HK(B, ,TJGQJ4U$CQ:(B, Ch,1`(Bo b,1U(Bn
-  East Asia: $ADc:C(B, $(0*/=((B, $B$3$s$K$A$O(B, $(C>H3gGO<<?d(B
-  Misc: E,C6(Bo,C~(Ban,Cx(Bo ,Cf(Biu,C<(Ba,C}(Bde, 
$,2(3(1('('(5(B, $,1x (B p $,1x((B world $,1s"(B hello p  $,2!a(B
-  CJK variety: GB($AT*Fx(B,$A?*7"(B), BIG5($(0&x86(B,$(0DeBv(B), 
JIS($B855$(B,$B3+H/(B), KSC($(Cj*Q((B,$(CKR[!(B)
-  Unicode charset: E$,1 E(Bo$,1 }(Ban$,1 =(Bo $,1 )(Biu$,1 
U(Ba$,1!-(Bde, $,1&s'5'9',(B $,1'C'1'B(B, $,1-),|,u,}(B, 
$,1(7(T(`(P(R(a(b(R(c(Y(b(U(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 ($,1O M[MmN{(B)      $,1M`MKM](B
-Arabic ($,1-g.$-y-q-h.*.1-i(B)       $,1-g.$-s.1.$-g.%(B $,1-y.$.*.#.%(B
-Armenian ($,1+p+a+u+e, +e+v(B)       $,1+2+a, ,'(B $,1+q+e+f(B
-Bengali ($,17,7>6b727>(B)    $,17(7.787M6u7>70(B
-Braille        $,2(3(1('('(5(B
-Burmese ($,1H9H\H4HZH9HL(B)  $,1H9H$HZHYH"H<HLH5HK(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 (,Bh(Be,B9(Btina)    Dobr,A}(B den
-Danish (dansk) Hej / Goddag / Hall,Ax(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 /$(O+S,0!,D?$(O*y(Bl,0!$(O*h(B/        Hello
-Esperanto      Saluton (E,C6(Bo,C~(Ban,Cx(Bo ,Cf(Biu,C<(Ba,C}(Bde)
-Estonian (eesti keel)  Tere p,Ad(Bevast / Tere ,Au(Bhtust
-Finnish (suomi)        Hei / Hyv,Add(B p,Ad(Biv,Add(B
-French (fran,Ag(Bais)        Bonjour / Salut
-Georgian ($,address@hidden:J8(B)     $,1J2J0J;address@hidden(B
-German (Deutsch)       Guten Tag / Gr,A|_(B Gott
-Greek (,Fekkgmij\(B) ,FCei\(B ,Fsar(B
-Greek, ancient ($,1p1,Fkkgmij^(B)   ,FO$,1pv,Fk](B ,Fte(B 
,Fja$,1q6(B ,Fl]ca(B ,Fwa$,1r6,Fqe(B
-Gujarati ($,19W:!9\9p9~9d: (B)       $,19h9n9x:-9d:'(B
-Hebrew ($,1-",q-(,y-*(B)     ,Hylem(B
-Hungarian (magyar)     Sz,Bi(Bp j,Bs(B napot!
-Hindi ($,15y55B5f6 (B)      $,15h5n5x6-5d6'(B / $,15h5n5x6-5U5~5p(B 
$,16D(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</
 [...]
+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 ($,1>u?(?M?(?!(B)    $,1?(?.?8?M>u?>?0(B
-Khmer ($,1\7\V\?\V\!\r\8\b\:(B)      $,1\'\f\:\V\4\?\]\:(B
-Lao ((1>RJRERG(B)    (1JP:R-4U(B / (1"mcKib*!4U(B
-Malayalam ($,address@hidden@address@hidden@address@hidden@"(B)       
$,address@hidden@address@hidden@address@hidden@address@hidden@"(B
-Maltese (il-Malti)     Bon,Cu(Bu / Sa,C11(Ba
-Mathematics    $,1x (B p $,1x((B world $,1s"(B hello p  $,2!a(B
-Mongolian (,L\^]S^[(B ,Lem[(B)     ,LAPY](B ,LQPY]P(B ,Lcc(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 ($,1:s;\;?:f(B)        $,1;6;A;#;?;,;G(B
-Polish  (j,Bj(Bzyk polski)   Dzie,Bq(B dobry! / Cze,B6f(B!
-Russian (,L`caaZXY(B)        ,L7T`P$(O+Z,LRabRcYbU(B!
-Sinhala ($,1B#B2ABB$A}(B)    $,1AFAzB4AvB=B AqB*(B
-Slovak (sloven,Bh(Bina)      Dobr,A}(B de,Br(B
-Slovenian (sloven,B9h(Bina)  Pozdravljeni!
-Spanish (espa,Aq(Bol)        ,A!(BHola!
-Swedish (svenska)      Hej / Goddag / Hall,Ae(B
-Tamil ($,1<D<N<_<T<m(B)      $,1<U<C<5<m<5<N<m(B
-Telugu ($,1=d>&=r>!=W>!(B)   $,1=h=n=x>-=U=~=p=B(B
-Thai (,address@hidden(B)      ,TJGQJ4U$CQ:(B / ,TJGQJ4U$hP(B
-Tibetan ($(7"7"]"2!;"G#!"2!;(B)      
$(7"7"!#C!;"E"S"G!;"7"2"[!;"D"["#"G!>(B
-Tigrigna ($,1NUP-MmN{(B)     $,1MpMKM[NU(B
-Turkish (T,A|(Brk,Ag(Be)   Merhaba
-Ukrainian (,LcZ`Pw]alZP(B)   ,L2vbPn(B
-Vietnamese (ti,1*(Bng Vi,1.(Bt)    Ch,A`(Bo b,1U(Bn
-
-Japanese ($BF|K\8l(B)        $B$3$s$K$A$O(B / (I:]FAJ(B
-Chinese ($AVPND(B,$AFUM(;0(B,$A::So(B)   $ADc:C(B
-Cantonese ($(0GnM$(B,$(0N]0*Hd(B)  $(0*/=((B, $(0+$)p(B
-Korean ($(CGQ1[(B)   $(C>H3gGO<<?d(B / $(C>H3gGO=J4O1n(B
-
-
+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>
+
 
 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>
diff --git a/etc/NEWS b/etc/NEWS
index c7ffb17..ae8a366 100644
--- 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.
diff --git a/etc/enriched.txt b/etc/enriched.txt
index 773fa61..bf3e91a 100644
--- a/etc/enriched.txt
+++ b/etc/enriched.txt
@@ -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><<address@hidden></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><<address@hidden></fixed></x-color>
 
 
 
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index be5a18c..a4f675b 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -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))))
 
 (defalias 'facemenu-read-color 'read-color)
 
diff --git a/lisp/textmodes/enriched.el b/lisp/textmodes/enriched.el
index b9d2471..6b4c44a 100644
--- a/lisp/textmodes/enriched.el
+++ b/lisp/textmodes/enriched.el
@@ -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))))))
+
 
 ;;; Handling the `display' property.
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]