[net.emacs] Gnu Emacs on Suns/redisplay

wmb@sun.uucp (Mitch Bradley) (09/07/85)

Here's a termcap entry for Sun's that improves the
redisplay for gnu emacs (for Gosling's emacs too, if you're
running with an rlogin instead of on the machine with the bitmap).
The idea is that "insert line" is expensive on a bitmap, so you
might as well just repaint the lines.  This termcap entry just
disables the insert-character and insert-line capabilities.

M-|sun-nal|Sun Microsystems Workstation console without insert line:\
	:ic@:im@:ei@:al@:tc=sun:

Mitch Bradley

jpn@teddy.UUCP (09/19/85)

In article <2766@sun.uucp> wmb@sun.uucp (Mitch Bradley) writes:
>
>Here's a termcap entry for Sun's that improves the
>redisplay for gnu emacs (for Gosling's emacs too, if you're
>running with an rlogin instead of on the machine with the bitmap).
>The idea is that "insert line" is expensive on a bitmap, so you
>might as well just repaint the lines.  This termcap entry just
>disables the insert-character and insert-line capabilities.

NO!  This is the WRONG APPROACH.  It is much more expensive to redraw the
whole screen than to insert a line to perform a scroll-reverse.

The worst performance is seen when scrolling multiple lines: the standard
SUN termcap specifies that scrolling must be one line at a time.  If you
add the multi-line add/delete line sequences, the performance of GNU emacs,
gosling emacs (non-bitmap) and vi all improve substantially in many common
situations.

An unrelated improvement to performance might be gained by adding delays
to the insert sequences:  This would indicate to the editor that these
sequences are expensive to use, and should be avoided except when large
changes are being made.  I have not actually tried this yet.

My termcap for sun (note the addition of AL/DL/IC/DC sequences):

Mu|sun|Sun Microsystems Workstation console:\
	:li#34:co#80:cl=^L:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:\
	:ce=\E[K:cd=\E[J:so=\E[7m:se=\E[m:rs=\E[s:am:bs:km:ms:pt:\
	:kd=\E[B:kl=\E[D:ku=\E[A:kr=\E[C:kh=\E[H:\
	:al=\E[L:dl=\E[M:im=:ei=:ic=\E[@:dc=\E[P:\
	:AL=\E[%dL:DL=\E[%dM:IC=\E[%d@:DC=\E[%dP:

hans@erisun.UUCP (Hans Albertson) (09/26/85)

Oh, dear, I've done it again....

the SUN TERMCAP(5) entry says " give :im=: if ic" and 
"give :ei=: if ic" .... Sigh.

Tcsh gets confused if you do this.
Maybe curses wants it this way, right along with vi?

The difficulty of course lies in that termcap is a set of
conventions, and programs using it take full responsibility for
actually using termcap correctly.

Sorry for the confusion.
-- 
Hans Albertsson, USENET/uucp: {decvax,philabs}!mcvax!enea!log-hb!hans
Real World:  TeleLOGIC AB, Box 1001, S-14901 Nynashamn,SWEDEN

jpn@teddy.UUCP (09/27/85)

In article <301@log-hb.UUCP> hans@log-hb.UUCP (Hans Albertsson) writes:
>
>>	:al=\E[L:dl=\E[M:im=:ei=:ic=\E[@:dc=\E[P:\
> NOTE!!!------------------^----^  This is WRONG...
>
>This ENABLES the im and ei functions, assigning the null string to both.
>Which is probably NOT what you want.
>Disabling im and ei should instead be done as follows:
>	:al=\E[L:dl=\E[M:im@:ei@:ic=\E[@:dc=\E[P:\
>according to my TERMCAP(5) manual entry, at least. Both on SUN OS 2.0
>and 4.2 BSD. Trying both shows clearly that this is indeed so.


Excuse me, but you are incorrect.  RTFM!!!!!!!  I am especially annoyed
because you site the man page.  You site it INCORRECTLY!!!!

From the list of capabilities from Termcap(5) BSD4.2 (it is the same on
Sun Version 2, also):

     ei     str         End insert mode; give ":ei=:" if ic
     im     str         Insert mode (enter); give ":im=:" if ic
    
I assume the reasoning is that this allows programs to be written that follow
a single algothim that works with all terminals that have insert capability.
Whether this is the best approach or not is irrelevent:  This is the way it
is documented to work!  I have written a fictional example:

    puts(IM);			/* use insert mode if possible */
    for (i = 0; i < strlen(data); ++i)
        puts(IC);		/* insert one char at a time if necessary */
    puts(data);			/* insert data */
    puts(EI);                   /* exit insert mode if used */

hans@log-hb.UUCP (Hans Albertsson) (10/01/85)

In article <1324@teddy.UUCP> jpn@teddy.UUCP (John P. Nelson) writes:
>
>My termcap for sun (note the addition of AL/DL/IC/DC sequences):
>
>Mu|sun|Sun Microsystems Workstation console:\
>	:li#34:co#80:cl=^L:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:\
>	:ce=\E[K:cd=\E[J:so=\E[7m:se=\E[m:rs=\E[s:am:bs:km:ms:pt:\
>	:kd=\E[B:kl=\E[D:ku=\E[A:kr=\E[C:kh=\E[H:\
>	:al=\E[L:dl=\E[M:im=:ei=:ic=\E[@:dc=\E[P:\
 NOTE!!!------------------^----^  This is WRONG...
>	:AL=\E[%dL:DL=\E[%dM:IC=\E[%d@:DC=\E[%dP:
This ENABLES the im and ei functions, assigning the null string to both.
Which is probably NOT what you want.
Disabling im and ei should instead be done as follows:
	:al=\E[L:dl=\E[M:im@:ei@:ic=\E[@:dc=\E[P:\
according to my TERMCAP(5) manual entry, at least. Both on SUN OS 2.0
and 4.2 BSD. Trying both shows clearly that this is indeed so.

BTW, what version of Gosmacs actually USES AL-DC via TrmTerm.c?
Mine sure doesn't...

-- 
Hans Albertsson, USENET/uucp: {decvax,philabs}!mcvax!enea!log-hb!hans
						     ....!erix!erisun!hans
Real World:  ERICSSON Information Systems,Sundbyberg,SWEDEN

hansen@pegasus.UUCP (Tony L. Hansen) (10/10/85)

< >
< >>	:al=\E[L:dl=\E[M:im=:ei=:ic=\E[@:dc=\E[P:\
< > NOTE!!!------------------^----^  This is WRONG...
< >
< >This ENABLES the im and ei functions, assigning the null string to both.
< >Which is probably NOT what you want.
< >Disabling im and ei should instead be done as follows:
< >	:al=\E[L:dl=\E[M:im@:ei@:ic=\E[@:dc=\E[P:\
<
< From the list of capabilities from Termcap(5) BSD4.2 (it is the same on
< Sun Version 2, also):
< 
<      ei     str         End insert mode; give ":ei=:" if ic
<      im     str         Insert mode (enter); give ":im=:" if ic
<     

Actually, in this case I've always considered the termcap manual page to be
plain wrong. Current usage of both termcap and terminfo, in curses, for
example, assumes that ei and im are only defined if they really have some
meaning. The same statement can be made for all string variables.

					Tony Hansen
					ihnp4!pegasus!hansen