mjp@spice.cs.cmu.edu (Michael Portuesi) (09/20/86)
Keywords: I received mail from a number of people who received the message with all but the first 10 lines truncated. Therefore, I am reposting the message. --------------------original message follows-------------------- My problem with scrolling on a VT100 with GNU Emacs has been solved. Many thanks to those of you who sent me mail explaining the problem. I also found a file with the standard Emacs distribution (TERMS) that cleared things up a bit. GNU Emacs is very careful about being "display-efficient" -- it makes certain assumptions about your terminal to update the display as quickly as possible. For a character-based terminal, scrolling is a cheap operation compared to rewriting everything on the display. When you type C-N and move off the bottom of the screen, Emacs will scroll the text halfway up the screen and write new text on the lower half. For a bit-mapped terminal, however, scrolling is very expensive -- it's better to rewrite everything instead of scrolling it. So Emacs will rewrite the entire screen when you C-N off the bottom of the screen, or you insert a new line. The way Emacs tells whether it should scroll or redraw is defined in your termcap. Certain strings must be defined for operations such as scroll region, multiple-line insert and delete, etc. If these are not defined, Emacs assumes your terminal is either a bitmap terminal or incapable of these actions and redraws everything. There is also a GNU Emacs variable called scroll-step. If that value is too big for the current window, Emacs will redraw the window rather than scroll. I received a few termcap entries. I've tested both, and they do indeed work properly with GNU Emacs. The first termcap I received is from Steven Litvintchouk, sdl@mitre-bedford (ARPA) and ...{cbosgd,decvax,genrad,ll-xn,philabs,security,utzoo}!linus!sdl (UUCP) It was written by Richard Stallman himself. Steve added some padding to the termcap so that VT100s could keep up at 9600 baud: d0|vt100|vt100-am|dec vt100 with stallmans suggested slower scrolling:\ :cr=^M:do=^J:nl=^J:bl=^G:co#80:li#24:cl=50\E[;H\E[2J:\ :le=^H:bs:am:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:\ :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\ :md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:\ :is=\E<\E[m\E>\E[?7h\E[?3;4;6l\200\200\200\200\200\200\200\200:\ :rs=\E<\E[m\E>\E[?7h\E[?3;4;6l\200\200\200\200\200\200\200\200:\ :if=/usr/lib/tabset/vt100:\ :ks=\E[?1h\E=:ke=\E[?1l\E>:kh=\E[H\ :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\ :ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:ta=^I:pt:dN#4:vt#3:xn:\ :sc=\E7:rc=\E8:cs=\E[%i%d;%dr:vb=\E[?5h\177\177\E[?5l:\ :sf=3*^J:sr=3*\EM: The second termcap is from Scott Preece, ihnp4!uiucdcs!ccvaxa!preece (UUCP) and preece@gswd-vms (ARPA). This termcap does not do any padding for the scrolling operations. Hence, it is faster. It works fine with my VT100 at 1200 baud, but I haven't tried it with higher baud rates. Stallman says the following about scroll speed: Watch out for termcap entries for VT100's that fail to specify the `sf' string, or that omit the padding needed for the `sf' and `sr' strings (2msec per line affected). What you need is :sf=2*^J:sr=2*\EM:cs=\E[%i%d;%dr: Anyway, here is the second termcap: d0|vt100|vt100-am|dec vt100:\ :cr=^M:do=^J:nl=^J:bl=^G:co#80:li#24:cl=50\E[;H\E[2J:\ :le=^H:bs:am:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:\ :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\ :md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:is=\E[1;24r\E[24;1H:\ :rf=/usr/lib/tabset/vt100:\ :rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\ :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\ :ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:ta=^I:pt:sr=5\EM:vt#3:xn:\ :is=\E>\E[?3l\E[?4l\E[?7h\E[?8h:if=/usr/lib/tabset/vt100:kh=\E[H:\ :sc=\E7:rc=\E8:cs=\E[%i%d;%dr: Again, thanks to all of you who sent me your suggestions. -- +----------------------------------------------------------------------------+ | Mike Portuesi | | Carnegie-Mellon University Computer Science Department | | | | ARPA: mjp@spice.cs.cmu.edu (preferred), mp1u@td.cc.cmu.edu | | UUCP: {harvard | seismo | ucbvax | decwrl}!spice.cs.cmu.edu!mjp | | | | "Little things remind me of you...Cheap cologne and that damn song too!" | | --The Flirts, "Jukebox" | +----------------------------------------------------------------------------+