home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / misc / 8-bit.patches / text0000.txt < prev   
Encoding:
Text File  |  1990-07-22  |  11.5 KB  |  360 lines

  1. Christopher Alexander North-Keys
  2. Group Talisman, Austin Tx.
  3. Fri May 11 07:34:22 CDT 1990
  4.  
  5.                  @@@ Talisman-8bit GNU Emacs patches @@@
  6.  
  7. This set of patches brings Emacs 18.55 up to 8-bit capability.
  8.  
  9. CAVEAT:  This patches are *not* official.  No support is offered.
  10.  
  11. Application:
  12.     GNU Emacs original distribution 18.55
  13.  
  14. Compatibility:
  15.     The two format selectors default to the older behavior.
  16.  
  17. Files affected:
  18.     buffer.c
  19.     buffer.h
  20.     indent.c
  21.     xdisp.c
  22.  
  23. Thanks to Kenneth Cline (cs.cmu.edu) for his work in this area.
  24.  
  25. Bugs:
  26.     anomalies may result when a line partially in view changes display
  27.     format.
  28.  
  29.     no provision has been made for displaying *all* characters in
  30.     /000 form.
  31.  
  32. Projects:
  33.     Proportional spacing, used with an intercombinant font, should allow
  34.     true diacritics over just about anything (unlike the current approach
  35.     being used by certain font companies).  The precombined tack is not
  36.     suitable for efficient ASCII-type data storage, due to its bias towards
  37.     unnecessary graphic information.  For example:  the a-umlaut is a single
  38.     character in a precombined font.  However, in an intercombinant font,
  39.     the umlaut is a second character, only combined with the "a" at the
  40.     time of display.  True proportional spacing enables a diacritic glyph
  41.     to take a negative x-offset, so as to appear over the preceding char.
  42.  
  43.     There is currently no accepted standard for an intercombinant font.
  44.  
  45.     Emacs also needs true per-character display attributes.  Currently it
  46.     is only capable of inversion/highlighting on a per-line basis.  This
  47.     is what prevents region-select highlighting, etc.
  48.  
  49. Send comments to:
  50.     north-keys@mcc.com
  51.  
  52. Suggested use in ~/.emacs or equivalent:
  53.     (setq-default ctl-arrow t)        ;; The default.
  54.     (setq-default meta-display t)     ;; For use with 8-bit fonts.
  55.  
  56. Test file ---------------------------------------------------------
  57.  
  58. ;; judicious usage of eval-last-sexp on these expressions will demonstrate
  59. ;; what the enhancements do.  Note that this has only been tested with
  60. ;; the 256-char font -Talisman-Smooth-Bold-R-Normal--12-120-80-80-C-76-None-1
  61.  
  62. ;; This expression, evaluated, generates a char 0-255 character insertion.
  63. (progn
  64.   (setq i 0)
  65.   (while (<= i 255)
  66.     (insert-char i 1)
  67.     (setq i (+ 1 i))
  68.     ))
  69.  
  70.     
  71.  
  72.  
  73.  
  74. ;;   sequential evaluation of these tests all combinations    8bit   ctrl
  75. ;;                                                            ----   ----
  76. (progn (setq meta-display t) (setq ctl-arrow "special"))   ;; true , true
  77. (progn (setq meta-display t) (setq ctl-arrow t))           ;; true , ^C
  78. (progn (setq meta-display t) (setq ctl-arrow nil))         ;; true , \000
  79.  
  80. (progn (setq meta-display nil) (setq ctl-arrow "special")) ;; \255 , true
  81. (progn (setq meta-display nil) (setq ctl-arrow t))         ;; \255 , ^C
  82. (progn (setq meta-display nil) (setq ctl-arrow nil))       ;; \255 , \000
  83.  
  84. End of test file --------------------------------------------------
  85. Patches------------
  86.  
  87. *** buffer.c    Thu Jul 20 17:36:02 1989
  88. --- ../buffer.c    Fri May 11 06:42:27 1990
  89. ***************
  90. *** 1100,1105 ****
  91. --- 1100,1106 ----
  92.     XFASTINT (buffer_defaults.tab_width) = 8;
  93.     buffer_defaults.truncate_lines = Qnil;
  94.     buffer_defaults.ctl_arrow = Qt;
  95. +   buffer_defaults.meta_display = Qnil;
  96.   
  97.     XFASTINT (buffer_defaults.fill_column) = 70;
  98.     XFASTINT (buffer_defaults.left_margin) = 0;
  99. ***************
  100. *** 1136,1141 ****
  101. --- 1137,1143 ----
  102.     XFASTINT (buffer_local_flags.fill_column) = 0x400;
  103.     XFASTINT (buffer_local_flags.left_margin) = 0x800;
  104.     XFASTINT (buffer_local_flags.abbrev_table) = 0x1000;
  105. +   XFASTINT (buffer_local_flags.meta_display) = 0x2000;
  106.   
  107.     Vbuffer_alist = Qnil;
  108.     bf_cur = 0;
  109. ***************
  110. *** 1276,1281 ****
  111. --- 1278,1289 ----
  112.       "Non-nil turns on automatic expansion of abbrevs when inserted.\n\
  113.   Automatically becomes local when set in any fashion.");
  114.   
  115. + /* North-Keys, Fri May 11 03:43:54 CDT 1990 */
  116. +   DEFVAR_LISP_NOPRO ("default-meta-display",
  117. +           &buffer_defaults.meta_display,
  118. +     "Default meta-display for buffers that do not override it.\n\
  119. + This is the same as (default-value 'meta-display).");
  120.     DEFVAR_PER_BUFFER ("case-fold-search", &bf_cur->case_fold_search,
  121.       "*Non-nil if searches should ignore case.\n\
  122.   Automatically becomes local when set in any fashion.");
  123. ***************
  124. *** 1297,1306 ****
  125.   Automatically becomes local when set in any fashion.");
  126.   
  127.     DEFVAR_PER_BUFFER ("ctl-arrow", &bf_cur->ctl_arrow,
  128. !     "*Non-nil means display control chars with uparrow.\n\
  129.   Nil means use backslash and octal digits.\n\
  130. ! Automatically becomes local when set in any fashion.");
  131.   
  132.     DEFVAR_PER_BUFFER ("truncate-lines", &bf_cur->truncate_lines,
  133.       "*Non-nil means do not display continuation lines;\n\
  134.   give each line of text one screen line.\n\
  135. --- 1305,1318 ----
  136.   Automatically becomes local when set in any fashion.");
  137.   
  138.       DEFVAR_PER_BUFFER ("ctl-arrow", &bf_cur->ctl_arrow,
  139. !       "*T means display control chars with uparrow.\n\
  140.     Nil means use backslash and octal digits.\n\
  141. !   Other non-Nil means assume displayable controls in the font.\n\
  142. !   Automatically becomes local when set in any fashion.\n\
  143. !   \n\
  144. !   This is a non-standard feature from Ergo and Group Talisman.");
  145.   
  146.     DEFVAR_PER_BUFFER ("truncate-lines", &bf_cur->truncate_lines,
  147.       "*Non-nil means do not display continuation lines;\n\
  148.   give each line of text one screen line.\n\
  149. ***************
  150. *** 1351,1356 ****
  151. --- 1363,1377 ----
  152.     DEFVAR_PER_BUFFER ("overwrite-mode", &bf_cur->overwrite_mode,
  153.       "Non-nil if self-insertion should replace existing text.\n\
  154.   Automatically becomes local when set in any fashion.");
  155. + /* North-Keys Fri May 11 03:45:44 CDT 1990 */
  156. +   DEFVAR_PER_BUFFER ("meta-display", &bf_cur->meta_display,
  157. +     "*t means display high-bit (meta) chars in the 128-255\n\
  158. + range, and assumes that high-bit characters are displayable.\n\
  159. + Nil means use backslash and octal digits.\n\
  160. + Automatically becomes local when set in any fashion.\n\
  161. + \n\
  162. + This is a non-standard feature from group Talisman.");
  163.   
  164.   /*DEFVAR_LISP ("debug-check-symbol", &Vcheck_symbol,
  165.       "Don't ask.");
  166. *** buffer.h    Fri May 11 05:05:14 1990
  167. --- ../buffer.h    Fri May 11 05:08:04 1990
  168. ***************
  169. *** 153,158 ****
  170. --- 153,160 ----
  171.       Lisp_Object overwrite_mode;
  172.       /* non-nil means abbrev mode is on.  Expand abbrevs automatically. */
  173.       Lisp_Object abbrev_mode;
  174. +     /* Non-nil means display meta chars with font, rather than octal */
  175. +     Lisp_Object meta_display;
  176.   };
  177.   
  178.   extern struct buffer *bf_cur;        /* points to the current buffer */
  179. *** indent.c    Mon Aug 15 21:51:14 1988
  180. --- ../indent.c    Fri May 11 06:33:25 1990
  181. ***************
  182. *** 67,73 ****
  183.     register int tab_seen;
  184.     register int post_tab;
  185.     register int tab_width = XINT (bf_cur->tab_width);
  186. !   int ctl_arrow = !NULL (bf_cur->ctl_arrow);
  187.   
  188.     if (point == last_known_column_point
  189.         && bf_modified == last_known_column_modified)
  190. --- 67,74 ----
  191.     register int tab_seen;
  192.     register int post_tab;
  193.     register int tab_width = XINT (bf_cur->tab_width);
  194. !   int ctl_arrow = !NULL (bf_cur->ctl_arrow) + (EQ (bf_cur->ctl_arrow, Qt));
  195. !   int meta_display = !NULL (bf_cur->meta_display);
  196.   
  197.     if (point == last_known_column_point
  198.         && bf_modified == last_known_column_modified)
  199. ***************
  200. *** 109,115 ****
  201.         tab_seen = 1;
  202.       }
  203.         else
  204. !     col += (ctl_arrow && c < 0200) ? 2 : 4;
  205.       }
  206.   
  207.     if (tab_seen)
  208. --- 110,117 ----
  209.         tab_seen = 1;
  210.       }
  211.         else
  212. !     col += (c < 0200) ? (ctl_arrow == 1 ? 1 : (ctl_arrow ? 2 : 4))
  213. !                       : (meta_display ? 1 : 4);
  214.       }
  215.   
  216.     if (tab_seen)
  217. ***************
  218. *** 231,237 ****
  219.     register int goal;
  220.     register int end = NumCharacters;
  221.     register int tab_width = XINT (bf_cur->tab_width);
  222. !   register int ctl_arrow = !NULL (bf_cur->ctl_arrow);
  223.   
  224.     Lisp_Object val;
  225.   
  226. --- 233,241 ----
  227.     register int goal;
  228.     register int end = NumCharacters;
  229.     register int tab_width = XINT (bf_cur->tab_width);
  230. !   register int ctl_arrow = !NULL (bf_cur->ctl_arrow)
  231. !                             + EQ (bf_cur->ctl_arrow, Qt);
  232. !   register int meta_display = !NULL (bf_cur->meta_display);
  233.   
  234.     Lisp_Object val;
  235.   
  236. ***************
  237. *** 258,266 ****
  238.         col += tab_width - 1;
  239.         col = col / tab_width * tab_width;
  240.       }
  241.         else if (ctl_arrow && (c < 040 || c == 0177))
  242.           col++;
  243. !       else if (c < 040 || c >= 0177)
  244.           col += 3;
  245.       }
  246.   
  247. --- 262,273 ----
  248.         col += tab_width - 1;
  249.         col = col / tab_width * tab_width;
  250.       }
  251. +       else if ((ctl_arrow == 1 && (c < 040 || c == 0177)) ||
  252. +                (meta_display && (c >= 0200)))
  253. +         continue;
  254.         else if (ctl_arrow && (c < 040 || c == 0177))
  255.           col++;
  256. !       else if (c < 040 || c == 0177)
  257.           col += 3;
  258.       }
  259.   
  260. ***************
  261. *** 306,312 ****
  262.     register int pos;
  263.     register int c;
  264.     register int tab_width = XFASTINT (bf_cur->tab_width);
  265. !   register int ctl_arrow = !NULL (bf_cur->ctl_arrow);
  266.     int selective
  267.       = XTYPE (bf_cur->selective_display) == Lisp_Int
  268.         ? XINT (bf_cur->selective_display)
  269. --- 313,321 ----
  270.     register int pos;
  271.     register int c;
  272.     register int tab_width = XFASTINT (bf_cur->tab_width);
  273. !   register int ctl_arrow = !NULL (bf_cur->ctl_arrow)
  274. !                              + (EQ (bf_cur->ctl_arrow, Qt));
  275. !   register int meta_display = !NULL (bf_cur->meta_display);
  276.     int selective
  277.       = XTYPE (bf_cur->selective_display) == Lisp_Int
  278.         ? XINT (bf_cur->selective_display)
  279. ***************
  280. *** 370,376 ****
  281.           }
  282.       }
  283.         else
  284. !     cpos += (ctl_arrow && c < 0200) ? 2 : 4;
  285.   
  286.         if (HPOS (cpos) >= width
  287.         && (HPOS (cpos) > width
  288. --- 379,387 ----
  289.           }
  290.       }
  291.         else
  292. !     cpos += (c < 0200) ? (ctl_arrow == 1 ? 1 : (ctl_arrow ? 2 : 4))
  293. !                        : (meta_display ? 1 : 4);
  294.   
  295.         if (HPOS (cpos) >= width
  296.         && (HPOS (cpos) > width
  297. *** xdisp.c    Wed Apr 26 15:13:59 1989
  298. --- ../xdisp.c    Fri May 11 06:23:28 1990
  299. ***************
  300. *** 1203,1209 ****
  301.     register char *p1prev;
  302.     register struct display_line *line;
  303.     int tab_width = XINT (bf_cur->tab_width);
  304. !   int ctl_arrow = !NULL (bf_cur->ctl_arrow);
  305.     int width = XFASTINT (w->width) - 1
  306.       - (XFASTINT (w->width) + XFASTINT (w->left) != screen_width);
  307.     struct position val;
  308. --- 1203,1210 ----
  309.     register char *p1prev;
  310.     register struct display_line *line;
  311.     int tab_width = XINT (bf_cur->tab_width);
  312. !   int ctl_arrow = !NULL (bf_cur->ctl_arrow) + (EQ (bf_cur->ctl_arrow, Qt));
  313. !   int meta_display = !NULL (bf_cur->meta_display);
  314.     int width = XFASTINT (w->width) - 1
  315.       - (XFASTINT (w->width) + XFASTINT (w->left) != screen_width);
  316.     struct position val;
  317. ***************
  318. *** 1319,1324 ****
  319. --- 1320,1332 ----
  320.           }
  321.         break;
  322.       }
  323. +       else if (((ctl_arrow == 1) && (c < 0200)) ||
  324. +                (meta_display && (c >= 0200)))
  325. +       {
  326. +           if (p1 >= startp)
  327. +               *p1 = c;
  328. +           p1++;
  329. +       }
  330.         else if (c < 0200 && ctl_arrow)
  331.       {
  332.         if (p1 >= startp)
  333. ***************
  334. *** 1917,1922 ****
  335. --- 1925,1937 ----
  336.             p1++;
  337.           }
  338.         while ((p1 - start + hscroll - (hscroll > 0)) % tab_width);
  339. +     }
  340. +       else if (((c <  0200) && (buffer_defaults.ctl_arrow == 1)) ||
  341. +                ((c >= 0200) && buffer_defaults.meta_display))
  342. +       {
  343. +           if (p1 >= start)
  344. +               *p1 = c;
  345. +           p1++;
  346.         }
  347.         else if (c < 0200 && buffer_defaults.ctl_arrow)
  348.       {
  349. -- 
  350. --Christopher Alexander North-Keys----/\--------------------------------------
  351.   Co-founder Group Talisman          /  \/\ ^*^               Harp[@Mcc.Com]
  352.   [*my* opinions]                   /    \ \       Associate Systems Analyst
  353. --------------------------Microelectronics & Computer Technology Corporation--
  354.  
  355.  
  356.