Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker!bloom-beacon!eru!luth!sunic!sics.se!sics.se!jw From: jw@sics.se (Johan Widen) Newsgroups: comp.emacs Subject: Re: Character display Message-ID: Date: 7 Dec 89 21:49:38 GMT References: <7230@pt.cs.cmu.edu> Sender: news@sics.se Distribution: gnu Organization: Swedish Institute of Computer Science, Kista Lines: 198 In-Reply-To: cline@PROOF.ERGO.CS.CMU.EDU's message of 6 Dec 89 19:19:17 GMT In article <7230@pt.cs.cmu.edu> cline@PROOF.ERGO.CS.CMU.EDU (Kenneth Cline) writes: cline> Incorporating the diffs for buffer.c, indent.c and xdisp.c below will cline> cause emacs to display 255 character fonts (newline is special) in cline> buffers with local variable ctl-arrow set to any value other than T or cline> NIL. cline> By the way, I have been told that these diffs can not be automatically cline> incorporated into source files. Forgive my ignorance of the proper cline> commands and be glad that the changes are small. I applied the diff to emacs-18.55. Here is a context diff versus that version. (Does anyone have a recipe for teaching emacs to read 8 bit characters from the keyboard? How do I tell emacs that I want to enter an "umlaut a" for instance?) *** /tmp/,RCSt1a14606 Thu Dec 7 22:01:03 1989 --- buffer.c Thu Dec 7 21:00:44 1989 *************** *** 1297,1305 **** Automatically becomes local when set in any fashion."); DEFVAR_PER_BUFFER ("ctl-arrow", &bf_cur->ctl_arrow, ! "*Non-nil means display control chars with uparrow.\n\ Nil means use backslash and octal digits.\n\ ! Automatically becomes local when set in any fashion."); DEFVAR_PER_BUFFER ("truncate-lines", &bf_cur->truncate_lines, "*Non-nil means do not display continuation lines;\n\ --- 1297,1308 ---- Automatically becomes local when set in any fashion."); DEFVAR_PER_BUFFER ("ctl-arrow", &bf_cur->ctl_arrow, ! "*t means display control chars with uparrow.\n\ Nil means use backslash and octal digits.\n\ ! Otherwise assume that control and meta chars are printable.\n\ ! Automatically becomes local when set in any fashion.\n\ ! \n\ ! This is an Ergo local feature."); DEFVAR_PER_BUFFER ("truncate-lines", &bf_cur->truncate_lines, "*Non-nil means do not display continuation lines;\n\ *** /tmp/,RCSt1a14611 Thu Dec 7 22:01:15 1989 --- indent.c Thu Dec 7 21:12:42 1989 *************** *** 67,73 **** register int tab_seen; register int post_tab; register int tab_width = XINT (bf_cur->tab_width); ! int ctl_arrow = !NULL (bf_cur->ctl_arrow); if (point == last_known_column_point && bf_modified == last_known_column_modified) --- 67,74 ---- register int tab_seen; register int post_tab; register int tab_width = XINT (bf_cur->tab_width); ! int ctl_arrow = (!NULL (bf_cur->ctl_arrow)) ! + (EQ (bf_cur->ctl_arrow, Qt)); if (point == last_known_column_point && bf_modified == last_known_column_modified) *************** *** 109,115 **** tab_seen = 1; } else ! col += (ctl_arrow && c < 0200) ? 2 : 4; } if (tab_seen) --- 110,117 ---- tab_seen = 1; } else ! col += (ctl_arrow == 1 && c >= 0177) ? 1 : ! (ctl_arrow && c < 0200) ? 2 : 4; } if (tab_seen) *************** *** 231,237 **** register int goal; register int end = NumCharacters; register int tab_width = XINT (bf_cur->tab_width); ! register int ctl_arrow = !NULL (bf_cur->ctl_arrow); Lisp_Object val; --- 233,240 ---- register int goal; register int end = NumCharacters; register int tab_width = XINT (bf_cur->tab_width); ! register int ctl_arrow = (!NULL (bf_cur->ctl_arrow)) ! + (EQ (bf_cur->ctl_arrow, Qt)); Lisp_Object val; *************** *** 258,263 **** --- 261,268 ---- col += tab_width - 1; col = col / tab_width * tab_width; } + else if (ctl_arrow == 1) + continue; else if (ctl_arrow && (c < 040 || c == 0177)) col++; else if (c < 040 || c >= 0177) *************** *** 306,312 **** register int pos; register int c; register int tab_width = XFASTINT (bf_cur->tab_width); ! register int ctl_arrow = !NULL (bf_cur->ctl_arrow); int selective = XTYPE (bf_cur->selective_display) == Lisp_Int ? XINT (bf_cur->selective_display) --- 311,318 ---- register int pos; register int c; register int tab_width = XFASTINT (bf_cur->tab_width); ! register int ctl_arrow = (!NULL (bf_cur->ctl_arrow)) ! + (EQ (bf_cur->ctl_arrow, Qt)); int selective = XTYPE (bf_cur->selective_display) == Lisp_Int ? XINT (bf_cur->selective_display) *************** *** 370,376 **** } } else ! cpos += (ctl_arrow && c < 0200) ? 2 : 4; if (HPOS (cpos) >= width && (HPOS (cpos) > width --- 376,382 ---- } } else ! cpos += (ctl_arrow == 1) ? 1 : (ctl_arrow && c < 0200) ? 2 : 4; if (HPOS (cpos) >= width && (HPOS (cpos) > width *** /tmp/,RCSt1a14616 Thu Dec 7 22:01:38 1989 --- xdisp.c Thu Dec 7 21:21:38 1989 *************** *** 1203,1209 **** register char *p1prev; register struct display_line *line; int tab_width = XINT (bf_cur->tab_width); ! int ctl_arrow = !NULL (bf_cur->ctl_arrow); int width = XFASTINT (w->width) - 1 - (XFASTINT (w->width) + XFASTINT (w->left) != screen_width); struct position val; --- 1203,1210 ---- register char *p1prev; register struct display_line *line; int tab_width = XINT (bf_cur->tab_width); ! int ctl_arrow = (!NULL (bf_cur->ctl_arrow)) ! + (EQ (bf_cur->ctl_arrow, Qt)); int width = XFASTINT (w->width) - 1 - (XFASTINT (w->width) + XFASTINT (w->left) != screen_width); struct position val; *************** *** 1319,1324 **** --- 1320,1331 ---- } break; } + else if (ctl_arrow == 1) + { + if (p1 >= startp) + *p1 = c; + p1++; + } else if (c < 0200 && ctl_arrow) { if (p1 >= startp) *************** *** 1917,1922 **** --- 1924,1935 ---- p1++; } while ((p1 - start + hscroll - (hscroll > 0)) % tab_width); + } + else if (buffer_defaults.ctl_arrow == 1) + { + if (p1 >= start) + *p1 = c; + p1++; } else if (c < 0200 && buffer_defaults.ctl_arrow) { -- Johan Widen SICS, PO Box 1263, S-164 28 KISTA, SWEDEN Internet: jw@sics.se Tel: +46 8 752 15 32 Ttx: 812 61 54 SICS S Fax: +46 8 751 72 30