home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1128 / README.8bit
Text File  |  1990-12-28  |  14KB  |  398 lines

  1.       SUMMARY
  2.  
  3. I have modified GNU Emacs version 18.55 to handle many 8-bit
  4. character sets, including the ISO 8859 character sets.  For each
  5. character, it is possible to customize the byte(s) sent to the
  6. terminal to display that character.  X11R4 is also supported, to
  7. an extent.  Case determination, case changing, and sorting can
  8. all be customized.  Input facilities are primitive.
  9.  
  10.  
  11.       DISCOURAGEMENT
  12.  
  13. Emacs version 19 will support 8-bit character sets.  That
  14. support is based on my modifications, but there will probably be
  15. some differences between the 8-bit character set support in this
  16. modified version 18.55 and the support in version 19.
  17. Therefore, if you can wait for version 19 I urge you to do so.
  18. Richard Stallman says he does not know when version 19 will be
  19. available.
  20.  
  21. This is alpha-test software.  It has known bugs.  I'm posting it
  22. to alt.sources to emphasize that, and to avoid having it
  23. archived.  If you don't know your way around GNU Emacs, please
  24. don't try to install it.  I don't have time to provide support.
  25. (But please send bug reports anyway.)
  26.  
  27. Input support is primitive.  X windows support is for X11 only,
  28. and is incomplete.
  29.  
  30.  
  31.       CHARACTER SETS SUPPORTED
  32.  
  33. So I haven't scared you off yet.  OK, you were warned.  My
  34. modifications allow GNU Emacs to handle any character set
  35. provided that each character is represented by exactly one 8-bit
  36. byte, and the codes for space, newline, and horizontal tab are
  37. the same as in ASCII.  Now for some definitions.
  38.  
  39.  
  40.       DEFINITIONS
  41.  
  42. A glyf is something that takes up exactly one position on the
  43. display of a terminal, terminal emulator, or window system.  For
  44. example, 'a' is a glyf, as is a yellow, blinking, underlined '7'
  45. on a red background.  It may be necessary to transmit many bytes
  46. to a terminal to display one glyf.  A rope is a sequence of
  47. glyfs.  (The name is an analogy to string, which is a sequence
  48. of characters.) For example, the glyf '^' followed by the glyf
  49. 'C' forms a rope of length 2.  Glyfs are represented as unsigned
  50. 16-bit integers.  Ropes are represented as vectors of glyfs.
  51.  
  52.  
  53.       CHAR TABLES
  54.  
  55. There's a new lisp object: char tables.  A char table specifies,
  56. for each 8-bit character, the rope to use to display that
  57. character.  Char tables are associated with windows, not
  58. buffers, so one buffer can be displayed in several different
  59. windows with several different char tables.
  60.  
  61.  
  62.       CASE TABLES
  63.  
  64. Another new lisp object, case tables, specify for each 8-bit
  65. character the case: upper, lower, or none.
  66.  
  67.  
  68.       SORT TABLES
  69.  
  70. Another new lisp object, sort tables, specify for each 8-bit
  71. character its sorting position.  Sort tables are also used for
  72. searching.  Special sort tables can be set up, for example, to
  73. ignore diacritical marks when searching.
  74.  
  75.  
  76.       TRANS TABLES
  77.  
  78. Finally, trans tables are lisp objects that map each 8-bit
  79. character into some other character.  They are used for case
  80. conversion, and can also be used for character set conversion.
  81.  
  82.  
  83.       ISO 8859/1 SUPPORT
  84.  
  85. I include support for displaying ISO 8859/1 characters.  On
  86. ASCII terminals they display as various ropes, e.g. A with grave
  87. accent displays as {`A}.  If your terminal can display some of
  88. the characters correctly, e.g. by using shift-out and shift-in,
  89. then you can write a lisp/term file to do that.  I include as an
  90. example lisp/term/fa4440a.el for the Facit 4440 Twist terminal
  91. with a Swedish PROM.  If your terminal (emulator) provides full
  92. ISO 8859/1, you can just send 8-bit characters to it directly.
  93. See the code in lisp/term/x-win.el starting with "(if (fboundp
  94. 'get-glyf)" for an example.
  95.  
  96.  
  97.       SWEDISH SUPPORT
  98.  
  99. I include support for Swedish as an example of language
  100. support.  This includes a swedish mode analogous to text mode,
  101. and sort tables for Swedish alphabetical order.
  102.  
  103.  
  104.       INPUT
  105.  
  106. Input is kludgy.  The file lisp/iso8859-1-insert.el defines
  107. little functions to insert each non-ASCII ISO 8859/1 character.
  108. These are put into the global keymap under C-x 8, which is
  109. supposed to be mnemonic for 8859.  So e.g. "C-x 8 ` A" runs
  110. insert-A-grave.  This is OK for infrequently used characters,
  111. but for those you use often I suggest you use programmable keys
  112. on your terminal, if possible.  For example, Swedish uses o with
  113. umlaut a lot, so I have one of the programmable keys on my
  114. terminal set up to transmit "C-q 3 6 6".  Using C-q also means
  115. this works with e.g. incremental search, not just for
  116. inserting.
  117.  
  118. Here's what I do on my Facit 4440 Twist:
  119.    1) Press Setup
  120.    2) Press 5 to enter Setup B mode
  121.    3) Press F4 C-q 3 4 5 C-Return
  122.       Press F5 C-Q 3 4 4 C-Return
  123.       Press F6 C-Q 3 6 6 C-Return
  124.       Press F7 C-Q 3 5 1 C-Return
  125.       Press F8 C-Q 3 7 4 C-Return
  126.       Press Shift-F4 C-Q 3 0 5 C-Return
  127.       Press Shift-F5 C-Q 3 0 4 C-Return
  128.       Press Shift-F6 C-Q 3 2 6 C-Return
  129.       Press Shift-F7 C-Q 3 1 1 C-Return
  130.       Press Shift-F8 C-Q 3 3 4 C-Return
  131.    4) Press S to save everything in nonvolatile memory.
  132. This puts a with ring on function key 4, a with umlaut on F5, o
  133. with umlaut on F6, e with acute accent on F7, and u with umlaut
  134. on F8.
  135.  
  136.  
  137.       X WINDOWS SUPPORT
  138.  
  139. Only X11 is supported, not X10.  I've only tried this on X11R4.
  140. Eventually, the idea is for each glyf, which is really just  an
  141. unsigned 16-bit integer, to be treated as two bytes.  The low
  142. order byte selects one face code in a font, for example 'g'.
  143. The high order byte selects a graphic context (GC).  But for
  144. now, there's only one GC.
  145.  
  146. For input of frequently-used characters I just hacked
  147. stringFuncVal in src/x11term.c.  You may wish to do the same.
  148.  
  149. Many of the X11R4 fonts advertised as ISO 8859/1 don't really
  150. contain all the characters; 7x14 does, so that's what I use for
  151. now.  Here's another font to try:
  152.  
  153. >From: jw@sics.se (Johan Widen)
  154. >Newsgroups: comp.windows.x
  155. >Subject: eightbit version of the 'fixed' font available
  156. >Message-ID: <1990Mar9.164011.1775@sics.se>
  157. >Date: 9 Mar 90 16:40:11 GMT
  158. >Distribution: comp
  159. >Organization: Swedish Institute of Computer Science, Kista
  160. >
  161. >An eightbit version of the X11R4 'fixed' font (also known as 6x13) is available
  162. >for anonymous ftp from
  163. >    sics.se (192.16.123.90)
  164. >in the compressed tar file
  165. >    archive/fixed.bdf.Z
  166. >
  167. >The glyphs below 128 are unchanged. The ISO-8859-1 characters from 160 to 255
  168. >have been added.
  169. >
  170. >I'm interested in any improvements/fixes that you make to this font.
  171. >
  172. >--
  173. >Johan Widen
  174. >SICS, PO Box 1263, S-164 28 KISTA, SWEDEN    Internet: jw@sics.se
  175. >Tel: +46 8 752 15 32    Ttx: 812 61 54 SICS S    Fax: +46 8 751 72 30
  176.  
  177.  
  178.       OTHER APPLICATIONS
  179.  
  180. These modifications have other uses than supporting 8-bit
  181. character sets.  The file lisp/emphasis.el uses the high bit to
  182. indicate emphasis, e.g. underlining, of 7-bit ASCII.  A hook in
  183. lisp/man.el then displays italicized test in manual entries with
  184. emphasis if possible.
  185.  
  186. The file lisp/rot13.el contains a disgusting hack that displays
  187. a buffer in another window, but with a rot13 char table.  I
  188. really use this when reading rec.humor.funny with Gnews.
  189.  
  190. If you don't like unprintable characters to be displayed in
  191. octal, you can change to hex or whatever.
  192.  
  193.  
  194.       RELATED SOFTWARE
  195.  
  196. My cz system lets you print ISO 8859/1 text on PostScript
  197. printers.  It interfaces to GNU Emacs.  To get it, get these
  198. articles from your nearest comp.sources.misc archive:
  199.  
  200. cz          comp.sources.misc volume  8 issues 65-75, 77-78 ( 1 Oct 1989)
  201.                                         issue  97           (28 Oct 1989)
  202. libhoward   comp.sources.misc volume  8 issues 80-87        ( 1 Oct 1989)
  203.                                         issue  96           (28 Oct 1989)
  204.  
  205.  
  206.       BUGS
  207.  
  208. It should be possible to format texinfo files into info files by
  209. doing this (e.g. for cl.texinfo):
  210.    % cd man; emacs -batch -funcall batch-texinfo-format cl.texinfo
  211.    texinfo formatting /usr/local/free/gnu-emacs/18.55i/man/cl.texinfo...
  212.    Formatting Info file...
  213.    Making tags table for Info file...
  214.    >> Error: (void-variable This)
  215.    >>  point at
  216.    >>  Info file: cl,    -*-Text-*-
  217.    >>  produced by texinfo-format-buffer
  218.    >>  from file: cl.texinfo
  219.    >>  Copyright (C
  220. But that gives the error shown.  However this works:
  221.    % emacs -batch -load info -funcall batch-texinfo-format cl.texinfo
  222. To the first person who supplies me with a fix for this bug, I
  223. offer a color portrait of the Swedish Royal Family, with a
  224. genuine Swedish postage stamp on the other side.
  225.  
  226.  
  227.       INSTALLATION
  228.  
  229. Start with a copy of GNU Emacs 18.55 as distributed.  Parts 1
  230. through 4 are shar archives; unshar them.
  231.  
  232. Two of the lisp files have high-order bits set.  They are
  233. encoded with Brad Templeton's abe system, which was posted to
  234. comp.sources.misc on 4 June 1989 as volume 7, issues 1 and 2,
  235. archive name abe.  To extract them, you must have the dabe
  236. command.  Do:
  237.    % cd lisp
  238.    % dabe el.abe
  239.    % cd ..
  240.  
  241. Parts 5 through 12 are context diffs.  Parts 11 and 12 are
  242. together the diffs to man/emacs.tex; they must be concatenated.
  243. Apply the diffs with patch.
  244.  
  245. Now install Emacs as usual.  When byte-recompiling the elisp
  246. code, it may be necessary to load case-table.el, char-table.el,
  247. sort-table.el, and trans-table.el first.  Be sure to
  248. byte-compile all the new .el files you intend to use.  Here's
  249. the complete list:
  250.    case-table.el
  251.    char-table-vt100.el
  252.    char-table.el
  253.    emphasis.el
  254.    iso8859-1-ascii.el
  255.    iso8859-1-insert.el
  256.    iso8859-1-swedish.el
  257.    iso8859-1.el
  258.    rot13.el
  259.    sort-table.el
  260.    swedish.el
  261.    trans-table.el
  262.    term/id100.el
  263.    term/fa4440a.el
  264.    term/fa4440b.el
  265.  
  266. You'll probably want to load some character set and language
  267. support from lisp/site-init.el.  For example, ours starts like
  268. this:
  269.    (load "iso8859-1")
  270.    (garbage-collect)
  271.    (load "iso8859-1-insert")
  272.    (garbage-collect)
  273.    (load "swedish")
  274.    (garbage-collect)
  275.  
  276.  
  277.       CHANGES
  278.  
  279. Here's a brief summary of what I changed in each file.  In src:
  280. abbrev.c: expand-abbrev: Use casetab.h macros.
  281.    Use HYPHEN.
  282. alloc.c:
  283.    GC case, char, sort, and trans tabs.
  284. buffer.c:
  285.    reset_buffer_local_variables: Initialize case_table_v, etc..
  286.    Drop selective_display_ellipses.
  287. buffer.h:
  288.    Add case_table_p, etc. & buffer_char_table.  Drop ctl_arrow.
  289. casefiddle.c: casify_object & casify_region: Use casetab.h macros.
  290. config.h-dist: Add 30000 to PURESIZE.
  291. cmds.c: Use chartab.h macros.
  292. data.c: Add arg_out_of_range.
  293. dired.c: Use standard_downcase_table_p instead of downcase_table.
  294. dispextern.h: Change char to glyf_t.
  295. dispnew.c: Use chartab.h macros.  Change char to glyf_t.  Check for X 
  296.    windows in chartab.c now.
  297. editfns.c: Use casetab.h & chartab.h macros.
  298. emacs.c: Call init_case_table_once, init_char_table_once,
  299.    syms_of_case_table, and syms_of_char_table.
  300. fileio.c: #include casetab.h
  301. fns.c: Add string-lessp*.
  302. indent.c:
  303.    Use chartab.h macros.
  304.    Use char table to compute lengths instead of hard code.
  305.    Drop selective_display_ellipses.
  306. keyboard.c: Use ROPE_LEN to check if direct insertion OK.
  307. lisp.h:
  308.    Move case macros to casetab.h.
  309.    Add Lisp_Chartab and related definitions.
  310. minibuf.c: Use casetab.h macros.
  311. process.c: Use transtab.h macros.
  312. print.c: Print out char tables.
  313. regex.c: Drop translate.
  314. regex.h: Use sort table when compiling pattern.
  315. scroll.c: lisp.h must be included before dispextern.h.
  316. search.c: Remove downcase_table & compute_trt_inverse.
  317.    syms_of_search: Remove initialization of downcase_table.
  318.    Use NEWLINE.
  319. term.c: char -> glyf.
  320. termchar.h: Replace vector DCICcost by function.
  321. termhooks.h: {insert,write,delete}_chars_hook ->
  322.    {insert,write,delete}_glyfs_hook
  323. window.c:
  324.    Add window-char-table & set-window-char-table.
  325.    Save char tables for saved windows.
  326. window.h: Add window_char_table.
  327. xdisp.c:
  328.    Use chartab.h macros.  char->glyf.
  329.    Drop selective_display_ellipses.
  330. x11term.c: char->glyf
  331. ymakefile: Add new files and include dependencies.
  332.  
  333. In lisp:
  334. keypad.el: Add backtab code.  Comments.
  335. man.el: Add manual-entry-hook.  Default to default-manual-entry-hook,
  336.    which removed underlining and overstriking.
  337. mlconvert.el: Changing control-code display is different.
  338. rmail.el: Run rmail-get-new-mail-hook after getting new mail.
  339. sendmail.el: Run mail-send-hook just before sending mail.
  340. sort.el: string< -> string-lessp*
  341. text-mode.el: (provide 'text-mode)
  342. term/x-win.el: direct-map high-order ISO 8859 bits
  343.  
  344. In etc:
  345. NEWS
  346. makedoc.com
  347.  
  348. In man:
  349. emacs.tex
  350.  
  351.  
  352.       EMAIL
  353.  
  354. Here's how I read and send email in ISO 8859/1 while still
  355. living in a 7-bit (ISO 646) world.  I run Chip Salzenberg's
  356. deliver program.  My .deliver file looks like this:
  357.    cat $HEADER $BODY | 78seus | deliver -n "$1"
  358.    echo DROP
  359. (OK, I'm lying.  My real .deliver file also saves a copy of
  360. incoming messages.  Also, it has absolute path names to 78seus
  361. and deliver, because they're not in /usr/bin.  But you get the
  362. idea.)
  363.  
  364. The 78seus filter is part of my cz system (see above).  It
  365. converts mixed English and Swedish to ISO 8859/1.  Cz also has
  366. one for Danish, plus a paper on how to make your own.
  367.  
  368. I then read mail with GNU Emacs rmail mode, as usual.
  369.  
  370. When sending mail I write it in ISO 8859/1 in Emacs sendmail
  371. mode.  Just before sending it, sendmail runs mail-send-hook,
  372. which is set in lisp/swedish.el to call the function
  373. 8859-to-swascii-buffer.  This function maps the ISO 8859/1 to
  374. ISO 646.
  375.  
  376. Deliver was posted to comp.sources.unix on 16 October 1989 as
  377. volume 20, issues 23 through 26, archive name deliver2.0.  These
  378. are the patches I know about:
  379.    1 comp.sources.unix volume 20 issue 27 (16 Oct 1989)
  380.    2 comp.sources.bugs,comp.mail.misc 15 Dec 1989
  381.    3 comp.sources.bugs,comp.mail.misc 15 Dec 1989
  382.    4 comp.sources.bugs,comp.mail.misc 15 Dec 1989
  383.    5 comp.sources.bugs,comp.mail.misc 19 Dec 1989
  384.    6 comp.sources.bugs,comp.mail.misc 19 Feb 1990
  385.    7 comp.sources.bugs,comp.mail.misc  7 Mar 1990
  386.    8 comp.sources.bugs,comp.mail.misc  7 Mar 1990
  387.    9 comp.sources.bugs,comp.mail.misc  7 Mar 1990
  388. --
  389. Howard Gayle
  390. TN/ETX/TT/HL
  391. Ericsson Telecom AB
  392. S-126 25 Stockholm
  393. Sweden
  394. howard@ericsson.se
  395. uunet!ericsson.se!howard
  396. Phone: +46 8 719 5565
  397. FAX  : +46 8 719 8439
  398.